first commit
This commit is contained in:
18
wms-module-system/src/main/resources/mapper/BranchMapper.xml
Normal file
18
wms-module-system/src/main/resources/mapper/BranchMapper.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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="top.ysoft.admin.peopleBranch.mapper.BranchMapper">
|
||||
|
||||
|
||||
<select id="queryJuniorBranch" resultType="top.ysoft.admin.peopleBranch.model.resp.BranchResp">
|
||||
WITH RECURSIVE subdepartments AS (
|
||||
SELECT id, name, parent_id
|
||||
FROM sys_branch
|
||||
WHERE parent_id = #{branchId}
|
||||
UNION ALL
|
||||
SELECT d.id, d.name, d.parent_id
|
||||
FROM sys_branch d
|
||||
JOIN subdepartments sd ON d.parent_id = sd.id
|
||||
)
|
||||
SELECT * FROM subdepartments;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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="top.ysoft.admin.peopleBranch.mapper.BranchRuleMapper">
|
||||
|
||||
<select id="selectRuleNames" resultType="top.ysoft.admin.peopleBranch.model.resp.BranchRuleResp">
|
||||
SELECT
|
||||
br.branch_id branchId,
|
||||
br.rule_id ruleId,
|
||||
r.name AS ruleName
|
||||
FROM
|
||||
sys_branch_rule br
|
||||
JOIN
|
||||
sys_rule r ON br.rule_id = r.id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.system.mapper.DeptMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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="top.ysoft.admin.system.mapper.DictItemMapper">
|
||||
<select id="listByDictCode" resultType="top.continew.starter.extension.crud.model.resp.LabelValueResp">
|
||||
SELECT t1.label, t1.value, t1.color AS extra
|
||||
FROM sys_dict_item AS t1
|
||||
LEFT JOIN sys_dict AS t2 ON t1.dict_id = t2.id
|
||||
WHERE t1.status = 1 AND t2.code = #{dictCode}
|
||||
ORDER BY t1.sort
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.DownRecordMapper">
|
||||
|
||||
<select id="selectRecordsPage" resultType="top.ysoft.admin.consume.model.resp.DownRecordResp">
|
||||
SELECT
|
||||
r.*,
|
||||
p.`name` peopleName,
|
||||
p.`gh` gh,
|
||||
e.`name` equipmentName
|
||||
FROM `consume_down_record` r
|
||||
LEFT JOIN sys_people p ON p.id = r.people_id
|
||||
LEFT JOIN sys_equipment e ON e.id = r.equipment_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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="top.ysoft.admin.rule.mapper.EmpowerRecordMapper">
|
||||
|
||||
<select id="selectEmpowerRecordPage" resultType="top.ysoft.admin.rule.model.resp.EmpowerRecordResp">
|
||||
select ser.id, ser.name, ser.people_id, ser.info_down, ser.empower, ser.equipment_id, ser.status, ser.remark, ser.create_user,
|
||||
ser.create_time, ser.update_user, ser.update_time, ser.rule_id, p.name peopleName,p.avatar peopleAvatar,e.name equipmentName,
|
||||
e.entry_exit_type entryExitType
|
||||
from sys_empower_record ser
|
||||
left join sys_people p on ser.people_id = p.id
|
||||
left join sys_equipment e on ser.equipment_id = e.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectForEmpowerDel" resultType="top.ysoft.admin.rule.model.resp.EmpowerRecordDetailResp">
|
||||
SELECT
|
||||
er.people_id,
|
||||
er.equipment_id,
|
||||
e.product_id,
|
||||
e.ip,
|
||||
e.`password`,
|
||||
pe.guid,
|
||||
p.door_no
|
||||
FROM
|
||||
sys_empower_record er
|
||||
LEFT JOIN sys_equipment e ON er.equipment_id = e.id
|
||||
LEFT JOIN sys_people_equipment pe ON er.people_id = pe.people_id
|
||||
AND er.equipment_id = pe.equipment_id
|
||||
LEFT JOIN sys_people p ON er.people_id = p.id
|
||||
WHERE
|
||||
er.id IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY er.people_id,er.equipment_id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.GroupMapper">
|
||||
</mapper>
|
||||
155
wms-module-system/src/main/resources/mapper/LogMapper.xml
Normal file
155
wms-module-system/src/main/resources/mapper/LogMapper.xml
Normal file
@@ -0,0 +1,155 @@
|
||||
<?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="top.ysoft.admin.system.mapper.LogMapper">
|
||||
<select id="selectLogPage" resultType="top.ysoft.admin.system.model.resp.log.LogResp">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.description,
|
||||
t1.module,
|
||||
t1.time_taken,
|
||||
t1.ip,
|
||||
t1.address,
|
||||
t1.browser,
|
||||
t1.os,
|
||||
t1.status,
|
||||
t1.error_msg,
|
||||
t1.create_user,
|
||||
t1.create_time,
|
||||
t2.nickname AS createUserString
|
||||
FROM sys_log AS t1
|
||||
LEFT JOIN sys_user AS t2 ON t2.id = t1.create_user
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectLogList" resultType="top.ysoft.admin.system.model.resp.log.LogResp">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.description,
|
||||
t1.module,
|
||||
t1.time_taken,
|
||||
t1.ip,
|
||||
t1.address,
|
||||
t1.browser,
|
||||
t1.os,
|
||||
t1.status,
|
||||
t1.error_msg,
|
||||
t1.create_user,
|
||||
t1.create_time,
|
||||
t2.nickname AS createUserString
|
||||
FROM sys_log AS t1
|
||||
LEFT JOIN sys_user AS t2 ON t2.id = t1.create_user
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectDashboardOverviewPv" resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardOverviewCommonResp">
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM sys_log) AS total,
|
||||
(SELECT COUNT(*) FROM sys_log WHERE create_time >= CURDATE() AND create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)) AS today,
|
||||
(SELECT COUNT(*) FROM sys_log WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND create_time < CURDATE()) AS yesterday
|
||||
</select>
|
||||
|
||||
<select id="selectDashboardOverviewIp" resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardOverviewCommonResp">
|
||||
SELECT
|
||||
(SELECT COUNT(DISTINCT ip) FROM sys_log) AS total,
|
||||
(SELECT COUNT(DISTINCT ip) FROM sys_log WHERE create_time >= CURDATE() AND create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)) AS today,
|
||||
(SELECT COUNT(DISTINCT ip) FROM sys_log WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND create_time < CURDATE()) AS yesterday
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisPv"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
DATE_FORMAT(create_time, '%Y-%m') AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
WHERE DATE_FORMAT(create_time, '%Y-%m' ) IN
|
||||
<foreach collection="months" item="month" separator="," open="(" close=")">
|
||||
#{month}
|
||||
</foreach>
|
||||
GROUP BY name
|
||||
ORDER BY name
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisIp"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
DATE_FORMAT(create_time, '%Y-%m') AS name,
|
||||
COUNT(DISTINCT ip) AS value
|
||||
FROM sys_log
|
||||
WHERE DATE_FORMAT(create_time, '%Y-%m' ) IN
|
||||
<foreach collection="months" item="month" separator="," open="(" close=")">
|
||||
#{month}
|
||||
</foreach>
|
||||
GROUP BY name
|
||||
ORDER BY name
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisGeo" resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
CASE
|
||||
WHEN POSITION(' ' IN address) > 0 THEN SUBSTRING(address FROM 1 FOR POSITION(' ' IN address) - 1)
|
||||
ELSE address
|
||||
END AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
WHERE address LIKE '中国%'
|
||||
GROUP BY name
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAccessTrend"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardAccessTrendResp">
|
||||
SELECT
|
||||
DATE(create_time) AS date,
|
||||
COUNT(*) AS pvCount,
|
||||
COUNT(DISTINCT ip) AS ipCount
|
||||
FROM sys_log
|
||||
WHERE create_time BETWEEN #{startTime} AND #{endTime}
|
||||
GROUP BY date
|
||||
ORDER BY date
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisTimeslot"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
LPAD(CONCAT(FLOOR(HOUR(create_time) / 2) * 2, ':00'), 5, '0') AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
GROUP BY name
|
||||
ORDER BY name
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisModule"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
module AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
WHERE module != '验证码' AND module != '登录'
|
||||
GROUP BY name
|
||||
ORDER BY value DESC
|
||||
LIMIT #{top}
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisOs"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
os AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
WHERE os IS NOT NULL
|
||||
GROUP BY name
|
||||
ORDER BY value DESC
|
||||
LIMIT #{top}
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAnalysisBrowser"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardChartCommonResp">
|
||||
SELECT
|
||||
SUBSTRING_INDEX(browser, ' ', 1) AS name,
|
||||
COUNT(*) AS value
|
||||
FROM sys_log
|
||||
WHERE browser IS NOT NULL
|
||||
GROUP BY name
|
||||
ORDER BY value DESC
|
||||
LIMIT #{top}
|
||||
</select>
|
||||
</mapper>
|
||||
24
wms-module-system/src/main/resources/mapper/MenuMapper.xml
Normal file
24
wms-module-system/src/main/resources/mapper/MenuMapper.xml
Normal 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="top.ysoft.admin.system.mapper.MenuMapper">
|
||||
<select id="selectPermissionByUserId" resultType="java.lang.String">
|
||||
SELECT DISTINCT t1.permission
|
||||
FROM sys_menu AS t1
|
||||
LEFT JOIN sys_role_menu AS t2 ON t2.menu_id = t1.id
|
||||
LEFT JOIN sys_role AS t3 ON t3.id = t2.role_id
|
||||
LEFT JOIN sys_user_role AS t4 ON t4.role_id = t3.id
|
||||
LEFT JOIN sys_user AS t5 ON t5.id = t4.user_id
|
||||
WHERE t5.id = #{userId}
|
||||
AND t1.status = 1
|
||||
AND t1.permission IS NOT NULL
|
||||
</select>
|
||||
|
||||
<select id="selectListByRoleId" resultType="top.ysoft.admin.system.model.entity.MenuDO">
|
||||
SELECT t1.*
|
||||
FROM sys_menu AS t1
|
||||
LEFT JOIN sys_role_menu AS t2 ON t2.menu_id = t1.id
|
||||
LEFT JOIN sys_role AS t3 ON t3.id = t2.role_id
|
||||
WHERE t3.id = #{roleId}
|
||||
AND t1.status = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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="top.ysoft.admin.system.mapper.MessageMapper">
|
||||
<select id="selectPageByUserId" resultType="top.ysoft.admin.system.model.resp.message.MessageResp">
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.user_id,
|
||||
t2.is_read,
|
||||
t2.read_time
|
||||
FROM sys_message AS t1
|
||||
LEFT JOIN sys_message_user AS t2 ON t2.message_id = t1.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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="top.ysoft.admin.system.mapper.MessageUserMapper">
|
||||
<select id="selectUnreadCountByUserIdAndType" resultType="Long">
|
||||
SELECT
|
||||
COUNT(t1.message_id)
|
||||
FROM sys_message_user AS t1
|
||||
LEFT JOIN sys_message AS t2 ON t2.id = t1.message_id
|
||||
WHERE t1.user_id = #{userId} AND t1.is_read = false
|
||||
<if test="type != null">
|
||||
AND t2.type = #{type}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
18
wms-module-system/src/main/resources/mapper/NoticeMapper.xml
Normal file
18
wms-module-system/src/main/resources/mapper/NoticeMapper.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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="top.ysoft.admin.system.mapper.NoticeMapper">
|
||||
|
||||
<select id="selectDashboardList"
|
||||
resultType="top.ysoft.admin.system.model.resp.dashboard.DashboardNoticeResp">
|
||||
SELECT
|
||||
id, title, type
|
||||
FROM sys_notice
|
||||
WHERE (effective_time IS NULL OR NOW() > effective_time)
|
||||
AND (terminate_time IS NULL OR terminate_time > NOW())
|
||||
<if test="userId != null">
|
||||
AND (notice_scope = 1 OR (notice_scope = 2 AND JSON_EXTRACT(notice_users, "$[0]") = CAST(#{userId} AS CHAR)))
|
||||
</if>
|
||||
ORDER BY sort ASC, effective_time DESC
|
||||
LIMIT 5
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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="top.ysoft.admin.peopleDownRecord.mapper.PeopleDownMapper">
|
||||
|
||||
<insert id="upsert" parameterType="top.ysoft.admin.peopleDownRecord.model.req.PeopleDownReq">
|
||||
INSERT INTO equipment_down_record (
|
||||
people_id,
|
||||
equipment_id,
|
||||
rule_id,
|
||||
down_time,
|
||||
down_result,
|
||||
create_user,
|
||||
create_time,
|
||||
msg,
|
||||
oper_type
|
||||
) VALUES (
|
||||
#{peopleId},
|
||||
#{equipmentId},
|
||||
#{ruleId},
|
||||
#{downTime},
|
||||
#{downResult},
|
||||
#{createUser},
|
||||
#{createTime},
|
||||
#{msg},
|
||||
#{operType}
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
down_time = values(down_time),
|
||||
down_result = values(down_result),
|
||||
create_user = values(create_user),
|
||||
create_time = NOW(),
|
||||
msg = values(msg),
|
||||
oper_type = values(oper_type)
|
||||
</insert>
|
||||
|
||||
<select id="selectListExport" resultType="top.ysoft.admin.peopleDownRecord.model.resp.PeopleDownResp">
|
||||
SELECT
|
||||
sp.name peopleName,
|
||||
se.name equipmentName,
|
||||
sr.name ruleName,
|
||||
pd.down_time,
|
||||
pd.down_result,
|
||||
sp.gh
|
||||
FROM
|
||||
equipment_down_record pd
|
||||
left join sys_people sp on pd.people_id = sp.id
|
||||
left join sys_equipment se on pd.equipment_id = se.id
|
||||
left join sys_rule sr on pd.rule_id = sr.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectDownPage" resultType="top.ysoft.admin.peopleDownRecord.model.resp.PeopleDownResp">
|
||||
SELECT
|
||||
pd.*,
|
||||
sp.name peopleName,
|
||||
se.name equipmentName,
|
||||
sr.name ruleName,
|
||||
sp.gh
|
||||
FROM
|
||||
equipment_down_record pd
|
||||
left join sys_people sp on pd.people_id = sp.id
|
||||
left join sys_equipment se on pd.equipment_id = se.id
|
||||
left join sys_rule sr on pd.rule_id = sr.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.system.mapper.PeopleEquipmentMapper">
|
||||
</mapper>
|
||||
54
wms-module-system/src/main/resources/mapper/PeopleMapper.xml
Normal file
54
wms-module-system/src/main/resources/mapper/PeopleMapper.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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="top.ysoft.admin.peopleBranch.mapper.PeopleMapper">
|
||||
|
||||
<select id="selectExportConsume" resultType="top.ysoft.admin.peopleBranch.model.resp.ConsumePeopleResp">
|
||||
select
|
||||
p.`name`,
|
||||
p.sex,
|
||||
p.gh,
|
||||
b.`name` as branch_name,
|
||||
p.is_consume,
|
||||
p.freeze,
|
||||
p.czje,
|
||||
p.btje
|
||||
from sys_people p
|
||||
left join sys_branch b on p.branch_id = b.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectPageConsume" resultType="top.ysoft.admin.peopleBranch.model.resp.ConsumePeopleResp">
|
||||
select
|
||||
p.*,
|
||||
b.name as branch_name
|
||||
from sys_people p
|
||||
left join sys_branch b on p.branch_id = b.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectPeoplePage" resultType="top.ysoft.admin.peopleBranch.model.resp.PeopleResp">
|
||||
select
|
||||
p.*,
|
||||
b.name as branch_name
|
||||
from sys_people p
|
||||
left join sys_branch b on p.branch_id = b.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectExportPeople" resultType="top.ysoft.admin.peopleBranch.model.resp.PeopleResp">
|
||||
select
|
||||
p.`name`,
|
||||
p.phone,
|
||||
p.gh,
|
||||
p.sex,
|
||||
p.position,
|
||||
p.idcard,
|
||||
p.door_no,
|
||||
p.join_time,
|
||||
b.`name` as branch_name
|
||||
from sys_people p
|
||||
left join sys_branch b on p.branch_id = b.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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="top.ysoft.admin.rule.mapper.PeopleRecordMapper">
|
||||
|
||||
<select id="selectPeopleRecordPage" resultType="top.ysoft.admin.rule.model.resp.PeopleRecordResp">
|
||||
select spr.id, spr.people_id, spr.equipment_id, spr.device_ip, spr.admit_guid, spr.rec_mode, spr.file_path, spr.show_time, spr.show_date, spr.alive_type,
|
||||
spr.rec_score, spr.device_no, spr.device_version, spr.source, spr.type, spr.card_no, spr.device_name, spr.rec_type, spr.result, spr.permission_time_type,
|
||||
spr.pass_time_type, spr.rec_mode_type, spr.storage_id, spr.timestamp, spr.admit_name, spr.remark, spr.create_user, spr.create_time, spr.update_user, spr.update_time,
|
||||
e.name equipmentName,spr.flag,spr.group_id,p.name peopleName,p.gh,spr.sign,sb.`name` branchName
|
||||
from sys_people_record spr
|
||||
left join sys_equipment e on spr.device_no = e.sequence
|
||||
left join sys_people p on spr.people_id=p.id
|
||||
left join sys_branch sb ON p.branch_id = sb.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
26
wms-module-system/src/main/resources/mapper/PointMapper.xml
Normal file
26
wms-module-system/src/main/resources/mapper/PointMapper.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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="top.ysoft.admin.space.mapper.PointMapper">
|
||||
|
||||
<sql id="selectUser">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.name,
|
||||
t1.space_id,
|
||||
t1.remark,
|
||||
t1.create_user,
|
||||
t1.create_time,
|
||||
t1.update_user,
|
||||
t1.update_time,
|
||||
t1.sort,
|
||||
t2.name as spaceName
|
||||
FROM sys_point t1
|
||||
LEFT JOIN sys_space AS t2 ON t2.id = t1.space_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPointPage" resultType="top.ysoft.admin.space.model.resp.PointResp">
|
||||
<include refid="selectUser" />
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.equipment.mapper.ProductMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.RechargeRecordMapper">
|
||||
|
||||
<select id="selectRechargePage" resultType="top.ysoft.admin.consume.model.resp.RechargeRecordResp">
|
||||
SELECT
|
||||
r.id,
|
||||
r.account_id,
|
||||
r.consume_money,
|
||||
r.discount_money,
|
||||
r.start_time,
|
||||
r.end_time,
|
||||
r.order_type,
|
||||
r.out_trade_id,
|
||||
r.pay_mode,
|
||||
r.result_code,
|
||||
r.create_user,
|
||||
r.create_time,
|
||||
r.update_user,
|
||||
r.update_time,
|
||||
r.recharge_mode,
|
||||
r.recharge_way,
|
||||
r.recharge_type,
|
||||
r.clear_btje,
|
||||
r.clear_czje,
|
||||
ifnull(r.emp_id, p.gh) empId,
|
||||
p.`name` accountName
|
||||
FROM `consume_recharge_record` r
|
||||
LEFT JOIN sys_people p ON p.id = r.account_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectExport" resultType="top.ysoft.admin.consume.model.resp.RechargeRecordResp">
|
||||
SELECT
|
||||
r.consume_money consumeMoney,
|
||||
ifnull(r.emp_id, p.gh) empId,
|
||||
r.recharge_mode,
|
||||
r.recharge_way,
|
||||
r.recharge_type,
|
||||
r.clear_btje,
|
||||
r.clear_czje,
|
||||
r.create_time,
|
||||
p.`name` accountName
|
||||
FROM `consume_recharge_record` r
|
||||
LEFT JOIN sys_people p ON p.id = r.account_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
31
wms-module-system/src/main/resources/mapper/RecordMapper.xml
Normal file
31
wms-module-system/src/main/resources/mapper/RecordMapper.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.RecordMapper">
|
||||
|
||||
<select id="selectRecordsPage" resultType="top.ysoft.admin.consume.model.resp.RecordResp">
|
||||
SELECT
|
||||
r.*,
|
||||
p.`name` accountName,
|
||||
p.czje,
|
||||
p.btje,
|
||||
e.`name` equipmentName
|
||||
FROM `consume_record` r
|
||||
LEFT JOIN sys_people p ON p.id = r.account_id
|
||||
LEFT JOIN sys_equipment e ON e.id = r.dev_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectRecordsExport" resultType="top.ysoft.admin.consume.model.resp.RecordResp">
|
||||
SELECT
|
||||
r.*,
|
||||
p.`name` accountName,
|
||||
p.czje,
|
||||
p.btje,
|
||||
e.`name` equipmentName
|
||||
FROM `consume_record` r
|
||||
LEFT JOIN sys_people p ON p.id = r.account_id
|
||||
LEFT JOIN sys_equipment e ON e.id = r.dev_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
205
wms-module-system/src/main/resources/mapper/ReportMapper.xml
Normal file
205
wms-module-system/src/main/resources/mapper/ReportMapper.xml
Normal file
@@ -0,0 +1,205 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.ReportMapper">
|
||||
|
||||
|
||||
<select id="queryMerchantReport" resultType="top.ysoft.admin.consume.model.resp.report.MerchantReport">
|
||||
SELECT
|
||||
ct.`name` AS merchant,
|
||||
e.`name` AS equipmentName,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode IN (3, 4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode IN (3, 4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(cr.id) AS totalCount
|
||||
FROM
|
||||
consume_tenant ct
|
||||
LEFT JOIN sys_equipment e ON e.tenant_id = ct.id
|
||||
LEFT JOIN consume_record cr ON cr.dev_id = e.id
|
||||
AND cr.consume_result = 0
|
||||
<where>
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY cr.dev_id
|
||||
</select>
|
||||
|
||||
<select id="totalReport" resultType="top.ysoft.admin.consume.model.resp.report.BaseReport">
|
||||
SELECT
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(*) AS totalCount
|
||||
FROM
|
||||
consume_record cr
|
||||
<where>
|
||||
cr.consume_result = 0
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
and cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryMealReport" resultType="top.ysoft.admin.consume.model.resp.report.MealReport">
|
||||
SELECT
|
||||
ct.`name` AS merchant,
|
||||
e.`name` AS equipmentName,
|
||||
cti.tmrtype tmrtype,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(cr.id) AS totalCount
|
||||
FROM
|
||||
consume_time_interval cti
|
||||
LEFT JOIN consume_record cr ON cr.time_id = cti.id and cr.consume_result = 0
|
||||
LEFT JOIN sys_equipment e ON cr.dev_id = e.id
|
||||
LEFT JOIN consume_tenant ct ON ct.id = e.tenant_id
|
||||
<where>
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
<if test="tmrtype != null ">
|
||||
and cti.tmrtype = #{tmrtype}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY cr.dev_id,cti.tmrtype
|
||||
</select>
|
||||
|
||||
<select id="queryBranchReport" resultType="top.ysoft.admin.consume.model.resp.report.BranchReport">
|
||||
SELECT
|
||||
b.`name` AS branchName,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(cr.id) AS totalCount
|
||||
FROM
|
||||
sys_branch b
|
||||
LEFT JOIN sys_people p ON p.branch_id = b.id
|
||||
LEFT JOIN consume_record cr ON cr.account_id = p.id and cr.consume_result = 0
|
||||
<where>
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
<if test="branchId != null and branchId != ''">
|
||||
and b.id = #{branchId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY b.id
|
||||
</select>
|
||||
|
||||
<select id="queryPeopleReport" resultType="top.ysoft.admin.consume.model.resp.report.PeopleReport">
|
||||
SELECT
|
||||
p.`name` AS peopleName,
|
||||
b.`name` AS branchName,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(cr.id) AS totalCount
|
||||
FROM
|
||||
sys_people p
|
||||
LEFT JOIN consume_record cr ON cr.account_id = p.id and cr.consume_result = 0
|
||||
LEFT JOIN sys_branch b ON p.branch_id = b.id
|
||||
<where>
|
||||
<if test="query.createTime != null and query.createTime.size() > 0">
|
||||
cr.create_time between #{query.createTime[0]} and #{query.createTime[1]}
|
||||
</if>
|
||||
<if test="query.branchId != null and query.branchId != ''">
|
||||
and p.branch_id = #{query.branchId}
|
||||
</if>
|
||||
<if test="query.peopleName != null and query.peopleName != ''">
|
||||
and p.`name` like concat('%',#{query.peopleName},'%')
|
||||
</if>
|
||||
<if test="query.gh != null and query.gh != ''">
|
||||
and p.gh = #{query.gh}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY p.id
|
||||
LIMIT #{size} OFFSET #{offset}
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="java.lang.Long">
|
||||
SELECT count(DISTINCT p.id) FROM
|
||||
sys_people p
|
||||
LEFT JOIN consume_record cr ON cr.account_id = p.id and cr.consume_result = 0
|
||||
<where>
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
<if test="branchId != null and branchId != ''">
|
||||
and p.branch_id = #{branchId}
|
||||
</if>
|
||||
<if test="peopleName != null and peopleName != ''">
|
||||
and p.`name` like concat('%',#{peopleName},'%')
|
||||
</if>
|
||||
<if test="gh != null and gh != ''">
|
||||
and p.gh = #{gh}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryPeopleExport" resultType="top.ysoft.admin.consume.model.resp.report.PeopleReport">
|
||||
SELECT
|
||||
p.`name` AS peopleName,
|
||||
b.`name` AS branchName,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN cr.consume_money ELSE 0 END) AS unitPriceAmount,
|
||||
sum(CASE WHEN cr.consume_type = 0 THEN 1 ELSE 0 END) AS unitPriceCount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN cr.consume_money ELSE 0 END) AS fixedValueAmount,
|
||||
sum(CASE WHEN cr.consume_type = 1 THEN 1 ELSE 0 END) AS fixedValueCount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN cr.consume_money ELSE 0 END) AS countingAmount,
|
||||
sum(CASE WHEN cr.consume_type = 3 THEN 1 ELSE 0 END) AS countingCount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN cr.consume_money ELSE 0 END) AS qrcodeAmount,
|
||||
sum(CASE WHEN cr.pay_mode in (3,4) THEN 1 ELSE 0 END) AS qrcodeCount,
|
||||
sum(cr.consume_money) AS totalAmount,
|
||||
count(cr.id) AS totalCount
|
||||
FROM
|
||||
sys_people p
|
||||
LEFT JOIN consume_record cr ON cr.account_id = p.id and cr.consume_result = 0
|
||||
LEFT JOIN sys_branch b ON p.branch_id = b.id
|
||||
<where>
|
||||
<if test="createTime != null and createTime.size() > 0">
|
||||
cr.create_time between #{createTime[0]} and #{createTime[1]}
|
||||
</if>
|
||||
<if test="branchId != null and branchId != ''">
|
||||
and p.branch_id = #{branchId}
|
||||
</if>
|
||||
<if test="peopleName != null and peopleName != ''">
|
||||
and p.`name` like concat('%',#{peopleName},'%')
|
||||
</if>
|
||||
<if test="gh != null and gh != ''">
|
||||
and p.gh = #{gh}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY p.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.system.mapper.RoleMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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="top.ysoft.admin.system.mapper.RoleMenuMapper">
|
||||
<select id="selectMenuIdByRoleIds" resultType="java.lang.Long">
|
||||
SELECT menu_id
|
||||
FROM sys_role_menu
|
||||
WHERE role_id IN
|
||||
<foreach collection="list" item="roleId" open="(" close=")" separator=",">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
66
wms-module-system/src/main/resources/mapper/RuleMapper.xml
Normal file
66
wms-module-system/src/main/resources/mapper/RuleMapper.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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="top.ysoft.admin.rule.mapper.RuleMapper">
|
||||
|
||||
|
||||
<resultMap type="RuleDO" id="SysRuleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="admittanceStart" column="admittance_start" />
|
||||
<result property="admittanceEnd" column="admittance_end" />
|
||||
<result property="spaceId" column="space_id" />
|
||||
<result property="spaceName" column="space_name" />
|
||||
<result property="pointId" column="point_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="type" column="type" />
|
||||
<result property="permission" column="permission" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysRuleVo">
|
||||
select sr.id, sr.name, sr.start_time, sr.end_time, sr.admittance_start, sr.admittance_end, sr.space_id, sr.point_id,
|
||||
sr.remark, sr.create_user, sr.create_time, sr.update_user, sr.update_time, sr.type, sr.permission
|
||||
from sys_rule sr
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="querySysRuleList" resultType="top.ysoft.admin.rule.model.entity.RuleDO">
|
||||
<include refid="selectSysRuleVo"/>
|
||||
where sr.id in
|
||||
<foreach collection="ruleIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getEquipmentRulesByPeoples" resultType="top.ysoft.admin.rule.model.resp.YFPeopleResp">
|
||||
SELECT
|
||||
er.rule_id ruleId,
|
||||
er.equipment_id equipmentId,
|
||||
er.equipment_rule_id equipmentRuleId,
|
||||
p.id peopleId,
|
||||
p.name peopleName,
|
||||
p.idcard idcard,
|
||||
p.phone phone,
|
||||
p.guid guid,
|
||||
p.face_guid faceGuid,
|
||||
p.avatar avatar,
|
||||
e.ip,
|
||||
e.password,
|
||||
e.flag
|
||||
FROM
|
||||
equipment_rule_relation er
|
||||
LEFT JOIN sys_equipment e ON er.equipment_id = e.id
|
||||
LEFT JOIN sys_branch_rule br ON er.rule_id = br.rule_id
|
||||
LEFT JOIN sys_people p ON p.branch_id = br.branch_id
|
||||
where p.id in
|
||||
<foreach collection="peopleIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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="top.ysoft.admin.system.mapper.RuleRelationMapper">
|
||||
|
||||
|
||||
<delete id="deleteByRuleId" parameterType="top.ysoft.admin.system.model.entity.RuleRelationDO">
|
||||
DELETE FROM equipment_rule_relation
|
||||
WHERE 1=1
|
||||
<!-- 判空规则:字段不为 null 且 不为空字符串(兼容字符串/数字类型) -->
|
||||
<if test="ruleId != null and ruleId != ''">
|
||||
AND rule_id = #{ruleId}
|
||||
</if>
|
||||
<if test="equipmentId != null and equipmentId != ''">
|
||||
AND equipment_id = #{equipmentId}
|
||||
</if>
|
||||
<if test="equipmentRuleId != null and equipmentRuleId != ''">
|
||||
AND equipment_rule_id = #{equipmentRuleId}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
18
wms-module-system/src/main/resources/mapper/SpaceMapper.xml
Normal file
18
wms-module-system/src/main/resources/mapper/SpaceMapper.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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="top.ysoft.admin.space.mapper.SpaceMapper">
|
||||
|
||||
|
||||
<select id="queryJuniorSpace" resultType="top.ysoft.admin.space.model.resp.SpaceResp">
|
||||
WITH RECURSIVE subdepartments AS (
|
||||
SELECT id, name, parent_id
|
||||
FROM sys_space
|
||||
WHERE parent_id = #{id}
|
||||
UNION ALL
|
||||
SELECT d.id, d.name, d.parent_id
|
||||
FROM sys_space d
|
||||
JOIN subdepartments sd ON d.parent_id = sd.id
|
||||
)
|
||||
SELECT * FROM subdepartments;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.consume.mapper.TenantMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="top.ysoft.admin.consume_.mapper.TimeIntervalMapper">
|
||||
</mapper>
|
||||
56
wms-module-system/src/main/resources/mapper/UserMapper.xml
Normal file
56
wms-module-system/src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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="top.ysoft.admin.system.mapper.UserMapper">
|
||||
|
||||
<sql id="selectUser">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.create_user,
|
||||
t1.create_time,
|
||||
t1.update_user,
|
||||
t1.update_time,
|
||||
t1.username,
|
||||
t1.nickname,
|
||||
t1.password,
|
||||
t1.gender,
|
||||
t1.email,
|
||||
t1.phone,
|
||||
t1.avatar,
|
||||
t1.description,
|
||||
t1.status,
|
||||
t1.is_system,
|
||||
t1.pwd_reset_time,
|
||||
t1.dept_id,
|
||||
t2.name AS deptName
|
||||
FROM sys_user AS t1
|
||||
LEFT JOIN sys_dept AS t2 ON t2.id = t1.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserPage" resultType="top.ysoft.admin.system.model.resp.user.UserDetailResp">
|
||||
<include refid="selectUser" />
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectUserList" resultType="top.ysoft.admin.system.model.resp.user.UserDetailResp">
|
||||
<include refid="selectUser" />
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByEmail" resultType="java.lang.Long">
|
||||
SELECT count(*)
|
||||
FROM sys_user
|
||||
WHERE email = #{email}
|
||||
<if test="id != null">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectCountByPhone" resultType="java.lang.Long">
|
||||
SELECT count(*)
|
||||
FROM sys_user
|
||||
WHERE phone = #{phone}
|
||||
<if test="id != null">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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="top.ysoft.admin.system.mapper.UserPasswordHistoryMapper">
|
||||
<delete id="deleteExpired">
|
||||
DELETE t1 FROM sys_user_password_history AS t1
|
||||
LEFT JOIN (
|
||||
SELECT id
|
||||
FROM sys_user_password_history
|
||||
WHERE user_id = #{userId}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{count}
|
||||
) AS t2 ON t2.id = t1.id
|
||||
WHERE t2.id IS NULL
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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="top.ysoft.admin.system.mapper.UserRoleMapper">
|
||||
|
||||
<select id="selectUserPage" resultType="top.ysoft.admin.system.model.resp.role.RoleUserResp">
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.nickname,
|
||||
t2.username,
|
||||
t2.status,
|
||||
t2.gender,
|
||||
t2.dept_id,
|
||||
t2.description,
|
||||
t2.is_system,
|
||||
t3.name AS deptName
|
||||
FROM sys_user_role AS t1
|
||||
LEFT JOIN sys_user AS t2 ON t2.id = t1.user_id
|
||||
LEFT JOIN sys_dept AS t3 ON t3.id = t2.dept_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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="top.ysoft.admin.system.mapper.UserSocialMapper">
|
||||
<select id="selectBySourceAndOpenId"
|
||||
resultType="top.ysoft.admin.system.model.entity.UserSocialDO">
|
||||
SELECT t1.*
|
||||
FROM sys_user_social AS t1
|
||||
LEFT JOIN sys_user AS t2 ON t2.id = t1.user_id
|
||||
WHERE t1.source = #{source} AND t1.open_id = #{openId}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user