Pārlūkot izejas kodu

工作台-坐席查询优化

yangyue 1 gadu atpakaļ
vecāks
revīzija
95d837326b

+ 2 - 1
duty-service/src/main/resources/mapper/DutySeatDutyUnitMapper.xml

@@ -64,7 +64,7 @@
     <select id="queryAdminSeat" resultMap="AdminSeatResult">
         SELECT u.serial_number,u.name,u.abbreviation,a.display_name,a.phone_number
         FROM duty_seat_duty_unit u
-        INNER JOIN duty_seat_duty_unit_person up on u.id = up.unit_id and up.del_flag = 0
+        LEFT JOIN duty_seat_duty_unit_person up on u.id = up.unit_id and up.del_flag = 0
         <if test="accountIds != null and accountIds.size() != 0">
             and up.account_id in
             <foreach collection="accountIds" open="(" separator="," close=")" item="item">
@@ -72,6 +72,7 @@
             </foreach>
         </if>
         LEFT JOIN duty_account a on up.account_id = a.id
+        WHERE u.dept_id IS NOT NULL
     </select>
     <select id="queryAdminSeatUnit" resultType="AdminSeatUnit">
         select *,(t.signInStatus + t.signOutStatus + t.dailyStatus + t.weekStatus) as sort