commit for pull

This commit is contained in:
caixiang 2023-03-01 12:05:06 +08:00
parent 31bc287207
commit 14745366be
9 changed files with 28 additions and 20 deletions

View File

@ -6,8 +6,9 @@
<select id="getList" resultType="com.cnbm.admin.entity.SysDeptEntity"> <select id="getList" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1 select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
<where> <where>
t1.valid = 1
<if test="deptIdList != null"> <if test="deptIdList != null">
t1.id in and t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")"> <foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@ -18,15 +19,15 @@
<select id="getById" resultType="com.cnbm.admin.entity.SysDeptEntity"> <select id="getById" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1 select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where t1.id = #{value} where t1.id = #{value} AND t1.valid = 1
</select> </select>
<select id="getIdAndPidList" resultType="com.cnbm.admin.entity.SysDeptEntity"> <select id="getIdAndPidList" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.id, t1.pid from sys_dept t1 select t1.id, t1.pid from sys_dept t1 AND t1.valid = 1
</select> </select>
<select id="getSubDeptIdList" resultType="long"> <select id="getSubDeptIdList" resultType="long">
select id from sys_dept where pids like #{id} select id from sys_dept where pids like #{id} AND valid = 1
</select> </select>
</mapper> </mapper>

View File

@ -4,7 +4,7 @@
<mapper namespace="com.cnbm.admin.dao.SysDictDataDao"> <mapper namespace="com.cnbm.admin.dao.SysDictDataDao">
<select id="getDictDataList" resultType="com.cnbm.admin.entity.DictData"> <select id="getDictDataList" resultType="com.cnbm.admin.entity.DictData">
select dict_type_id, dict_label, dict_value from sys_dict_data order by dict_type_id, sort select dict_type_id, dict_label, dict_value from sys_dict_data WHERE valid = 1 order by dict_type_id, sort
</select> </select>
</mapper> </mapper>

View File

@ -4,7 +4,7 @@
<mapper namespace="com.cnbm.admin.dao.SysDictTypeDao"> <mapper namespace="com.cnbm.admin.dao.SysDictTypeDao">
<select id="getDictTypeList" resultType="com.cnbm.admin.entity.DictType"> <select id="getDictTypeList" resultType="com.cnbm.admin.entity.DictType">
select id, dict_type from sys_dict_type order by dict_type, sort select id, dict_type from sys_dict_type WHERE valid = 1 order by dict_type, sort
</select> </select>
</mapper> </mapper>

View File

@ -5,7 +5,7 @@
<!-- 根据参数编码查询value --> <!-- 根据参数编码查询value -->
<select id="getValueByCode" resultType="String"> <select id="getValueByCode" resultType="String">
select param_value from sys_params where param_code = #{value} select param_value from sys_params where param_code = #{value} AND valid = 1
</select> </select>
<!-- 获取参数编码列表 --> <!-- 获取参数编码列表 -->
@ -14,10 +14,11 @@
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
AND valid = 1
</select> </select>
<!-- 根据参数编码更新value --> <!-- 根据参数编码更新value -->
<update id="updateValueByCode"> <update id="updateValueByCode">
update sys_params set param_value = #{paramValue} where param_code = #{paramCode} update sys_params set param_value = #{paramValue} where param_code = #{paramCode} AND valid = 1
</update> </update>
</mapper> </mapper>

View File

@ -4,12 +4,13 @@
<mapper namespace="com.cnbm.admin.dao.SysRoleDataScopeDao"> <mapper namespace="com.cnbm.admin.dao.SysRoleDataScopeDao">
<select id="getDeptIdList" resultType="long"> <select id="getDeptIdList" resultType="long">
select dept_id from sys_role_data_scope where role_id = #{value} select dept_id from sys_role_data_scope where role_id = #{value} AND valid = 1
</select> </select>
<select id="getDataScopeList" resultType="long"> <select id="getDataScopeList" resultType="long">
select t2.dept_id from sys_role_user t1, sys_role_data_scope t2 select t2.dept_id from sys_role_user t1, sys_role_data_scope t2
where t1.user_id = #{value} and t1.role_id = t2.role_id where t1.user_id = #{value} and t1.role_id = t2.role_id
AND t1.valid = 1
</select> </select>
<delete id="deleteByRoleIds"> <delete id="deleteByRoleIds">
@ -17,6 +18,7 @@
<foreach item="roleId" collection="array" open="(" separator="," close=")"> <foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId} #{roleId}
</foreach> </foreach>
AND valid = 1
</delete> </delete>
</mapper> </mapper>

View File

@ -4,7 +4,7 @@
<mapper namespace="com.cnbm.admin.dao.SysRoleMenuDao"> <mapper namespace="com.cnbm.admin.dao.SysRoleMenuDao">
<select id="getMenuIdList" resultType="long"> <select id="getMenuIdList" resultType="long">
select menu_id from sys_role_menu where role_id = #{value} select menu_id from sys_role_menu where role_id = #{value} AND valid = 1
</select> </select>
<delete id="deleteByRoleIds"> <delete id="deleteByRoleIds">
@ -12,9 +12,10 @@
<foreach item="roleId" collection="array" open="(" separator="," close=")"> <foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId} #{roleId}
</foreach> </foreach>
AND valid = 1
</delete> </delete>
<delete id="deleteByMenuId"> <delete id="deleteByMenuId">
delete from sys_role_menu where menu_id = #{value} delete from sys_role_menu where menu_id = #{value} AND valid = 1
</delete> </delete>
</mapper> </mapper>

View File

@ -8,6 +8,7 @@
<foreach item="roleId" collection="array" open="(" separator="," close=")"> <foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId} #{roleId}
</foreach> </foreach>
AND valid = 1
</delete> </delete>
<delete id="deleteByUserIds"> <delete id="deleteByUserIds">
@ -15,10 +16,11 @@
<foreach item="userId" collection="array" open="(" separator="," close=")"> <foreach item="userId" collection="array" open="(" separator="," close=")">
#{userId} #{userId}
</foreach> </foreach>
AND valid = 1
</delete> </delete>
<select id="getRoleIdList" resultType="long"> <select id="getRoleIdList" resultType="long">
select role_id from sys_role_user where user_id = #{value} select role_id from sys_role_user where user_id = #{value} AND valid = 1
</select> </select>
</mapper> </mapper>

View File

@ -5,7 +5,7 @@
<select id="getList" resultType="com.cnbm.admin.entity.SysUserEntity"> <select id="getList" resultType="com.cnbm.admin.entity.SysUserEntity">
select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1 select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1
where t1.super_admin = 0 where t1.super_admin = 0 AND t1.valid = 1
<if test="username != null and username.trim() != ''"> <if test="username != null and username.trim() != ''">
and t1.username like #{username} and t1.username like #{username}
</if> </if>
@ -25,19 +25,19 @@
<select id="getById" resultType="com.cnbm.admin.entity.SysUserEntity"> <select id="getById" resultType="com.cnbm.admin.entity.SysUserEntity">
select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1 select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1
where t1.id = #{value} where t1.id = #{value} AND t1.valid = 1
</select> </select>
<select id="getByUsername" resultType="com.cnbm.admin.entity.SysUserEntity"> <select id="getByUsername" resultType="com.cnbm.admin.entity.SysUserEntity">
select * from sys_user where username = #{value} select * from sys_user where username = #{value} AND valid = 1
</select> </select>
<update id="updatePassword"> <update id="updatePassword">
update sys_user set password = #{newPassword} where id = #{id} update sys_user set password = #{newPassword} where id = #{id} AND valid = 1
</update> </update>
<select id="getCountByDeptId" resultType="int"> <select id="getCountByDeptId" resultType="int">
select count(*) from sys_user where dept_id = #{value} select count(*) from sys_user where dept_id = #{value} AND valid = 1
</select> </select>
<select id="getUserIdListByDeptId" resultType="Long"> <select id="getUserIdListByDeptId" resultType="Long">
@ -45,6 +45,7 @@
<foreach item="deptId" collection="list" open="(" separator="," close=")"> <foreach item="deptId" collection="list" open="(" separator="," close=")">
#{deptId} #{deptId}
</foreach> </foreach>
AND valid = 1
</select> </select>
</mapper> </mapper>