From 733edfcd6ad1c38dcf4aa761a417f4e4bfd754b2 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 27 Aug 2021 11:05:44 +0800
Subject: [PATCH] 1.许可审批

---
 src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml |   63 +++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 9 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 441c59e..5f5cf52 100644
--- a/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
+++ b/src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherUnitMapper.xml
@@ -5,17 +5,17 @@
     <!--派遣公司分页信息-->
     <select id="selectDispatcherUnitPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
         select
-            sdu.*,bt.tenant_name tenantName
+            sdu.*,bt.dept_name deptName
         from
             sys_dispatcher_unit sdu
         LEFT JOIN
-            blade_tenant bt
+            blade_dept bt
         ON
-            sdu.tenant_id = bt.tenant_id
+            sdu.dept_id = bt.id
         WHERE
             1=1
-        <if test="dispatcherUnit.tenantName!=null and  dispatcherUnit.tenantName!=''">
-            and bt.tenant_name like concat('%', #{dispatcherUnit.tenantName},'%')
+        <if test="dispatcherUnit.deptName!=null and  dispatcherUnit.deptName!=''">
+            and bt.dept_name like concat('%', #{dispatcherUnit.deptName},'%')
         </if>
         <if test="dispatcherUnit.name!=null and  dispatcherUnit.name!=''">
             and sdu.name like concat('%', #{dispatcherUnit.name},'%')
@@ -32,6 +32,51 @@
         <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.beginTime!=null or dispatcherUnit.overTime!=null">
+            and sdu.end_time &lt;= #{dispatcherUnit.overTime} and sdu.end_time &gt;= #{dispatcherUnit.beginTime}
+            or ( sdu.start_time &lt;= #{dispatcherUnit.overTime} and sdu.start_time &gt;= #{dispatcherUnit.beginTime})
+        </if>
+    </select>
+
+    <!--自定义树-->
+    <select id="selectDispatcherUnitPageTree" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
+        select
+        sdu.id,sdu.name
+        from
+        sys_dispatcher_unit sdu
+        LEFT JOIN
+        blade_dept bt
+        ON
+        sdu.dept_id = bt.id
+        WHERE
+        1=1
+        <if test="dispatcherUnit.deptName!=null and  dispatcherUnit.deptName!=''">
+            and bt.dept_name like concat('%', #{dispatcherUnit.deptName},'%')
+        </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.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>
@@ -41,14 +86,14 @@
     <!--派遣公司详细信息-->
     <select id="selectDispatcherUnitInfo" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO">
         select
-            sdu.*,bt.tenant_name tenantName
+            sdu.*,bt.dept_name deptName
         from
             sys_dispatcher_unit sdu
         LEFT JOIN
-            blade_tenant bt
+            blade_dept bt
         ON
-            sdu.tenant_id = bt.tenant_id
-        WHERE
+            sdu.dept_id = bt.id
+        where
             1=1
         <if test="dispatcherUnit.id!=null">
             and sdu.id = #{dispatcherUnit.id}

--
Gitblit v1.9.3