commit init

This commit is contained in:
weihongyang
2022-06-20 16:26:51 +08:00
commit 7aaa6700b3
171 changed files with 9178 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.LoginDao">
</mapper>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysDeptDao">
<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
<where>
<if test="deptIdList != null">
t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by t1.sort asc
</select>
<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
where t1.id = #{value}
</select>
<select id="getIdAndPidList" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.id, t1.pid from sys_dept t1
</select>
<select id="getSubDeptIdList" resultType="long">
select id from sys_dept where pids like #{id}
</select>
</mapper>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysDictDataDao">
<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>
</mapper>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysDictTypeDao">
<select id="getDictTypeList" resultType="com.cnbm.admin.entity.DictType">
select id, dict_type from sys_dict_type order by dict_type, sort
</select>
</mapper>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysLogErrorDao">
</mapper>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysLogOperationDao">
</mapper>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysMenuDao">
<select id="getById" resultType="com.cnbm.admin.entity.SysMenuEntity">
select t1.*, (select name from sys_menu t2 where t2.id=t1.pid) as parentName from sys_menu t1
where t1.id = #{id}
</select>
<select id="getMenuList" resultType="com.cnbm.admin.entity.SysMenuEntity">
select t1.* from sys_menu t1
<where>
<if test="type != null">
t1.type = #{type}
</if>
</where>
order by t1.sort asc
</select>
<select id="getUserMenuList" resultType="com.cnbm.admin.entity.SysMenuEntity">
select t3.* from sys_role_user t1
left join sys_role_menu t2 on t1.role_id = t2.role_id
left join sys_menu t3 on t2.menu_id = t3.id
where t1.user_id = #{userId}
<if test="type != null">
and t3.type = #{type}
</if>
order by t3.sort asc
</select>
<select id="getUserPermissionsList" resultType="string">
select t3.permissions from sys_role_user t1 left join sys_role_menu t2 on t1.role_id = t2.role_id
left join sys_menu t3 on t2.menu_id = t3.id
where t1.user_id = #{userId} order by t3.sort asc
</select>
<select id="getPermissionsList" resultType="string">
select permissions from sys_menu
</select>
<select id="getListPid" resultType="com.cnbm.admin.entity.SysMenuEntity">
select * from sys_menu where pid = #{value}
</select>
</mapper>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysParamsDao">
<!-- 根据参数编码查询value -->
<select id="getValueByCode" resultType="String">
select param_value from sys_params where param_code = #{value}
</select>
<!-- 获取参数编码列表 -->
<select id="getParamCodeList" resultType="String">
select param_code from sys_params where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 根据参数编码更新value -->
<update id="updateValueByCode">
update sys_params set param_value = #{paramValue} where param_code = #{paramCode}
</update>
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysRoleDao">
</mapper>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysRoleDataScopeDao">
<select id="getDeptIdList" resultType="long">
select dept_id from sys_role_data_scope where role_id = #{value}
</select>
<select id="getDataScopeList" resultType="long">
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
</select>
<delete id="deleteByRoleIds">
delete from sys_role_data_scope where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysRoleMenuDao">
<select id="getMenuIdList" resultType="long">
select menu_id from sys_role_menu where role_id = #{value}
</select>
<delete id="deleteByRoleIds">
delete from sys_role_menu where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<delete id="deleteByMenuId">
delete from sys_role_menu where menu_id = #{value}
</delete>
</mapper>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysRoleUserDao">
<delete id="deleteByRoleIds">
delete from sys_role_user where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<delete id="deleteByUserIds">
delete from sys_role_user where user_id in
<foreach item="userId" collection="array" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<select id="getRoleIdList" resultType="long">
select role_id from sys_role_user where user_id = #{value}
</select>
</mapper>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.admin.dao.SysUserDao">
<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
where t1.super_admin = 0
<if test="username != null and username.trim() != ''">
and t1.username like #{username}
</if>
<if test="deptId != null and deptId.trim() != ''">
and t1.dept_id = #{deptId}
</if>
<if test="gender != null and gender.trim() != ''">
and t1.gender = #{gender}
</if>
<if test="deptIdList != null">
and t1.dept_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</select>
<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
where t1.id = #{value}
</select>
<select id="getByUsername" resultType="com.cnbm.admin.entity.SysUserEntity">
select * from sys_user where username = #{value}
</select>
<update id="updatePassword">
update sys_user set password = #{newPassword} where id = #{id}
</update>
<select id="getCountByDeptId" resultType="int">
select count(*) from sys_user where dept_id = #{value}
</select>
<select id="getUserIdListByDeptId" resultType="Long">
select id from sys_user where dept_id in
<foreach item="deptId" collection="list" open="(" separator="," close=")">
#{deptId}
</foreach>
</select>
</mapper>