|
@@ -15,6 +15,7 @@ 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">
|
|
@@ -31,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null and status != ''">
|
|
|
AND status = #{status}
|
|
|
</if>
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
<if test="postName != null and postName != ''">
|
|
|
AND post_name like concat('%', #{postName}, '%')
|
|
|
</if>
|
|
@@ -64,12 +68,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
- where post_name=#{postName} limit 1
|
|
|
+ where post_name=#{postName}
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
|
|
<include refid="selectPostVo"/>
|
|
|
- where post_code=#{postCode} limit 1
|
|
|
+ where post_code=#{postCode}
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
|
|
|
<update id="updatePost" parameterType="com.usky.system.domain.SysPost">
|
|
@@ -95,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">tenant_id,</if>
|
|
|
create_time
|
|
|
)values(
|
|
|
<if test="postId != null and postId != 0">#{postId},</if>
|
|
@@ -104,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">#{tenantId},</if>
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|