|
@@ -15,10 +15,11 @@ 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>
|
|
|
|
|
@@ -34,6 +35,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 tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -62,14 +66,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where u.user_name = #{userName}
|
|
|
</select>
|
|
|
|
|
|
- <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
+ <select id="checkPostNameUnique" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
- where post_name=#{postName} limit 1
|
|
|
+ where post_name= #{postName} and tenant_id = #{tenantId} limit 1
|
|
|
</select>
|
|
|
|
|
|
- <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
+ <select id="checkPostCodeUnique" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
- where post_code=#{postCode} limit 1
|
|
|
+ where post_code= #{postCode} and tenant_id = #{tenantId} limit 1
|
|
|
</select>
|
|
|
|
|
|
<update id="updatePost" parameterType="SysPost">
|
|
@@ -79,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
update_time = sysdate()
|
|
@@ -93,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="postName != null and postName != ''">post_name,</if>
|
|
|
<if test="postSort != null">post_sort,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
+ <if test="tenantId != null">tenant_id,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
create_time
|
|
@@ -102,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="postName != null and postName != ''">#{postName},</if>
|
|
|
<if test="postSort != null">#{postSort},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
+ <if test="tenantId != null">#{tenantId},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
sysdate()
|