mitao
2024-04-15 ce7e6574a1f9942fc090d989b52aceaa11ba8f3e
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -76,7 +76,7 @@
  <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
    <include refid="selectRoleVo"/>
    where r.role_id = #{roleId}
    where r.role_id = #{roleId} AND r.del_flag = 0
  </select>
  <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
@@ -139,9 +139,7 @@
           status              AS status,
           del_flag            AS delFlag,
           create_time         AS createTime,
           create_by           AS createBy,
           postType            AS postType,
           removeDays          AS removeDays
           create_by           AS createBy
    from sys_role
    where del_flag = 0
  </select>
@@ -181,8 +179,6 @@
    <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="removeDays != null">removeDays,</if>
    <if test="postType != null">postType,</if>
    create_time
    )values(
    <if test="roleId != null and roleId != 0">#{roleId},</if>
@@ -195,8 +191,6 @@
    <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="removeDays != null">#{removeDays},</if>
    <if test="postType != null">#{postType},</if>
    sysdate()
    )
  </insert>
@@ -213,8 +207,6 @@
      <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>
      <if test="removeDays != null">removeDays = #{removeDays},</if>
      <if test="postType != null">postType = #{postType},</if>
      update_time = sysdate()
    </set>
    where role_id = #{roleId}
@@ -231,12 +223,12 @@
  <delete id="deleteRoleById" parameterType="Long">
    update sys_role
    set del_flag = '2'
    set del_flag = '1'
    where role_id = #{roleId}
  </delete>
  <delete id="deleteRoleByIds" parameterType="Long">
    update sys_role set del_flag = '2' where role_id in
    update sys_role set del_flag = '1' where role_id in
    <foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
      #{roleId}
    </foreach>