| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.sckw.transport.dao.KwtWaybillOrderV1Mapper">
- <select id="statistics" resultType="com.sckw.core.model.vo.TableTop"
- parameterType="com.sckw.transport.model.dto.WaybillOrderQueryDto">
- SELECT
- wo.status 'value',
- count(1) total
- from kwt_waybill_order wo
- where wo.del_flag = 0
- <if test="entId != null and entId != ''">
- and wo.ent_id = #{entId, jdbcType=VARCHAR}
- </if>
- <if test="userIds != null and userIds.size() > 0">
- and wo.create_by IN
- <foreach collection="userIds" open="(" close=")" item="item" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="(loadCityCode != null and loadCityCode != '') or (unloadCityCode != null and unloadCityCode != '')">
- and wo.id in (
- SELECT DISTINCT w_order_id from kwt_waybill_order_address where del_flag = 0
- <if test="loadCityCode != null and loadCityCode != ''">
- and address_type = 1
- and left(city_code, #{loadCityCodeLevel, jdbcType=INTEGER}) = left( #{loadCityCode, jdbcType=INTEGER}, #{loadCityCodeLevel, jdbcType=INTEGER} )
- </if>
- <if test="unloadCityCode != null and unloadCityCode != ''">
- and address_type = 2
- and left(city_code, #{loadCityCodeLevel, jdbcType=INTEGER}) = left( #{unloadCityCode, jdbcType=INTEGER}, #{loadCityCodeLevel, jdbcType=INTEGER} )
- </if>
- )
- </if>
- <if test="(startLoadTime != null and startLoadTime != '') or (endLoadTime != null and endLoadTime != '')
- or (startUnloadTime != null and startUnloadTime != '') or (endUnloadTime != null and endUnloadTime != '')">
- and wo.id in (
- SELECT DISTINCT w_order_id from kwt_waybill_order_subtask where del_flag = 0
- <if test="startLoadTime != null and startLoadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endLoadTime != null and endLoadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="startUnloadTime != null and startUnloadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endUnloadTime != null and endUnloadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- )
- </if>
- <if test="startSendCarTime != null and startSendCarTime != '' " >
- and DATE( wo.create_time) <![CDATA[ >= ]]> #{startSendCarTime,jdbcType=TIMESTAMP}
- </if>
- <if test="startSendCarTime != null and startSendCarTime != '' " >
- and DATE( wo.create_time ) <![CDATA[ <= ]]> #{endSendCarTime,jdbcType=TIMESTAMP}
- </if>
- <if test="keywords != null and keywords != ''">
- and (
- wo.w_order_no like concat('%',#{keywords},'%')
- or wo.truck_no like concat('%',#{keywords},'%')
- or wo.driver_name like concat('%',#{keywords},'%')
- )
- </if>
- GROUP BY wo.status
- </select>
- <select id="findListPage" resultType="com.sckw.transport.model.vo.WaybillOrderSelectVo"
- parameterType="com.sckw.transport.model.dto.WaybillOrderQueryDto">
- SELECT
- wo.id wOrderId, wo.ent_id entId, wo.w_order_no wOrderNo, wo.type, wo.truck_no truckNo, wo.driver_name driverName,
- wo.driver_phone driverPhone, wo.type, wo.create_time sendCarTime, wo.create_by createBy, wo.create_time createTime,
- wo.update_time updateTime, wo.status
- from kwt_waybill_order wo
- where wo.del_flag = 0
- <if test="lOrderId != null and lOrderId != ''">
- and exists(select 1 from kwt_waybill_order_subtask wos where wo.id = wos.w_order_id and wos.l_order_id = #{lOrderId})
- </if>
- <if test="lOrderId == null or lOrderId == ''">
- <if test="entId != null and entId != ''">
- and wo.ent_id = #{entId, jdbcType=VARCHAR}
- </if>
- <if test="userIds != null and userIds.size() > 0">
- and wo.create_by IN
- <foreach collection="userIds" open="(" close=")" item="item" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="entIds != null and entIds.size() > 0">
- and wo.ent_id IN
- <foreach collection="entIds" open="(" close=")" item="item" separator=",">
- #{item}
- </foreach>
- </if>
- </if>
- <if test="queryWstatus != null and queryWstatus != ''">
- AND wo.status in
- <foreach collection="queryWstatus.split(',')" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="(loadCityCode != null and loadCityCode != '') or (unloadCityCode != null and unloadCityCode != '')">
- and wo.id in (
- SELECT DISTINCT w_order_id from kwt_waybill_order_address where del_flag = 0
- <if test="loadCityCode != null and loadCityCode != ''">
- and address_type = 1
- and left(city_code, #{loadCityCodeLevel, jdbcType=INTEGER}) = left( #{loadCityCode, jdbcType=INTEGER}, #{loadCityCodeLevel, jdbcType=INTEGER} )
- </if>
- <if test="unloadCityCode != null and unloadCityCode != ''">
- and address_type = 2
- and left(city_code, #{unloadCityCodeLevel, jdbcType=INTEGER}) = left( #{unloadCityCode, jdbcType=INTEGER}, #{unloadCityCodeLevel, jdbcType=INTEGER} )
- </if>
- )
- </if>
- <if test="(startLoadTime != null and startLoadTime != '') or (endLoadTime != null and endLoadTime != '')
- or (startUnloadTime != null and startUnloadTime != '') or (endUnloadTime != null and endUnloadTime != '')">
- and wo.id in (
- SELECT DISTINCT w_order_id from kwt_waybill_order_subtask where del_flag = 0
- <if test="startLoadTime != null and startLoadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endLoadTime != null and endLoadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="startUnloadTime != null and startUnloadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endUnloadTime != null and endUnloadTime != ''">
- and DATE(load_time) <![CDATA[ >= ]]> #{startLoadTime,jdbcType=TIMESTAMP}
- </if>
- )
- </if>
- <if test="startSendCarTime != null and startSendCarTime != '' " >
- and DATE( wo.create_time) <![CDATA[ >= ]]> #{startSendCarTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endSendCarTime != null and endSendCarTime != '' " >
- and DATE( wo.create_time ) <![CDATA[ <= ]]> #{endSendCarTime,jdbcType=TIMESTAMP}
- </if>
- <if test="keywords != null and keywords != ''">
- and (
- wo.w_order_no like concat('%',#{keywords},'%')
- or wo.truck_no like concat('%',#{keywords},'%')
- or wo.driver_name like concat('%',#{keywords},'%')
- )
- </if>
- order by wo.update_time desc
- </select>
- <select id="findCapacityListPage" resultType="com.sckw.transport.model.vo.WaybillOrderSelectVo"
- parameterType="com.sckw.transport.model.dto.WaybillSubtaskOrderQueryDto">
- SELECT
- wo.driver_id driverId, wo.driver_name driverName, wo.driver_phone driverPhone, wo.driver_idcard driverIdcard,
- wo.truck_id truckId, wo.truck_no truckNo, count(1) count
- from kwt_waybill_order wo
- left join kwt_waybill_order_subtask wos on wos.w_order_id = wo.id
- WHERE wo.del_flag = 0 and wos.del_flag = 0
- <if test="ids != null and ids != ''">
- AND wos.l_order_id IN
- <foreach collection="ids.split(',')" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="findStatisticsCountByDriver" resultType="java.util.Map">
- SELECT
- count(case when wo.status = 101 then 1 end) waitTotal,
- count(case when wo.status = 201 then 1 end) departureTotal,
- count(case when wo.status in (203, 301, 302, 401, 402) then 1 end) executeTotal,
- count(case when wo.status in (501, 502, 503, 504, 103, 202) then 1 end) endTotal
- from kwt_waybill_order wo
- where wo.del_flag = 0
- and wo.driver_id = #{driverId, jdbcType=BIGINT}
- <if test="specialEntIds != null and specialEntIds.size() > 0">
- and wo.ent_id in
- <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
- #{item,jdbcType=BIGINT}
- </foreach>
- </if>
- </select>
- <select id="findWaybillOrderSubtask" resultType="com.sckw.transport.model.vo.WaybillOrderSubtaskVo" parameterType="java.util.Map">
- SELECT
- wo.id, wo.id wOrderId, wo.ent_id entId, wo.w_order_no wOrderNo, wo.truck_no truckNo, wo.driver_name driverName, wo.driver_phone driverPhone,
- wo.driver_idcard driverIdcard, wo.type, wo.create_time sendCarTime, wo.create_time createTime, wo.update_time updateTime, wo.status, wos.unit,
- wos.load_amount loadAmount, wos.unload_amount unloadAmount, wos.load_time loadTime, wos.unload_time unloadTime, wos.entrust_amount entrustAmount,
- wos.deficit_amount deficitAmount, wos.deficit_price deficitPrice, wos.id wSubtaskId
- from kwt_waybill_order wo
- left join kwt_waybill_order_subtask wos on wos.w_order_id = wo.id
- where wo.del_flag = 0 and wos.del_flag = 0
- <if test="entId != null and entId != ''">
- and wo.ent_id = #{entId, jdbcType=BIGINT}
- </if>
- <if test="lOrderId != null and lOrderId != ''">
- and wos.l_order_id = #{lOrderId, jdbcType=BIGINT}
- </if>
- <if test="specialEntIds != null and specialEntIds.size() > 0">
- and wo.ent_id in
- <foreach collection="specialEntIds" item="item" open="(" close=")" separator=",">
- #{item,jdbcType=BIGINT}
- </foreach>
- </if>
- <if test="driverId != null and driverId != ''">
- and wo.driver_id = #{driverId, jdbcType=BIGINT}
- </if>
- <if test="busAppStatus != null and busAppStatus != ''">
- and wos.status = #{busAppStatus}
- </if>
- <if test="busStatus != null and busStatus == 1">
- and wo.status = 101
- </if>
- <if test="busStatus != null and busStatus == 2">
- and wo.status = 201
- </if>
- <if test="busStatus != null and busStatus == 3">
- and wo.status in (203, 301, 302, 401, 402)
- </if>
- <if test="busStatus != null and busStatus == 4">
- and wo.status in (103, 202, 501, 502, 503, 504)
- </if>
- <if test="month != null and month != ''">
- and LEFT(wo.create_time, 7) = #{month, jdbcType=TIMESTAMP}
- </if>
- <if test="startTime != null and startTime != ''">
- and LEFT(wo.create_time, 10) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endTime != null and endTime != ''">
- and LEFT(wo.create_time, 10) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
- </if>
- <if test="busStatus != null and busStatus == 2">
- ORDER BY wos.load_time
- </if>
- <if test="busStatus != null and busStatus == 4">
- ORDER BY CASE WHEN wo.status = 503 THEN wo.status * -1 ELSE wo.status END ASC, wo.update_time desc
- </if>
- </select>
- <select id="findCountByDriverOrTruck" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT
- count(case when wo.status = 502 then 1 end) totalComplete,
- count(case when wo.status not in (101, 102, 103, 202) then 1 end) totalTake,
- count(case when wo.status in (203, 301, 302, 401, 402) then 1 end) totalExecute
- from kwt_waybill_order wo
- left join kwt_waybill_order_subtask wos on wos.w_order_id = wo.id
- where wo.del_flag = 0 and wos.del_flag = 0
- <if test="driverId != null and driverId != ''">
- and wo.driver_id = #{driverId, jdbcType=BIGINT}
- </if>
- <if test="truckId != null and truckId != ''">
- and wo.truck_id = #{truckId, jdbcType=BIGINT}
- </if>
- </select>
- <select id="findCountByLOrderId" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT
- count(case when wo.status = 502 then 1 end) totalComplete
- from kwt_waybill_order wo
- left join kwt_waybill_order_subtask wos on wos.w_order_id = wo.id
- where wo.del_flag = 0 and wos.del_flag = 0
- <if test="lOrderId != null and lOrderId != ''">
- and wos.l_order_id = #{lOrderId, jdbcType=BIGINT}
- </if>
- </select>
- <select id="findAmountByDriverOrTruck" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT
- IFNULL(SUM(wos.load_amount), 0.0) loadAmount
- from kwt_waybill_order_subtask wos
- left join kwt_waybill_order wo on wos.w_order_id = wo.id
- where wo.del_flag = 0 and wos.del_flag = 0
- <if test="driverId != null and driverId != ''">
- and wo.driver_id = #{driverId, jdbcType=BIGINT}
- </if>
- <if test="truckId != null and truckId != ''">
- and wo.truck_id = #{truckId, jdbcType=BIGINT}
- </if>
- </select>
- <select id="findUnfinishedByTruck" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT count(1) totalExecute from kwt_waybill_order wo
- where wo.del_flag = 0
- and wo.status in (101, 201, 203, 301, 302, 401, 402)
- <if test="type != null and type != ''">
- and wo.type = #{type, jdbcType=INTEGER}
- </if>
- <if test="truckId != null and truckId != ''">
- and wo.truck_id = #{truckId, jdbcType=BIGINT}
- </if>
- </select>
- <select id="findTicketCountByAddress" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT
- IFNULL(sum(wot.amount), 0.0) amount,
- MIN(wot.operate_time) loadTime,
- MAX(wot.operate_time) unloadTime
- from kwt_waybill_order_ticket wot
- left join kwt_waybill_order_address woa on woa.id = wot.w_address_id
- left join kwt_logistics_order_address loa on loa.id = woa.l_address_id
- left join kwt_logistics_order lo on lo.id = loa.l_order_id
- left join kwt_waybill_order wo on wo.id = wot.w_order_id
- where wot.del_flag = 0
- <if test="passStatus != null and passStatus != ''">
- and wo.status = 502
- </if>
- <if test="wOrderId != null and wOrderId != ''">
- and wot.w_order_id = #{wOrderId, jdbcType=BIGINT}
- </if>
- <if test="type != null and type != ''">
- and wot.type = #{type, jdbcType=VARCHAR}
- </if>
- <if test="unit != null and unit != ''">
- and wot.unit = #{unit, jdbcType=VARCHAR}
- </if>
- <if test="lAddressId != null and lAddressId != ''">
- and loa.id = #{lAddressId, jdbcType=BIGINT}
- </if>
- <if test="lOrderId != null and lOrderId != ''">
- and lo.id = #{lOrderId, jdbcType=BIGINT}
- </if>
- <if test="upperlOrderId != null and upperlOrderId != ''">
- and FIND_IN_SET(#{upperlOrderId, jdbcType=BIGINT}, lo.pids)
- </if>
- </select>
- <select id="selectWaybillOrderCarPage" parameterType="java.util.Map" resultType="com.sckw.transport.model.dto.OrderCarDTO">
- SELECT
- kwo.id as wOrderId,
- kwo.w_order_no as wOrderNo,
- kwo.driver_id as driverId,
- kwo.driver_name as driverName,
- kwo.driver_phone as driverPhone,
- kwo.driver_idcard as driverCard,
- kwo.truck_no as truckNo,
- kwo.status as status,
- kwos.l_order_id as lOrderId,
- klo.l_order_no as lOrderNo,
- klo.t_order_id as tOrderId,
- klo.t_order_no as tOrderNo
- FROM kwt_waybill_order kwo
- left join kwt_waybill_order_subtask kwos on kwos.w_order_id = kwo.id
- LEFT JOIN kwt_logistics_order klo ON kwos.l_order_id = klo.id
- WHERE kwo.del_flag = 0 and kwos.del_flag = 0 and klo.del_flag = 0
- <if test="tOrderIds != null and tOrderIds.size() > 0">
- and klo.t_order_id in
- <foreach collection="tOrderIds" item="item" close=")" open="(" separator=",">
- #{item,jdbcType=BIGINT}
- </foreach>
- </if>
- </select>
- <select id="findWaybillOrder" resultType="com.sckw.transport.model.KwtWaybillOrderV1" parameterType="java.util.Map">
- SELECT
- kwo.id, kwo.id wOrderId, kwo.w_order_no worderNo, kwo.type, kwo.ent_id carrierEntId, kwo.truck_id truckId, kwo.truck_no truckNo, kwo.status,
- kwo.create_time createTime, kwo.driver_id driverId, kwo.driver_name driverName, kwo.driver_phone driverPhone, kwo.ent_id entId
- FROM kwt_waybill_order kwo
- where kwo.del_flag = 0
- <if test="driverId != null and driverId != ''">
- and kwo.driver_id = #{driverId, jdbcType=BIGINT}
- </if>
- <if test="truckNo != null and truckNo != ''">
- and kwo.truck_no = #{truckNo, jdbcType=VARCHAR}
- </if>
- <if test="status != null and status != ''">
- and kwo.status = #{status, jdbcType=INTEGER}
- </if>
- <if test="busStatus != null and busStatus == 2">
- and kwo.status = 201
- </if>
- <if test="busStatus != null and busStatus == 3">
- and kwo.status in (203, 301, 302, 401, 402)
- </if>
- <if test="busStatus != null and busStatus == 4">
- and kwo.status in (102, 103, 202, 501, 502, 503, 504)
- </if>
- <if test="lOrderId != null and lOrderId != ''">
- and kwo.id in (SELECT w_order_id from kwt_waybill_order_subtask where del_flag = 0 and l_order_id = #{lOrderId, jdbcType=BIGINT} ))
- </if>
- <choose>
- <when test="lOrderIds != null and lOrderIds != '' and lOrderIds.size() > 0">
- and kwo.id in (
- SELECT w_order_id from kwt_waybill_order_subtask where del_flag = 0 and l_order_id in
- <foreach collection="lOrderIds" item="lOrderId" open="(" close=")" separator=",">
- #{lOrderId,jdbcType=BIGINT}
- </foreach>
- )
- </when>
- </choose>
- </select>
- <select id="findWaybillOrderCount" resultType="com.sckw.transport.model.vo.WaybillCountVo">
- SELECT
- count(case when c.status = 8 then 1 end) totalComplete,
- count(case when c.status not in (1, 9, 10, 11) then 1 end) totalTake,
- count(case when c.status in (3, 4, 5, 6) then 1 end) totalExecute,
- count(DISTINCT case when lo.status in (0, 1, 2, 3) then lo.id end) totalUnfinished,
- IFNULL(SUM(c.entrust_amount), 0.0) entrustAmount, IFNULL(SUM(c.load_amount), 0.0) loadAmount,
- IFNULL(SUM(c.unload_amount), 0.0) unloadAmount, IFNULL(SUM(c.deficit_amount), 0.0) deficitAmount,
- MIN(wot1.operate_time) loadTime, MAX(wot2.operate_time) unloadTime
- from kwt_waybill_order wo
- left join kwt_waybill_order_subtask c on wo.id = c.w_order_id
- left join kwt_waybill_order_ticket wot1 on wot1.w_order_id = wo.id and wot1.type = 1 and c.unit = wot1.unit and wot1.type = 1 and wot1.del_flag = 0
- left join kwt_waybill_order_ticket wot2 on wot2.w_order_id = wo.id and wot2.type = 2 and c.unit = wot2.unit and wot1.type = 2 and wot2.del_flag = 0
- left join kwt_logistics_order lo on lo.id = c.l_order_id
- where c.del_flag = 0 and lo.del_flag = 0
- <if test="driverId != null and driverId != ''">
- and wo.driver_id = #{driverId, jdbcType=BIGINT}
- </if>
- <if test="truckId != null and truckId != ''">
- and wo.truck_id = #{truckId, jdbcType=BIGINT}
- </if>
- <if test="passStatus != null and passStatus != ''">
- and c.status = 8
- </if>
- <if test="loadCountStatus != null and loadCountStatus != ''">
- and c.status in (5, 6, 7, 8, 12, 13)
- </if>
- <if test="unloadCountStatus != null and unloadCountStatus != ''">
- and c.status in (7, 8, 12, 13)
- </if>
- <if test="tOrderId != null and tOrderId != ''">
- and lo.t_order_id = #{tOrderId, jdbcType=BIGINT}
- </if>
- <if test="lOrderId != null and lOrderId != ''">
- and lo.id = #{lOrderId, jdbcType=BIGINT}
- </if>
- <if test="logisticsStatus != null and logisticsStatus != ''">
- and lo.status = #{logisticsStatus, jdbcType=INTEGER}
- </if>
- <if test="upperlOrderId != null and upperlOrderId != ''">
- and FIND_IN_SET(#{upperlOrderId, jdbcType=BIGINT}, lo.pids)
- </if>
- <if test="belowlOrderId != null and belowlOrderId != ''">
- and FIND_IN_SET(lo.id, #{belowlOrderId, jdbcType=VARCHAR})
- </if>
- <if test="ownOrderId != null and ownOrderId != ''">
- and lo.id != #{ownOrderId, jdbcType=BIGINT}
- </if>
- </select>
- <select id="selectDataByLorderId" resultType="java.lang.Integer">
- SELECT COUNT(b.id)
- FROM kwt_waybill_order_subtask k
- left join kwt_waybill_order a on k.w_order_id = a.id and a.del_flag = 0 and k.del_flag = 0
- LEFT JOIN kwt_logistics_order b ON k.l_order_id = b.id AND a.del_flag = 0 AND b.del_flag = 0
- <where>
- <if test="id != null and id !=''">
- and b.id = #{id}
- </if>
- <if test="statusList != null and statusList.size() >0">
- AND a.`status` IN
- <foreach collection="statusList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectDataByLorderIds" resultType="java.lang.Integer">
- SELECT COUNT(b.id)
- FROM kwt_waybill_order_subtask k
- left join kwt_waybill_order a on k.w_order_id = a.id and a.del_flag = 0 and k.del_flag = 0
- LEFT JOIN kwt_logistics_order b ON k.l_order_id = b.id AND a.del_flag = 0 AND b.del_flag = 0
- <where>
- <if test="list != null and list.size() > 0">
- and b.id in <foreach collection="list" item="item" open="(" close=")" separator=","> #{item}</foreach>
- </if>
- <if test="status != null">
- AND a.`status`= #{status}
- </if>
- </where>
- </select>
- </mapper>
|