| | |
| | | |
| | | <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"> |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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} |
| | |
| | | |
| | | <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> |