From 30df94c05573a426d030510d4dd58ae1d93bfb7a Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 06 Dec 2021 14:03:37 +0800
Subject: [PATCH] 1.资格审查排序

---
 src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml |   69 +++++++++++++++++++++++++++++++---
 1 files changed, 63 insertions(+), 6 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 f021c0a..4f523b2 100644
--- a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
+++ b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
@@ -5,7 +5,64 @@
     <!--派遣公司分页信息-->
     <select id="selectDispatcherUnitPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
         select
-        sdu.*,bt.dept_name tenantName
+        distinct
+        sdu.*,bt.dept_name tenantName,bu.real_name realName
+        from
+        sys_dispatcher_unit sdu
+        LEFT JOIN
+        blade_dept bt
+        ON
+        sdu.dept_id = bt.id
+        left join
+        sys_dispatcher sd
+        on
+        sdu.id = sd.dispatcher_unit_id
+        left join
+        blade_user bu
+        on
+        sd.user_ids = bu.id
+        WHERE
+            1=1
+        <if test="dispatcherUnit.tenantName!=null and  dispatcherUnit.tenantName!=''">
+            and bt.dept_name like concat('%', #{dispatcherUnit.tenantName},'%')
+        </if>
+        <if test="dispatcherUnit.name!=null and  dispatcherUnit.name!=''">
+            and sdu.name like concat('%', #{dispatcherUnit.name},'%')
+        </if>
+        <if test="dispatcherUnit.linkman!=null and  dispatcherUnit.linkman!=''">
+            and sdu.linkman like concat('%', #{dispatcherUnit.linkman},'%')
+        </if>
+        <if test="dispatcherUnit.phone!=null and  dispatcherUnit.phone!=''">
+            and sdu.phone like concat('%', #{dispatcherUnit.phone},'%')
+        </if>
+        <if test="dispatcherUnit.province!=null">
+            and sdu.province = #{dispatcherUnit.province}
+        </if>
+        <if test="dispatcherUnit.deptId!=null and dispatcherUnit.deptId!=''">
+            and sdu.dept_id = #{dispatcherUnit.deptId}
+        </if>
+        <if test="dispatcherUnit.city!=null">
+            and sdu.city = #{dispatcherUnit.city}
+        </if>
+        <if test="dispatcherUnit.jurisdiction!=null">
+            and sdu.jurisdiction = #{dispatcherUnit.jurisdiction}
+        </if>
+        <if test="dispatcherUnit.district!=null">
+            and sdu.district = #{dispatcherUnit.district}
+        </if>
+        <if test="dispatcherUnit.isExpire==1">
+            and sdu.start_time &lt;= now()
+            and sdu.end_time &gt; now()
+        </if>
+        <if test="dispatcherUnit.isExpire==2">
+            and sdu.end_time &lt;= now()
+        </if>
+    </select>
+
+    <!--自定义树-->
+    <select id="selectDispatcherUnitPageTree" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
+        select
+        sdu.id,sdu.name
         from
         sys_dispatcher_unit sdu
         LEFT JOIN
@@ -44,15 +101,15 @@
     <!--派遣公司详细信息-->
     <select id="selectDispatcherUnitInfo" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
         select
-        sdu.*,bt.dept_name tenantName
+            sdu.*,bt.dept_name tenantName
         from
-        sys_dispatcher_unit sdu
+            sys_dispatcher_unit sdu
         LEFT JOIN
-        blade_dept bt
+            blade_dept bt
         ON
-        sdu.dept_id = bt.id
+            sdu.dept_id = bt.id
         where
-        1=1
+            1=1
         <if test="dispatcherUnit.id!=null">
             and sdu.id = #{dispatcherUnit.id}
         </if>

--
Gitblit v1.9.3