From 62eb499b0c969f246d3245d1429a97da4de1ce28 Mon Sep 17 00:00:00 2001
From: 钟日健 <arsn163@163.com>
Date: Mon, 01 Jun 2026 20:46:13 +0800
Subject: [PATCH] feat: 成绩查询增加年龄查询返回
---
src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml | 144 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 137 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
index 5492667..f61546f 100644
--- a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
+++ b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
@@ -10,33 +10,87 @@
<result column="dispatcher" property="dispatcher"/>
<result column="dispatcherTime" property="dispatchertime"/>
<result column="dispatcherAddress" property="dispatcheraddress"/>
- <result column="dispatchercompany" property="dispatchercompany"/>
</resultMap>
-
-
-<!-- <select id="selectDispatcherPage" resultMap="dispatcherResultMap">-->
-<!-- select * from sys_dispatcher where is_deleted = 0-->
-<!-- </select>-->
<!--派遣记录分页数据-->
<select id="selectDispatcherPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO">
select
- sd.*,sdu.name dispatcherCompany
+ sd.*,bu.real_name securityName,sdu.name dispatcherCompany,bu.cardid idCardNo,bd.dept_name deptName
from
sys_dispatcher sd
left join
sys_dispatcher_unit sdu
on
sdu.id = sd.dispatcher_unit_id
+ left join
+ blade_user bu
+ on
+ bu.id = sd.user_ids
+ left join
+ blade_dept bd
+ on
+ bd.id = bu.dept_id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = sdu.jurisdiction
where 1=1
+ and bu.status =1
+ and bu.is_deleted = 0
+ <if test="dispatcher.jurisdiction!=null and dispatcher.jurisdiction!='' and dispatcher.jurisdiction!='1372091709474910209'">
+ and (sj.id = #{dispatcher.jurisdiction} or sj.parent_id = #{dispatcher.jurisdiction})
+ </if>
+ <if test="dispatcher.dispatcherUnitId!=null">
+ and sd.dispatcher_unit_id = #{dispatcher.dispatcherUnitId}
+ </if>
+ <if test="dispatcher.deptId!=null">
+ and sd.dept_id in
+ (
+ select id from blade_dept where id = #{dispatcher.deptId}
+ union
+ SELECT
+ id
+ FROM
+ (
+ SELECT
+ t1.id,t1.parent_id,t1.dept_name,
+ IF
+ ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
+ FROM
+ ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
+ ( SELECT @pids := #{dispatcher.deptId} ) t2
+ ) t3
+ WHERE
+ ischild != 0
+ )
+ </if>
+ <if test="dispatcher.dispatch!=null and dispatcher.dispatch!=''">
+ and bu.dispatch = #{dispatcher.dispatch}
+ and sd.status = #{dispatcher.dispatch}
+ </if>
+ <if test="dispatcher.userIds!=null and dispatcher.userIds!=''">
+ and sd.user_ids like concat('%', #{dispatcher.userIds},'%')
+ </if>
<if test="dispatcher.name!=null and dispatcher.name!=''">
and sd.name like concat('%', #{dispatcher.name},'%')
+ </if>
+ <if test="dispatcher.securityName!=null and dispatcher.securityName!=''">
+ and bu.real_name like concat('%', #{dispatcher.securityName},'%')
+ </if>
+ <if test="dispatcher.deptName!=null and dispatcher.deptName!=''">
+ and bd.dept_name like concat('%', #{dispatcher.deptName},'%')
</if>
<if test="dispatcher.cardid!=null and dispatcher.cardid!=''">
and sd.cardid like concat('%', #{dispatcher.cardid},'%')
</if>
<if test="dispatcher.dispatcherCompany!=null and dispatcher.dispatcherCompany!=''">
and sdu.name like concat('%', #{dispatcher.dispatcherCompany},'%')
+ </if>
+ <if test="dispatcher.beginTime!=null or dispatcher.overTime!=null">
+ <if test="dispatcher.beginTime!='' or dispatcher.overTime!=''">
+ and sd.end_time <= #{dispatcher.overTime} and sd.end_time >= #{dispatcher.beginTime}
+ or ( sd.dispatcherTime <= #{dispatcher.overTime} and sd.dispatcherTime >= #{dispatcher.beginTime})
+ </if>
</if>
</select>
@@ -56,4 +110,80 @@
</if>
</select>
+ <!--派遣记录条数-->
+ <select id="getDispatcherCount" resultType="java.lang.Integer">
+ select ifnull(count(*),0) count from sys_dispatcher
+ where
+ 1=1
+ and dispatcher_unit_id = #{dispatcherUnitVO1.id}
+ and status = 0
+ </select>
+
+ <!--查询用的派遣信息-->
+ <select id="getDispatcherInfoByUserId" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO">
+ select
+ sd.*
+ from
+ sys_dispatcher sd
+ left join
+ sys_dispatcher_unit sdu
+ on
+ sdu.id = sd.dispatcher_unit_id
+ where sd.user_ids = #{userId}
+ and sd.status = 0
+ </select>
+
+ <update id="updateEndtime">
+ update sys_dispatcher set end_time =#{endTime} where dispatcher_unit_id =#{disId}
+ </update>
+
+ <select id="getDispatcherStatisticsList"
+ resultType="org.springblade.modules.dispatcher.vo.DispatcherStatistics">
+
+<!-- SELECT-->
+<!-- sd.dept_id,-->
+<!-- bd.dept_name,-->
+<!-- COUNT(*) total,-->
+<!-- SUM( CASE WHEN bu.hold = '1' THEN 1 ELSE 0 END ) AS holdNum,-->
+<!-- SUM( CASE WHEN bu.hold = '2' THEN 1 ELSE 0 END ) AS unholdNum-->
+<!-- FROM-->
+<!-- sys_dispatcher sd-->
+<!-- LEFT JOIN blade_user bu ON bu.id = sd.user_ids-->
+<!-- LEFT JOIN blade_dept bd ON bd.id = sd.dept_id-->
+<!-- WHERE sd.`status` = 0-->
+<!-- <if test="statistics.deptId != null and statistics.deptId !='' ">-->
+<!-- AND sd.dept_id = #{statistics.deptId}-->
+<!-- </if>-->
+<!-- GROUP BY-->
+<!-- sd.dept_id,-->
+<!-- bd.dept_name-->
+
+ SELECT
+ sdu.id unitId,
+ sdu.name unitName,
+ COUNT(*) total,
+ SUM( CASE WHEN bu.hold = '1' THEN 1 ELSE 0 END ) AS holdNum,
+ SUM( CASE WHEN bu.hold = '2' THEN 1 ELSE 0 END ) AS unholdNum
+ FROM
+ sys_dispatcher sd
+ LEFT JOIN blade_user bu ON bu.id = sd.user_ids
+ LEFT JOIN sys_dispatcher_unit sdu ON sdu.id = sd.dispatcher_unit_id
+ LEFT JOIN blade_dept bd ON bd.id = sd.dept_id
+ WHERE
+ sd.`status` = 0
+ <if test="statistics.deptId != null and statistics.deptId !='' ">
+ AND sd.dept_id = #{statistics.deptId}
+ </if>
+ GROUP BY
+ sdu.id,
+ sdu.name
+
+ </select>
+ <select id="selectDispatcherUnitExist"
+ resultType="org.springblade.modules.dispatcher.entity.DispatcherUnit">
+
+ SELECT * FROM sys_dispatcher_unit WHERE name = #{dispatchUnitName} limit 1
+
+ </select>
+
</mapper>
--
Gitblit v1.9.3