zouyu
2 天以前 848d609a35569b029bbdd5ab91c1df2a0f568819
src/main/resources/mapper/system/SysPostMapper.xml
@@ -19,7 +19,7 @@
   
   <sql id="selectPostVo">
        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark 
      from sys_post
      from sys_post p
    </sql>
   
   <select id="selectPostList" parameterType="com.ruoyi.project.system.domain.SysPost" resultMap="SysPostResult">
@@ -34,6 +34,8 @@
         <if test="postName != null and postName != ''">
            AND post_name like concat('%', #{postName}, '%')
         </if>
            <!-- 数据范围过滤 -->
            ${params.dataScope}
      </where>
   </select>
   
@@ -71,8 +73,14 @@
      <include refid="selectPostVo"/>
       where post_code=#{postCode} limit 1
   </select>
   <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost">
    <select id="selectPostByTenantId" resultType="com.ruoyi.project.system.domain.SysPost">
        <include refid="selectPostVo"/>
        <where>
            AND p.tenant_id = #{tenantId}
        </where>
    </select>
    <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost">
       update sys_post
       <set>
          <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
@@ -95,6 +103,7 @@
          <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 != ''">tenant_id,</if>
          create_time
       )values(
          <if test="postId != null and postId != 0">#{postId},</if>
@@ -104,6 +113,7 @@
          <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 != ''">#{tenantId},</if>
          sysdate()
       )
   </insert>