|
@@ -15,15 +15,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
+ <result property="tenantId" column="tenant_id"/>
|
|
|
</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,
|
|
|
+ tenant_id
|
|
|
from sys_post
|
|
|
- </sql>
|
|
|
-
|
|
|
+ </sql>
|
|
|
+
|
|
|
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
|
|
- <include refid="selectPostVo"/>
|
|
|
+ <include refid="selectPostVo"/>
|
|
|
<where>
|
|
|
<if test="postCode != null and postCode != ''">
|
|
|
AND post_code like concat('%', #{postCode}, '%')
|
|
@@ -34,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="postName != null and postName != ''">
|
|
|
AND post_name like concat('%', #{postName}, '%')
|
|
|
</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -71,19 +83,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<include refid="selectPostVo"/>
|
|
|
where post_code=#{postCode} limit 1
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<update id="updatePost" parameterType="SysPost">
|
|
|
- update sys_post
|
|
|
- <set>
|
|
|
- <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
|
|
- <if test="postName != null and postName != ''">post_name = #{postName},</if>
|
|
|
- <if test="postSort != null">post_sort = #{postSort},</if>
|
|
|
- <if test="status != null and status != ''">status = #{status},</if>
|
|
|
- <if test="remark != null">remark = #{remark},</if>
|
|
|
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
- update_time = sysdate()
|
|
|
- </set>
|
|
|
- where post_id = #{postId}
|
|
|
+ update sys_post
|
|
|
+ <set>
|
|
|
+ <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
|
|
+ <if test="postName != null and postName != ''">post_name = #{postName},</if>
|
|
|
+ <if test="postSort != null">post_sort = #{postSort},</if>
|
|
|
+ <if test="status != null and status != ''">status = #{status},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where post_id = #{postId}
|
|
|
</update>
|
|
|
|
|
|
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
|
@@ -94,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="postSort != null">post_sort,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
create_time
|
|
|
)values(
|
|
@@ -103,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="postSort != null">#{postSort},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
sysdate()
|
|
|
)
|