|
|
@@ -16,12 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<sql id="selectPostVo">
|
|
|
- select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
|
|
+ select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
|
|
from sys_post
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
<where>
|
|
|
@@ -35,17 +35,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND post_name like concat('%', #{postName}, '%')
|
|
|
</if>
|
|
|
</where>
|
|
|
+ order by post_sort
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPostAll" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
where post_id = #{postId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
|
|
|
select p.post_id
|
|
|
from sys_post p
|
|
|
@@ -53,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join sys_user u on u.user_id = up.user_id
|
|
|
where u.user_id = #{userId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
|
|
select p.post_id, p.post_name, p.post_code
|
|
|
from sys_post p
|
|
|
@@ -61,17 +62,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join sys_user u on u.user_id = up.user_id
|
|
|
where u.user_name = #{userName}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
where post_name=#{postName} limit 1
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
where post_code=#{postCode} limit 1
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<update id="updatePost" parameterType="SysPost">
|
|
|
update sys_post
|
|
|
<set>
|
|
|
@@ -85,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</set>
|
|
|
where post_id = #{postId}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
|
|
insert into sys_post(
|
|
|
<if test="postId != null and postId != 0">post_id,</if>
|
|
|
@@ -107,16 +108,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deletePostById" parameterType="Long">
|
|
|
delete from sys_post where post_id = #{postId}
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deletePostByIds" parameterType="Long">
|
|
|
delete from sys_post where post_id in
|
|
|
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
|
|
#{postId}
|
|
|
- </foreach>
|
|
|
+ </foreach>
|
|
|
</delete>
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|