select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, r.status, r.del_flag, r.create_time, r.remark from system_role r left join system_user_role ur on ur.role_id = r.role_id left join system_user u on u.user_id = ur.user_id left join system_dept d on u.dept_id = d.dept_id
where r.del_flag = '0' AND r.role_id = #{roleId} AND r.status = #{status} AND r.role_name LIKE '%' || #{roleName} || '%' AND r.role_key LIKE '%' || #{roleKey} || '%' AND r.create_time >= #{params.beginTime} AND r.create_time <= #{params.endTime} AND r.role_name like concat('%', #{roleName}, '%') AND r.role_key like concat('%', #{roleKey}, '%') and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') ${params.dataScope} order by r.role_sort
WHERE r.del_flag = '0' and ur.user_id = #{userId}
select r.role_id from system_role r left join system_user_role ur on ur.role_id = r.role_id left join system_user u on u.user_id = ur.user_id where u.user_id = #{userId}
where r.role_id = #{roleId}
WHERE r.del_flag = '0' and u.user_name = #{userName}
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
insert into system_role( role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, remark, create_by, create_time )values( #{roleId}, #{roleName}, #{roleKey}, #{roleSort}, #{dataScope}, #{menuCheckStrictly}, #{deptCheckStrictly}, #{status}, #{remark}, #{createBy}, sysdate() )
update system_role role_name = #{roleName}, role_key = #{roleKey}, role_sort = #{roleSort}, data_scope = #{dataScope}, menu_check_strictly = #{menuCheckStrictly}, dept_check_strictly = #{deptCheckStrictly}, status = #{status}, remark = #{remark}, update_by = #{updateBy}, update_time = sysdate() where role_id = #{roleId}
update system_role set del_flag = '2' where role_id = #{roleId}
update system_role set del_flag = '2' where role_id in #{roleId}