Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qy-zhjt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luojun
qy-zhjt
Commits
ab0c0b6c
Commit
ab0c0b6c
authored
Dec 17, 2024
by
luojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper文件添加
parent
78c9560e
Pipeline
#6322
canceled with stages
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
336 additions
and
1 deletion
+336
-1
pom.xml
pom.xml
+1
-1
DeptMapper.xml
src/main/resources/mapper/DeptMapper.xml
+32
-0
DictDetailMapper.xml
src/main/resources/mapper/DictDetailMapper.xml
+8
-0
DictMapper.xml
src/main/resources/mapper/DictMapper.xml
+30
-0
MenuMapper.xml
src/main/resources/mapper/MenuMapper.xml
+49
-0
ParkingInInfoMapper.xml
src/main/resources/mapper/ParkingInInfoMapper.xml
+25
-0
ParkingInfoMapper.xml
src/main/resources/mapper/ParkingInfoMapper.xml
+51
-0
RoleMapper.xml
src/main/resources/mapper/RoleMapper.xml
+45
-0
UserMapper.xml
src/main/resources/mapper/UserMapper.xml
+95
-0
No files found.
pom.xml
View file @
ab0c0b6c
...
...
@@ -15,7 +15,7 @@
<jjwt.version>
0.11.1
</jjwt.version>
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
<jna.version>
5.5.0
</jna.version>
<druid.version>
1.
2.14
</druid.version>
<druid.version>
1.
1.22
</druid.version>
<mybatis-plus.version>
3.3.0
</mybatis-plus.version>
</properties>
...
...
src/main/resources/mapper/DeptMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.DeptMapper"
>
<resultMap
id=
"Dept"
type=
"admin.modules.system.domain.Dept"
>
<id
property=
"id"
column=
"dept_id"
/>
<result
property=
"updatedBy"
column=
"update_by"
/>
<collection
property=
"roles"
column=
"dept_id"
select=
"selectRole"
>
</collection>
</resultMap>
<select
id=
"selectRole"
resultType=
"admin.modules.system.domain.Role"
>
select a.* from sys_role a left join sys_roles_depts b on a.role_id = b.role_id where b.dept_id = #{dept_id}
</select>
<update
id=
"updateSubCntById"
>
update sys_dept set sub_count = #{count} where dept_id = #{id}
</update>
<select
id=
"findByRoleId"
resultType=
"admin.modules.system.domain.Dept"
>
SELECT d.dept_id as id, d.* FROM sys_dept d LEFT OUTER JOIN sys_roles_depts rd ON d.dept_id=rd.dept_id WHERE rd.role_id=#{roleId}
</select>
<select
id=
"findByPid"
resultMap=
"Dept"
>
select * from sys_dept where pid = #{id}
</select>
<select
id=
"findByPidIsNull"
resultMap=
"Dept"
>
select * from sys_dept where pid is null
</select>
<select
id=
"countByPid"
resultType=
"java.lang.Integer"
>
select count(1) from sys_dept where pid = #{pid}
</select>
</mapper>
src/main/resources/mapper/DictDetailMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.DictDetailMapper"
>
<select
id=
"findByDictName"
resultType=
"admin.modules.system.domain.DictDetail"
>
select * from sys_dict_detail a where b.name = #{name}
</select>
</mapper>
src/main/resources/mapper/DictMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.DictMapper"
>
<resultMap
id=
"Dict"
type=
"admin.modules.system.domain.Dict"
>
<id
property=
"id"
column=
"dept_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"description"
column=
"description"
/>
<collection
property=
"dictDetails"
ofType=
"admin.modules.system.domain.DictDetail"
>
<id
property=
"id"
column=
"detail_id"
/>
<result
property=
"dictId"
column=
"dict_id"
/>
<result
property=
"label"
column=
"label"
/>
<result
property=
"value"
column=
"value"
/>
<result
property=
"dictSort"
column=
"dict_sort"
/>
</collection>
</resultMap>
<delete
id=
"deleteByIdIn"
>
delete from sys_dict where dict_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</delete>
<select
id=
"findByIdIn"
resultMap=
"Dict"
>
select * from sys_dict a left join sys_dict_detail b on a.dict_id = b.dict_id where a.dict_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
src/main/resources/mapper/MenuMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.MenuMapper"
>
<resultMap
id=
"resultMap"
type=
"admin.modules.system.domain.Menu"
>
<id
property=
"id"
column=
"menu_id"
/>
<result
property=
"updatedBy"
column=
"update_by"
/>
</resultMap>
<update
id=
"addQuick"
>
update sys_menu set nav_quick=1 where menu_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
<update
id=
"updateSubCntById"
>
update sys_menu set sub_count = #{count} where menu_id = #{menuId}
</update>
<update
id=
"delQuick"
>
update sys_menu set nav_quick=0
</update>
<select
id=
"findByRoleIdsAndTypeNot"
resultMap=
"resultMap"
>
SELECT m.* FROM sys_menu m, sys_roles_menus r
WHERE m.menu_id = r.menu_id AND r.role_id IN
<foreach
collection=
"roleIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
AND type != #{type} order by m.menu_sort asc
</select>
<select
id=
"findByTitle"
resultMap=
"resultMap"
>
select * from sys_menu a where a.title = #{title}
</select>
<select
id=
"findByComponentName"
resultMap=
"resultMap"
>
select * from sys_menu a where a.name = #{name}
</select>
<select
id=
"findByPid"
resultMap=
"resultMap"
>
select * from sys_menu a where a.pid = #{pid}
</select>
<select
id=
"findByPidIsNull"
resultMap=
"resultMap"
>
select * from sys_menu where pid is null
</select>
<select
id=
"countByPid"
resultType=
"java.lang.Integer"
>
select count(1) from sys_menu where pid = #{id}
</select>
<select
id=
"findMenuByRoleId"
resultMap=
"resultMap"
>
SELECT b.* FROM sys_roles_menus a, sys_menu b WHERE a.menu_id = b.menu_id AND a.role_id = #{roleId}
</select>
</mapper>
src/main/resources/mapper/ParkingInInfoMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.parking.service.mapper.ParkingInInfoMapper"
>
<select
id=
"findByParkingInSerial"
resultType=
"admin.modules.parking.domain.ParkingInInfo"
>
select * from parking_in_info where parking_in_serial = #{parkingInSerial}
</select>
<select
id=
"findByParkingInNo"
resultType=
"admin.modules.parking.domain.ParkingInInfo"
>
select * from parking_in_info where parking_in_no = #{parkingInNo}
</select>
<select
id=
"findByParentChannel"
resultType=
"admin.modules.parking.domain.ParkingInInfo"
>
select * from parking_in_info where parent_park=#{parent} and channel_id=#{channelId} LIMIT 1
</select>
<select
id=
"parkingCount"
resultType=
"java.lang.Integer"
>
select count(0) from parking_in_info
</select>
<select
id=
"findById"
resultType=
"admin.modules.parking.domain.ParkingInInfo"
>
select * from parking_in_info where parking_in_id =#{parkingInId}
</select>
<select
id=
"findAll"
resultType=
"admin.modules.parking.domain.ParkingInInfo"
>
select * from parking_in_info
</select>
</mapper>
src/main/resources/mapper/ParkingInfoMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.parking.service.mapper.ParkingInfoMapper"
>
<select
id=
"findByJobId"
resultType=
"admin.modules.parking.domain.ParkingInfo"
>
SELECT * FROM `parking_info` WHERE `job_id` = #{jobId} order by parking_serial
</select>
<select
id=
"getRoadParkingCount"
resultType=
"java.util.Map"
>
SELECT count(0) as parkingNum, `road_id` as roadId
FROM `parking_info` WHERE `road_id` in
<foreach
collection=
"roadList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
GROUP BY `road_id`
</select>
<select
id=
"getOnlineParkingNum"
resultType=
"java.lang.Integer"
>
SELECT CASE WHEN ISNULL(count(0)) THEN 0 ELSE count(0) END as num from `parking_info` where 1=1
<if
test=
"status!=null"
>
and status = #{status}
</if>
</select>
<select
id=
"getParkingUseNum"
resultType=
"java.util.Map"
>
select `road_id`,`status`,
CASE WHEN ISNULL(count(0)) THEN 0 ELSE count(0) END as num
from `parking_info` GROUP BY `road_id` , `status`
</select>
<select
id=
"findByIdIn"
resultType=
"admin.modules.parking.domain.ParkingInfo"
>
SELECT * FROM `parking_info` WHERE `parking_id` in
<foreach
collection=
"idList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
order by parking_serial
</select>
<select
id=
"findByParkingSerial"
resultType=
"admin.modules.parking.domain.ParkingInfo"
>
select * from `parking_info` where parking_serial = #{parkingSerial}
</select>
<select
id=
"findByRoadId"
resultType=
"admin.modules.parking.domain.ParkingInfo"
>
select * from `parking_info` where road_id = #{roadId}
</select>
<update
id=
"modifyBatchJobMsg"
>
update parking_info set job_id=null,job_name = null where parking_id in
<foreach
collection=
"list"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
<select
id=
"findRemainCountByRoadId"
resultType=
"java.lang.Long"
>
select count(*) from `parking_info` where road_id = #{roadId} and status =2
</select>
</mapper>
src/main/resources/mapper/RoleMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.RoleMapper"
>
<resultMap
id=
"resultMap"
type=
"admin.modules.system.domain.Role"
>
<id
property=
"id"
column=
"role_id"
/>
<result
property=
"updatedBy"
column=
"update_by"
/>
<collection
property=
"menus"
column=
"role_id"
select=
"selectMenus"
>
</collection>
</resultMap>
<delete
id=
"deleteAllByIdIn"
>
delete from sys_role where role_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</delete>
<delete
id=
"untiedMenu"
>
delete from sys_roles_menus where menu_id = #{id}
</delete>
<!-- select a.menu_id as id,a.permission as permission,#{role_id} as path from sys_menu a ,sys_roles_menus b where b.role_id IN (1,5) and b.menu_id=a.menu_id;-->
<select
id=
"selectMenus"
resultType=
"admin.modules.system.domain.Menu"
>
select a.menu_id as id,a.permission as permission from sys_menu a ,sys_roles_menus b where b.role_id=#{role_id} and b.menu_id=a.menu_id;
</select>
<select
id=
"findByName"
resultMap=
"resultMap"
>
select * from sys_role where name = #{name}
</select>
<select
id=
"findByUserId"
resultMap=
"resultMap"
>
SELECT r.* FROM sys_role r, sys_users_roles u WHERE r.role_id = u.role_id AND u.user_id = #{id}
</select>
<select
id=
"countByDepts"
resultType=
"java.lang.Integer"
>
select count(1) from sys_role r, sys_roles_depts d where r.role_id = d.role_id and d.dept_id in
<foreach
collection=
"deptIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"findInMenuId"
resultMap=
"resultMap"
>
SELECT r.* FROM sys_role r, sys_roles_menus m WHERE r.role_id = m.role_id AND m.menu_id in
<foreach
collection=
"menuIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
src/main/resources/mapper/UserMapper.xml
0 → 100644
View file @
ab0c0b6c
<?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=
"admin.modules.system.service.mapper.UserMapper"
>
<update
id=
"updatePass"
>
update sys_user set password = #{pass} , pwd_reset_time = #{lastPasswordResetTime} where username = #{username}
</update>
<update
id=
"updateEmail"
>
update sys_user set email = #{email} where username = #{username}
</update>
<update
id=
"updateUserAmount"
>
update sys_user set amount = #{amount} where user_id = #{userId}
</update>
<delete
id=
"deleteAllByIdIn"
>
delete from sys_user where user_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</delete>
<resultMap
id=
"User"
type=
"admin.modules.system.domain.User"
>
<id
property=
"id"
column=
"user_id"
/>
<result
property=
"deptId"
column=
"dept_id"
/>
<association
property=
"dept"
column=
"dept_id"
select=
"selectDept"
/>
<collection
property=
"roles"
column=
"user_id"
select=
"selectRole"
>
</collection>
<collection
property=
"jobs"
column=
"user_id"
select=
"selectJob"
>
</collection>
</resultMap>
<select
id=
"findByUsername"
resultMap=
"User"
>
select * from sys_user where username = #{username}
</select>
<select
id=
"selectDept"
resultType=
"admin.modules.system.domain.Dept"
>
select a.dept_id as id,a.* from sys_dept a where a.dept_id = #{dept_id}
</select>
<select
id=
"selectRole"
resultType=
"admin.modules.system.domain.Role"
>
select a.role_id as id,a.* from sys_role a left join sys_users_roles b on a.role_id = b.role_id where b.user_id = #{user_id}
</select>
<select
id=
"selectJob"
resultType=
"admin.modules.system.domain.Job"
>
select a.job_id as id,a.* from sys_job a left join sys_users_jobs b on a.job_id = b.job_id where b.user_id = #{user_id}
</select>
<select
id=
"findByEmail"
resultMap=
"User"
>
select user_id as id,u.* from sys_user u where u.email = #{email}
</select>
<select
id=
"findByPhone"
resultMap=
"User"
>
select user_id as id,u.* from sys_user u where u.phone = #{phone}
</select>
<select
id=
"findByJobId"
resultType=
"admin.modules.system.domain.User"
>
select user_id as id,u.* from sys_user u where u.job_id = #{jobId} and u.is_business=1 order by u.update_time desc limit 1
</select>
<select
id=
"findListByJobId"
resultType=
"admin.modules.system.domain.User"
>
select user_id as id,u.* from sys_user u where u.job_id = #{jobId} and u.is_business=1 order by u.update_time desc
</select>
<select
id=
"findUserByIdNoAuth"
resultType=
"admin.modules.system.domain.User"
>
select user_id as id,u.* from sys_user u where u.user_id = #{userId} order by u.update_time desc limit 1
</select>
<select
id=
"findByRoleId"
resultType=
"admin.modules.system.domain.User"
>
SELECT u.user_id as id, u.* FROM sys_user u, sys_users_roles r WHERE u.user_id = r.user_id AND r.role_id = #{roleId}
</select>
<select
id=
"findByDeptRoleId"
resultType=
"admin.modules.system.domain.User"
>
SELECT u.user_id as id, u.* FROM sys_user u, sys_users_roles r, sys_roles_depts d
WHERE u.user_id = r.user_id AND r.role_id = d.role_id AND r.role_id = #{id} group by u.user_id
</select>
<select
id=
"findByMenuId"
resultType=
"admin.modules.system.domain.User"
>
SELECT u.user_id as id, u.* FROM sys_user u, sys_users_roles ur, sys_roles_menus rm
WHERE u.user_id = ur.user_id AND ur.role_id = rm.role_id AND rm.menu_id = #{id} group by u.user_id
</select>
<select
id=
"countByJobs"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM sys_user u, sys_users_jobs j WHERE u.user_id = j.user_id AND j.job_id IN
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"countByDepts"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM sys_user u WHERE u.dept_id IN
<foreach
collection=
"deptIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"countByRoles"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM sys_user u, sys_users_roles r WHERE u.user_id = r.user_id AND r.role_id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"allUsers"
resultType=
"admin.modules.system.domain.User"
>
SELECT user_id as id,* FROM sys_user where enabled=1
</select>
<select
id=
"allUserData"
resultType=
"java.util.Map"
>
SELECT user_id as userId,username as userName,is_business as isBusiness,phone
FROM sys_user where enabled=1
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment