From 8d43111bd0e598bc0b2014cbfa69a32e74959dff Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 15 Dec 2021 19:24:05 +0800
Subject: [PATCH] ftp sql 同步封装
---
src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
index 5f5cf52..161e31b 100644
--- a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
+++ b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
@@ -5,13 +5,17 @@
<!--派遣公司分页信息-->
<select id="selectDispatcherUnitPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
select
- sdu.*,bt.dept_name deptName
+ sdu.*,bt.dept_name deptName,sj.dept_name jurisdictionName
from
sys_dispatcher_unit sdu
LEFT JOIN
blade_dept bt
ON
sdu.dept_id = bt.id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = sdu.jurisdiction
WHERE
1=1
<if test="dispatcherUnit.deptName!=null and dispatcherUnit.deptName!=''">
@@ -32,15 +36,27 @@
<if test="dispatcherUnit.city!=null">
and sdu.city = #{dispatcherUnit.city}
</if>
- <if test="dispatcherUnit.jurisdiction!=null">
- and sdu.jurisdiction = #{dispatcherUnit.jurisdiction}
+ <if test="dispatcherUnit.jurisdiction!=null and dispatcherUnit.jurisdiction!='' and dispatcherUnit.jurisdiction!='1372091709474910209'">
+ and (sj.id = #{dispatcherUnit.jurisdiction} or sj.parent_id = #{dispatcherUnit.jurisdiction})
+ </if>
+ <if test="dispatcherUnit.deptId!=null and dispatcherUnit.deptId!=''">
+ and sdu.dept_id = #{dispatcherUnit.deptId}
</if>
<if test="dispatcherUnit.district!=null">
and sdu.district = #{dispatcherUnit.district}
</if>
<if test="dispatcherUnit.beginTime!=null or dispatcherUnit.overTime!=null">
- and sdu.end_time <= #{dispatcherUnit.overTime} and sdu.end_time >= #{dispatcherUnit.beginTime}
- or ( sdu.start_time <= #{dispatcherUnit.overTime} and sdu.start_time >= #{dispatcherUnit.beginTime})
+ <if test="dispatcherUnit.beginTime!='' or dispatcherUnit.overTime!=''">
+ and sdu.end_time <= #{dispatcherUnit.overTime} and sdu.end_time >= #{dispatcherUnit.beginTime}
+ or ( sdu.start_time <= #{dispatcherUnit.overTime} and sdu.start_time >= #{dispatcherUnit.beginTime})
+ </if>
+ </if>
+ <if test="dispatcherUnit.isExpire==1">
+ and sdu.start_time <= now()
+ and sdu.end_time > now()
+ </if>
+ <if test="dispatcherUnit.isExpire==2">
+ and sdu.end_time <= now()
</if>
</select>
@@ -59,6 +75,9 @@
<if test="dispatcherUnit.deptName!=null and dispatcherUnit.deptName!=''">
and bt.dept_name like concat('%', #{dispatcherUnit.deptName},'%')
</if>
+ <if test="dispatcherUnit.deptId!=null and dispatcherUnit.deptId!=''">
+ and sdu.dept_id like concat('%', #{dispatcherUnit.deptId},'%')
+ </if>
<if test="dispatcherUnit.name!=null and dispatcherUnit.name!=''">
and sdu.name like concat('%', #{dispatcherUnit.name},'%')
</if>
--
Gitblit v1.9.3