emis-service/emis-biz/src/main/resources/mapper/EmisTmsScanRecordMapper.xml

721 lines
46 KiB
XML
Raw Normal View History

2024-03-01 09:13:00 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
2024-04-30 14:52:23 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-03-01 09:13:00 +00:00
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTmsScanRecordMapper">
2024-04-30 14:52:23 +00:00
2024-06-02 02:57:46 +00:00
<resultMap type="EmisTmsScanRecord" id="BaseEmisTmsScanRecordResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
2024-03-01 09:13:00 +00:00
<result property="id" column="id" />
<result property="billCode" column="bill_code" />
2024-06-18 07:15:28 +00:00
<result property="mainBillCode" column="main_bill_code" />
2024-06-21 13:00:31 +00:00
<result property="blSubBill" column="bl_sub_bill" />
2024-05-10 08:40:04 +00:00
<result property="orderSn" column="order_sn" />
2024-03-01 09:13:00 +00:00
<result property="scanType" column="scan_type" />
<result property="preOrNextStation" column="pre_or_next_station" />
<result property="preOrNextStationCode" column="pre_or_next_station_code" />
<result property="preOrNextStationPhone" column="pre_or_next_station_phone" />
<result property="preOrNextManCode" column="pre_or_next_man_code" />
<result property="preOrNextManPhone" column="pre_or_next_man_phone" />
<result property="scanDate" column="scan_date" />
<result property="scanManCode" column="scan_man_code" />
<result property="scanManPhone" column="scan_man_phone" />
2024-04-30 15:36:01 +00:00
<result property="scanMan" column="scan_man" />
<result property="preOrNextMan" column="pre_or_next_man" />
2024-03-01 09:13:00 +00:00
<result property="scanSite" column="scan_site" />
<result property="scanSiteCode" column="scan_site_code" />
<result property="scanSitePhone" column="scan_site_phone" />
<result property="scanWeight" column="scan_weight" />
<result property="weight" column="weight" />
2024-05-10 08:40:04 +00:00
<result property="destSiteCode" column="dest_site_code" />
<result property="destCode" column="dest_code" />
2024-03-01 09:13:00 +00:00
<result property="dispatchOrSendMan" column="dispatch_or_send_man" />
<result property="dispatchOrSendManCode" column="dispatch_or_send_man_code" />
<result property="dispatchOrSendManPhone" column="dispatch_or_send_man_phone" />
<result property="signDate" column="sign_date" />
<result property="signMan" column="sign_man" />
<result property="signSite" column="sign_site" />
<result property="signSiteCode" column="sign_site_code" />
2024-04-30 15:36:01 +00:00
<result property="recordMan" column="record_man" />
2024-03-01 09:13:00 +00:00
<result property="recordManCode" column="record_man_code" />
<result property="recordManPhone" column="record_man_phone" />
<result property="recordSiteCode" column="record_site_code" />
2024-05-10 08:40:04 +00:00
<result property="carNo" column="car_no" />
<result property="bagNo" column="bag_no" />
2024-03-01 09:13:00 +00:00
<result property="truckMan" column="truck_man" />
<result property="truckCode" column="truck_code" />
<result property="dataFrom" column="data_from" />
<result property="picUrl" column="pic_url" />
2024-06-03 09:59:22 +00:00
<result property="publicTraceInfo" column="public_trace_info" />
<result property="innerTraceInfo" column="inner_trace_info" />
2024-08-04 07:22:39 +00:00
<result property="relId" column="rel_id" />
2024-03-01 09:13:00 +00:00
<result property="status" column="status" />
2024-06-01 22:27:44 +00:00
</resultMap>
<resultMap type="EmisTmsScanRecord" extends="BaseEmisTmsScanRecordResult" id="EmisTmsScanRecordResult" >
2024-06-01 14:36:51 +00:00
<association property="waybillDetail"
2024-06-18 07:15:28 +00:00
column="main_bill_code"
2024-06-01 15:10:36 +00:00
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
2024-06-01 14:36:51 +00:00
fetchType="lazy"
/>
2024-06-01 14:34:12 +00:00
2024-03-01 09:13:00 +00:00
</resultMap>
2024-06-04 04:31:27 +00:00
<resultMap type="ScanStatDataInfo" id="ScanStatDataInfoResult">
2024-06-01 14:34:12 +00:00
2024-06-01 22:27:44 +00:00
<result property="scanType" column="scan_type" />
2024-03-01 09:13:00 +00:00
2024-06-01 22:27:44 +00:00
<result property="scanSiteCode" column="scan_site_code" />
<result property="scanCount" column="scan_count" />
2024-06-19 18:22:32 +00:00
<result property="signCount" column="sign_count" />
<result property="signRate" column="sign_rate" />
2024-05-20 07:38:06 +00:00
2024-06-01 22:27:44 +00:00
<association property="scanSiteName"
column="scan_site_code"
2024-06-02 01:10:24 +00:00
select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"
2024-06-01 22:27:44 +00:00
fetchType="lazy"
/>
</resultMap>
2024-07-18 02:13:14 +00:00
<resultMap type="ScanStatInfoDtl" id="ScanStatInfoDtlResult">
<result property="billCode" column="billCode" />
<result property="gotCount" column="gotCount" />
<result property="sendCount" column="sendCount" />
2024-08-09 13:12:49 +00:00
<result property="arrivalCount" column="arrivalCount" />
<result property="transferCount" column="transferCount" />
2024-07-18 02:13:14 +00:00
<result property="sentCount" column="sentCount" />
<result property="issueCount" column="issueCount" />
<result property="holdCount" column="holdCount" />
<association property="waybillDetail"
column="billCode"
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
fetchType="lazy"
/>
</resultMap>
2024-09-07 14:54:17 +00:00
<!-- and ( b.problem_type is null or (b.problem_type is not null and (b.problem_type != 173 and b.problem_type != 170 and b.problem_type != 151) ) )-->
2024-07-18 02:13:14 +00:00
<select id="queryScanStatInfoDtlList" parameterType="EmisWaybill" resultMap="ScanStatInfoDtlResult">
2024-07-21 02:14:08 +00:00
select main_bill_code as billCode,
2024-07-18 02:13:14 +00:00
sum(IF(scan_type='10',1,0)) as gotCount,
sum(IF(scan_type='20',1,0)) as sendCount,
sum(IF(scan_type='30',1,0)) as arrivalCount,
sum(IF(scan_type='40',1,0)) as sentCount,
sum(IF(scan_type='50',1,0)) as signCount,
sum(IF(scan_type='-1',1,0)) as issueCount,
2024-08-09 13:12:49 +00:00
sum(IF(scan_type='70',1,0)) as holdCount,
sum(IF(scan_type='80',1,0)) as transferCount
2024-07-18 02:13:14 +00:00
from emis_tms_scan_record a
where EXISTS(
select 1 from emis_waybill b
where
2024-07-26 10:42:15 +00:00
b.del_flag='0' and order_status !='0'
2024-07-21 00:58:07 +00:00
and a.main_bill_code=b.bill_code
2024-09-07 14:54:17 +00:00
and not EXISTS (
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
)
2024-07-21 03:35:56 +00:00
<if test="params.billCode != null and params.billCode != ''">
and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') )
</if>
2024-07-18 02:13:14 +00:00
<if test="params.sendDay != null and params.sendDay != ''">
and DATE(b.send_date)=#{params.sendDay}
</if>
2024-07-21 02:41:25 +00:00
<if test="params.sendSiteCode != null and params.sendSiteCode != ''">
and b.send_site_code= #{params.sendSiteCode}
2024-07-18 02:13:14 +00:00
</if>
2024-07-21 02:41:25 +00:00
<if test="params.sendCenterCode != null and params.sendCenterCode != ''">
and b.send_center_code= #{params.sendCenterCode}
</if>
<if test="params.dispatchUnderlingSiteCode != null and params.dispatchUnderlingSiteCode != ''">
and b.dispatch_underling_site_code= #{params.dispatchUnderlingSiteCode}
</if>
<if test="params.destinationCenterCode != null and params.destinationCenterCode != ''">
and b.destination_center_code= #{params.destinationCenterCode}
</if>
2024-07-18 02:13:14 +00:00
<if test="params.beginSendDate != null">
and b.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<if test="params.endSendDate != null ">
and b.send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
2024-07-21 02:14:08 +00:00
2024-07-21 02:41:25 +00:00
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
2024-07-18 02:13:14 +00:00
and (
2025-03-18 03:03:03 +00:00
b.dispatch_underling_site_code=#{params.privSiteCode}
2024-07-26 10:29:28 +00:00
or
2025-03-18 03:03:03 +00:00
b.send_site_code=#{params.privSiteCode}
2024-07-18 02:13:14 +00:00
)
</if>
)
2024-08-09 13:12:49 +00:00
and a.scan_type in('10','20','30','40','50','-1','80')
2024-07-18 02:13:14 +00:00
group by a.main_bill_code
</select>
2024-08-15 10:02:34 +00:00
<!--获取签收异常扫描统计数据-->
2024-09-07 14:16:35 +00:00
<!--and b.bill_code not in (
select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
)-->
2025-01-08 03:13:31 +00:00
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
select tbA.scan_site_code ,count(tbA.bill_code) as scan_count,sum(if(tbA.bl_sign=1,1,0)) as sign_count,round(round(ifnull(sum(if(tbA.bl_sign=1,1,0)),0)/count(tbA.bill_code),3)*100,1) as sign_rate
2024-06-19 18:22:32 +00:00
from (
2025-01-08 03:13:31 +00:00
select DISTINCT a.scan_site_code,b.bill_code , b.bl_sign
2024-06-19 18:22:32 +00:00
from emis_tms_scan_record a,emis_waybill b
2025-02-24 05:40:32 +00:00
where a.del_flag='0' and b.del_flag='0' and a.bill_code=b.bill_code
2025-01-08 03:13:31 +00:00
and not EXISTS (
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
)
and a.scan_type=#{scanType}
2024-08-15 11:15:43 +00:00
2025-01-08 03:13:31 +00:00
<if test="scanType != null and scanType == '20'">
and a.scan_site_code=b.send_site_code
</if>
2024-08-15 10:02:34 +00:00
2024-06-19 18:22:32 +00:00
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanManCode != null and scanManCode != ''"> and a.scan_man_code=#{scanManCode}</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">and a.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
<if test="params.endScanDate != null and params.endScanDate != ''">and a.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
2025-03-18 03:03:03 +00:00
and a.scan_site_code=#{params.privSiteCode}
2024-06-19 18:22:32 +00:00
</if>
2025-01-08 03:13:31 +00:00
) tbA
GROUP BY tbA.scan_site_code
2025-01-08 00:33:15 +00:00
</select>
2024-06-19 18:22:32 +00:00
<select id="queryScanStatRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
2025-01-08 03:48:57 +00:00
select a.main_bill_code AS bill_code,
a.main_bill_code,
a.bl_sub_bill,
a.scan_type,
scan_date AS scan_date,
a.pre_or_next_station,
a.pre_or_next_station_code,
a.scan_site,
a.scan_site_code,
a.scan_man,
a.scan_man_code
FROM
emis_tms_scan_record a ,emis_waybill b
WHERE
a.del_flag = '0' and b.del_flag='0'
2025-02-24 05:40:32 +00:00
and a.bill_code = b.bill_code
2025-01-08 03:48:57 +00:00
and b.bl_sign = '0'
2025-01-08 04:28:58 +00:00
and b.bill_code NOT IN ( SELECT bill_code FROM emis_waybill_problem_info ewpi WHERE ewpi.del_flag = '0' AND ewpi.`problem_type` IN ( 151, 173, 170 ) )
2025-01-08 03:48:57 +00:00
and a.scan_site_code=#{scanSiteCode}
and a.scan_type=#{scanType}
<if test="scanType != null and scanType == '20'">
and a.scan_site_code=b.send_site_code
</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanManCode != null and scanManCode != ''"> and a.scan_man_code=#{scanManCode}</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">and a.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
<if test="params.endScanDate != null and params.endScanDate != ''">and a.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
2024-08-15 10:02:34 +00:00
</select>
2024-06-01 22:27:44 +00:00
2024-06-02 01:10:24 +00:00
<!-- 获取订单最后一条扫描记录 -->
2024-06-21 13:30:56 +00:00
<select id="selectLastRecordBaseInfoByBillCode" parameterType="string" resultMap="BaseEmisTmsScanRecordResult">
2024-08-04 07:22:39 +00:00
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site
2024-05-23 05:17:45 +00:00
from emis_tms_scan_record a
2024-06-21 13:30:56 +00:00
where del_flag='0' and a.main_bill_code = #{billCode}
2024-06-11 12:51:40 +00:00
order by create_time desc limit 1
2024-05-23 05:17:45 +00:00
</select>
2024-10-07 11:23:42 +00:00
<!-- 获取订单最后一条扫描记录 -->
<select id="selectNormalLastScanRecord" parameterType="string" resultMap="BaseEmisTmsScanRecordResult">
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site
from emis_tms_scan_record a
where del_flag='0' and a.main_bill_code = #{billCode} and scan_type in('10','20','30','40','50')
order by create_time desc limit 1
</select>
2024-06-01 22:27:44 +00:00
<!-- 检查扫描唯一性 -->
<select id="checkSiteScanUnique" parameterType="EmisTmsScanRecord" resultType="int">
select count(1) from emis_tms_scan_record
2024-06-14 09:17:45 +00:00
where del_flag='0' and bill_code = #{billCode} and scan_type=#{scanType}
2024-06-01 22:27:44 +00:00
and scan_site_code=#{scanSiteCode}
2024-06-19 11:30:29 +00:00
and to_days(create_time) = to_days(now())
2024-06-01 22:27:44 +00:00
limit 1
</select>
2024-07-06 06:29:48 +00:00
<!-- 检查站点合包扫描是否合法 -->
<select id="checkSitePackScanUnique" parameterType="EmisTmsScanRecord" resultType="int">
select count(1) from emis_tms_scan_record
where del_flag='0' and bill_code = #{billCode} and scan_type=#{scanType}
and scan_site_code=#{scanSiteCode}
and to_days(create_time) = to_days(now())
limit 1
</select>
2024-06-19 00:16:23 +00:00
<!-- 根据主单获取物流轨迹 -->
2024-06-03 09:59:22 +00:00
<select id="selectTraceListByBillCode" parameterType="string" resultMap="EmisTmsScanRecordResult">
<include refid="selectEmisTmsScanRecordVo"/>
2024-06-21 13:00:31 +00:00
where del_flag='0' and bill_code = #{billCode}
2024-06-11 12:51:40 +00:00
order by create_time desc
2024-06-03 09:59:22 +00:00
</select>
2024-06-01 22:27:44 +00:00
<sql id="selectEmisTmsScanRecordVo">
2024-08-04 07:22:39 +00:00
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site from emis_tms_scan_record
2024-06-01 22:27:44 +00:00
</sql>
2024-03-01 09:13:00 +00:00
<select id="selectEmisTmsScanRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
2025-01-05 04:36:48 +00:00
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site
from emis_tms_scan_record a
2024-04-30 14:52:23 +00:00
<where>
2024-06-14 09:17:08 +00:00
del_flag='0'
2024-03-01 09:13:00 +00:00
<if test="id != null "> and id = #{id}</if>
2025-03-31 02:37:37 +00:00
<if test="orderSn != null and orderSn != ''">
and ( FIND_IN_SET(`order_sn`,#{orderSn}) or order_sn like concat('%', #{orderSn}, '%') )
</if>
2025-03-31 23:56:23 +00:00
2025-05-07 00:12:41 +00:00
<if test="billCode != null and billCode != '' and ( params.billCodeSortList == null or (params.billCodeSortList != null and params.billCodeSortList.size() == 1 ) )">
2025-03-31 23:39:12 +00:00
and `bill_code`=#{billCode}
</if>
2025-04-01 01:07:35 +00:00
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
2025-03-31 03:09:16 +00:00
and bill_code in
2025-03-31 23:39:12 +00:00
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
2025-03-31 02:37:37 +00:00
#{item}
</foreach>
2025-03-31 23:39:12 +00:00
</if>
2024-06-05 05:14:12 +00:00
2024-05-20 07:38:06 +00:00
<if test="scanType != null and scanType != ''"> and scan_type=#{scanType}</if>
2024-03-01 09:13:00 +00:00
<if test="preOrNextStation != null and preOrNextStation != ''"> and pre_or_next_station like concat('%', #{preOrNextStation}, '%')</if>
2024-06-01 23:39:21 +00:00
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and pre_or_next_station_code=#{preOrNextStationCode}</if>
2024-03-01 09:13:00 +00:00
<if test="preOrNextStationPhone != null and preOrNextStationPhone != ''"> and pre_or_next_station_phone like concat('%', #{preOrNextStationPhone}, '%')</if>
2024-06-01 23:39:21 +00:00
<if test="preOrNextManCode != null and preOrNextManCode != ''"> and pre_or_next_man_code=#{preOrNextManCode}</if>
2024-03-01 09:13:00 +00:00
<if test="preOrNextManPhone != null and preOrNextManPhone != ''"> and pre_or_next_man_phone like concat('%', #{preOrNextManPhone}, '%')</if>
2024-04-30 15:36:01 +00:00
<if test="scanDate != null "> and scan_date like concat('%', #{scanDate}, '%')</if>
2024-06-01 23:39:21 +00:00
<if test="scanManCode != null and scanManCode != ''"> and scan_man_code=#{scanManCode}</if>
2024-03-01 09:13:00 +00:00
<if test="scanManPhone != null and scanManPhone != ''"> and scan_man_phone like concat('%', #{scanManPhone}, '%')</if>
2024-04-30 15:36:01 +00:00
<if test="scanMan != null and scanMan != ''"> and scan_man like concat('%', #{scanMan}, '%')</if>
<if test="preOrNextMan != null and preOrNextMan != ''"> and pre_or_next_man like concat('%', #{preOrNextMan}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="scanSite != null and scanSite != ''"> and scan_site like concat('%', #{scanSite}, '%')</if>
2024-05-20 07:38:06 +00:00
<if test="scanSiteCode != null and scanSiteCode != ''"> and scan_site_code=#{scanSiteCode}</if>
2024-03-01 09:13:00 +00:00
<if test="scanSitePhone != null and scanSitePhone != ''"> and scan_site_phone like concat('%', #{scanSitePhone}, '%')</if>
2024-04-30 15:36:01 +00:00
<if test="scanWeight != null "> and scan_weight like concat('%', #{scanWeight}, '%')</if>
<if test="weight != null "> and weight like concat('%', #{weight}, '%')</if>
2024-05-10 08:40:04 +00:00
<if test="destSiteCode != null and destSiteCode != ''"> and dest_site_code like concat('%', #{destSiteCode}, '%')</if>
<if test="destCode != null and destCode != ''"> and dest_code like concat('%', #{destCode}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="dispatchOrSendMan != null and dispatchOrSendMan != ''"> and dispatch_or_send_man like concat('%', #{dispatchOrSendMan}, '%')</if>
<if test="dispatchOrSendManCode != null and dispatchOrSendManCode != ''"> and dispatch_or_send_man_code like concat('%', #{dispatchOrSendManCode}, '%')</if>
<if test="dispatchOrSendManPhone != null and dispatchOrSendManPhone != ''"> and dispatch_or_send_man_phone like concat('%', #{dispatchOrSendManPhone}, '%')</if>
<if test="signDate != null "> and sign_date = #{signDate}</if>
<if test="signMan != null and signMan != ''"> and sign_man like concat('%', #{signMan}, '%')</if>
<if test="signSite != null and signSite != ''"> and sign_site like concat('%', #{signSite}, '%')</if>
<if test="signSiteCode != null and signSiteCode != ''"> and sign_site_code like concat('%', #{signSiteCode}, '%')</if>
2024-04-30 15:36:01 +00:00
<if test="recordMan != null and recordMan != ''"> and record_man like concat('%', #{recordMan}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="recordManCode != null and recordManCode != ''"> and record_man_code like concat('%', #{recordManCode}, '%')</if>
<if test="recordManPhone != null and recordManPhone != ''"> and record_man_phone like concat('%', #{recordManPhone}, '%')</if>
<if test="recordSiteCode != null and recordSiteCode != ''"> and record_site_code like concat('%', #{recordSiteCode}, '%')</if>
2024-05-10 08:40:04 +00:00
<if test="carNo != null and carNo != ''"> and car_no like concat('%', #{carNo}, '%')</if>
<if test="bagNo != null and bagNo != ''"> and bag_no like concat('%', #{bagNo}, '%')</if>
2024-03-01 09:13:00 +00:00
<if test="truckMan != null and truckMan != ''"> and truck_man like concat('%', #{truckMan}, '%')</if>
<if test="truckCode != null and truckCode != ''"> and truck_code like concat('%', #{truckCode}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="picUrl != null and picUrl != ''"> and pic_url like concat('%', #{picUrl}, '%')</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
2024-04-30 14:52:23 +00:00
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
2024-05-10 08:40:04 +00:00
<if test="params.beginScanDate != null and params.beginScanDate != ''">
2024-06-19 00:16:23 +00:00
and scan_date <![CDATA[ >= ]]> #{params.beginScanDate}
2024-05-10 08:40:04 +00:00
</if>
<if test="params.endScanDate != null and params.endScanDate != ''">
2024-06-19 00:16:23 +00:00
and scan_date <![CDATA[ <= ]]> #{params.endScanDate}
2024-05-10 08:40:04 +00:00
</if>
2024-06-19 00:16:23 +00:00
2024-06-19 00:29:00 +00:00
2024-06-03 03:10:46 +00:00
<if test="params.beginSignDate != null and params.beginSignDate != ''">
and sign_date <![CDATA[ >= ]]> #{params.beginSignDate}
</if>
<if test="params.endSignDate != null and params.endSignDate != ''">
2024-06-03 03:46:38 +00:00
and sign_date <![CDATA[ <= ]]> #{params.endSignDate}
2024-05-10 08:40:04 +00:00
</if>
2024-06-19 13:26:27 +00:00
<if test="params.isUploadPic != null and params.isUploadPic == 1 ">
2024-06-05 06:28:21 +00:00
and pic_url is not null
</if>
2024-06-03 03:15:39 +00:00
2024-06-19 13:26:27 +00:00
<if test="params.isUploadPic != null and params.isUploadPic == 0 ">
2024-06-05 06:28:21 +00:00
and pic_url is null
</if>
2024-06-03 03:15:39 +00:00
2024-06-21 13:00:31 +00:00
<if test="blSubBill != null and blSubBill == 1 ">
and bl_sub_bill='1'
</if>
<if test="blSubBill != null and blSubBill == 0 ">
and bl_sub_bill='0'
</if>
<if test="params.blSubBill != null and params.blSubBill == 1 ">
and bl_sub_bill='1'
</if>
<if test="params.blSubBill != null and params.blSubBill == 0 ">
and bl_sub_bill='0'
</if>
2024-10-07 02:03:50 +00:00
<if test="params.scanQueryType != null and params.scanQueryType == 1 ">
and scan_type not in('50','51','-1')
</if>
2024-06-13 00:22:11 +00:00
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
2025-03-18 03:03:03 +00:00
and scan_site_code=#{params.privSiteCode}
2024-06-03 03:46:38 +00:00
</if>
2024-06-03 03:15:39 +00:00
2024-03-01 09:13:00 +00:00
</where>
2024-06-03 05:00:23 +00:00
ORDER BY
<if test="params.orderSnSortList != null and params.orderSnSortList.size >0 ">
FIELD
<foreach collection="params.orderSnSortList" item="item" open="(order_sn," separator="," close=")">
#{item}
</foreach>
,
</if>
2025-04-01 01:17:52 +00:00
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 0 ">
2024-06-03 05:00:23 +00:00
FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
#{item}
</foreach>
,
</if>
2024-08-04 03:40:15 +00:00
scan_date desc
2024-03-01 09:13:00 +00:00
</select>
2024-04-30 14:52:23 +00:00
2024-06-19 00:29:00 +00:00
2025-01-05 04:36:48 +00:00
<select id="selectMonitorScanRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site
from emis_tms_scan_record a
<where>
del_flag='0'
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanDate != null "> and scan_date like concat('%', #{scanDate}, '%')</if>
<if test="scanSiteCode != null and scanSiteCode != ''"> and scan_site_code=#{scanSiteCode}</if>
<if test="destSiteCode != null and destSiteCode != ''"> and dest_site_code=#{destSiteCode}</if>
<if test="destCode != null and destCode != ''"> and dest_code like concat('%', #{destCode}, '%')</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">
and scan_date <![CDATA[ >= ]]> #{params.beginScanDate}
</if>
<if test="params.endScanDate != null and params.endScanDate != ''">
and scan_date <![CDATA[ <= ]]> #{params.endScanDate}
</if>
and EXISTS(
select 1 from emis_waybill ewb
where
ewb.del_flag='0' and ewb.order_status !='0'
and a.main_bill_code=ewb.bill_code
2025-01-05 04:38:02 +00:00
and not EXISTS (
2025-01-05 04:36:48 +00:00
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=ewb.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
)
<if test="params.dispatchUnderlingSiteCode != null and params.dispatchUnderlingSiteCode != ''">
and ewb.dispatch_underling_site_code= #{params.dispatchUnderlingSiteCode}
</if>
<if test="params.transLineType != null and params.transLineType != ''">
and ewb.trans_line_type=#{params.transLineType}
</if>
<if test="params.productType != null and params.productType != ''">
and ewb.product_type=#{params.productType}
</if>
)
<!-- 有发未到 -->
<if test="params.queryHasSendNotArrive != null and params.queryHasSendNotArrive == 1 ">
and scan_type='20'
2025-01-11 11:27:29 +00:00
and main_bill_code not in(
2025-01-15 11:01:32 +00:00
select main_bill_code from emis_tms_scan_record b where b.del_flag='0' and b.scan_type='30' and b.scan_date >= a.scan_date
2025-01-05 04:36:48 +00:00
)
</if>
<!-- 有到未发 -->
<if test="params.queryHasArriveNotSend != null and params.queryHasArriveNotSend == 1 ">
and scan_type='30'
2025-01-11 11:27:29 +00:00
and main_bill_code not in(
2025-01-15 11:01:32 +00:00
select main_bill_code from emis_tms_scan_record b where b.del_flag='0' and b.scan_type='20' and b.scan_date >= a.scan_date
2025-01-05 04:36:48 +00:00
)
</if>
</where>
ORDER BY scan_date desc
</select>
2024-06-21 13:00:31 +00:00
<!--快件跟踪服务查询,没有权限限制-->
<select id="queryScanWaybillList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
select distinct bill_code, main_bill_code
from emis_tms_scan_record a
<where>
del_flag='0'
2025-04-01 01:14:00 +00:00
<if test="billCode != null and billCode != '' and params.billCodeSortList==null ">
2025-04-01 01:20:40 +00:00
and bill_code=#{billCode}
2025-04-01 01:14:00 +00:00
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
2025-03-31 02:52:07 +00:00
and bill_code in
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
2024-06-21 13:00:31 +00:00
</if>
2025-04-01 01:14:00 +00:00
2024-06-21 13:34:04 +00:00
<if test="blSubBill != null and blSubBill == 1 ">
2025-04-01 01:14:00 +00:00
<if test="billCode != null and billCode != '' and params.billCodeSortList==null ">
2025-04-01 01:20:40 +00:00
and main_bill_code=#{billCode}
2025-04-01 01:14:00 +00:00
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
and main_bill_code in
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
2024-06-21 13:00:31 +00:00
</if>
2024-06-21 13:34:04 +00:00
2024-06-21 13:00:31 +00:00
</where>
ORDER BY
<if test="params.orderSnSortList != null and params.orderSnSortList.size >0 ">
FIELD
<foreach collection="params.orderSnSortList" item="item" open="(order_sn," separator="," close=")">
#{item}
</foreach>
,
</if>
2025-04-01 01:17:52 +00:00
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 0 ">
2024-06-21 13:00:31 +00:00
FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
#{item}
</foreach>
,
</if>
2024-06-21 13:30:56 +00:00
bl_sub_bill asc
2024-06-21 13:00:31 +00:00
</select>
2024-06-19 00:29:00 +00:00
2024-05-10 09:13:02 +00:00
2024-03-01 09:13:00 +00:00
<select id="selectEmisTmsScanRecordById" parameterType="Long" resultMap="EmisTmsScanRecordResult">
2024-08-04 07:22:39 +00:00
select id, bill_code, main_bill_code, bl_sub_bill, order_sn, scan_type, pre_or_next_station, pre_or_next_station_code, pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, scan_date, scan_man_code, scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone, scan_weight, weight, dest_site_code, dest_code, dispatch_or_send_man, dispatch_or_send_man_code, dispatch_or_send_man_phone, sign_date, sign_man, sign_site, sign_site_code, record_man, record_man_code, record_man_phone, record_site_code, car_no, bag_no, truck_man, truck_code, data_from, pic_url, public_trace_info, inner_trace_info, rel_id, status, del_flag, create_by, create_time, update_by, update_time, remark, update_site, create_site
2024-03-01 09:13:00 +00:00
from emis_tms_scan_record a
where a.id = #{id}
</select>
2024-04-30 14:52:23 +00:00
2024-06-03 09:59:22 +00:00
<insert id="insertEmisTmsScanRecord" parameterType="EmisTmsScanRecord" useGeneratedKeys="true" keyProperty="id">
2024-03-01 09:13:00 +00:00
insert into emis_tms_scan_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
2024-06-18 07:15:28 +00:00
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code,</if>
2024-06-21 13:00:31 +00:00
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill,</if>
2024-05-10 08:40:04 +00:00
<if test="orderSn != null and orderSn != ''">order_sn,</if>
2024-03-01 09:13:00 +00:00
<if test="scanType != null and scanType != ''">scan_type,</if>
<if test="preOrNextStation != null and preOrNextStation != ''">pre_or_next_station,</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''">pre_or_next_station_code,</if>
<if test="preOrNextStationPhone != null and preOrNextStationPhone != ''">pre_or_next_station_phone,</if>
<if test="preOrNextManCode != null and preOrNextManCode != ''">pre_or_next_man_code,</if>
<if test="preOrNextManPhone != null and preOrNextManPhone != ''">pre_or_next_man_phone,</if>
2024-04-30 15:36:01 +00:00
<if test="scanDate != null">scan_date,</if>
2024-03-01 09:13:00 +00:00
<if test="scanManCode != null and scanManCode != ''">scan_man_code,</if>
<if test="scanManPhone != null and scanManPhone != ''">scan_man_phone,</if>
2024-04-30 15:36:01 +00:00
<if test="scanMan != null and scanMan != ''">scan_man,</if>
<if test="preOrNextMan != null and preOrNextMan != ''">pre_or_next_man,</if>
2024-03-01 09:13:00 +00:00
<if test="scanSite != null and scanSite != ''">scan_site,</if>
<if test="scanSiteCode != null and scanSiteCode != ''">scan_site_code,</if>
<if test="scanSitePhone != null and scanSitePhone != ''">scan_site_phone,</if>
2024-04-30 15:36:01 +00:00
<if test="scanWeight != null">scan_weight,</if>
<if test="weight != null">weight,</if>
2024-05-10 08:40:04 +00:00
<if test="destSiteCode != null and destSiteCode != ''">dest_site_code,</if>
<if test="destCode != null and destCode != ''">dest_code,</if>
2024-03-01 09:13:00 +00:00
<if test="dispatchOrSendMan != null and dispatchOrSendMan != ''">dispatch_or_send_man,</if>
<if test="dispatchOrSendManCode != null and dispatchOrSendManCode != ''">dispatch_or_send_man_code,</if>
<if test="dispatchOrSendManPhone != null and dispatchOrSendManPhone != ''">dispatch_or_send_man_phone,</if>
<if test="signDate != null">sign_date,</if>
<if test="signMan != null and signMan != ''">sign_man,</if>
<if test="signSite != null and signSite != ''">sign_site,</if>
<if test="signSiteCode != null and signSiteCode != ''">sign_site_code,</if>
2024-04-30 15:36:01 +00:00
<if test="recordMan != null and recordMan != ''">record_man,</if>
2024-03-01 09:13:00 +00:00
<if test="recordManCode != null and recordManCode != ''">record_man_code,</if>
<if test="recordManPhone != null and recordManPhone != ''">record_man_phone,</if>
<if test="recordSiteCode != null and recordSiteCode != ''">record_site_code,</if>
2024-05-10 08:40:04 +00:00
<if test="carNo != null and carNo != ''">car_no,</if>
<if test="bagNo != null and bagNo != ''">bag_no,</if>
2024-03-01 09:13:00 +00:00
<if test="truckMan != null and truckMan != ''">truck_man,</if>
<if test="truckCode != null and truckCode != ''">truck_code,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
<if test="picUrl != null and picUrl != ''">pic_url,</if>
2024-06-03 09:59:22 +00:00
<if test="publicTraceInfo != null and publicTraceInfo != ''">public_trace_info,</if>
<if test="innerTraceInfo != null and innerTraceInfo != ''">inner_trace_info,</if>
2024-08-04 07:22:39 +00:00
<if test="relId != null and relId != ''">rel_id,</if>
2024-03-01 09:13:00 +00:00
<if test="status != null and status != ''">status,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
2024-04-30 14:52:23 +00:00
<if test="updateSite != null and updateSite != ''">update_site,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
</trim>
2024-03-01 09:13:00 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="billCode != null and billCode != ''">#{billCode},</if>
2024-06-18 07:15:28 +00:00
<if test="mainBillCode != null and mainBillCode != ''">#{mainBillCode},</if>
2024-06-21 13:00:31 +00:00
<if test="blSubBill != null and blSubBill != ''">#{blSubBill},</if>
2024-05-10 08:40:04 +00:00
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
2024-03-01 09:13:00 +00:00
<if test="scanType != null and scanType != ''">#{scanType},</if>
<if test="preOrNextStation != null and preOrNextStation != ''">#{preOrNextStation},</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''">#{preOrNextStationCode},</if>
<if test="preOrNextStationPhone != null and preOrNextStationPhone != ''">#{preOrNextStationPhone},</if>
<if test="preOrNextManCode != null and preOrNextManCode != ''">#{preOrNextManCode},</if>
<if test="preOrNextManPhone != null and preOrNextManPhone != ''">#{preOrNextManPhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanDate != null">#{scanDate},</if>
2024-03-01 09:13:00 +00:00
<if test="scanManCode != null and scanManCode != ''">#{scanManCode},</if>
<if test="scanManPhone != null and scanManPhone != ''">#{scanManPhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanMan != null and scanMan != ''">#{scanMan},</if>
<if test="preOrNextMan != null and preOrNextMan != ''">#{preOrNextMan},</if>
2024-03-01 09:13:00 +00:00
<if test="scanSite != null and scanSite != ''">#{scanSite},</if>
<if test="scanSiteCode != null and scanSiteCode != ''">#{scanSiteCode},</if>
<if test="scanSitePhone != null and scanSitePhone != ''">#{scanSitePhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanWeight != null">#{scanWeight},</if>
<if test="weight != null">#{weight},</if>
2024-05-10 08:40:04 +00:00
<if test="destSiteCode != null and destSiteCode != ''">#{destSiteCode},</if>
<if test="destCode != null and destCode != ''">#{destCode},</if>
2024-03-01 09:13:00 +00:00
<if test="dispatchOrSendMan != null and dispatchOrSendMan != ''">#{dispatchOrSendMan},</if>
<if test="dispatchOrSendManCode != null and dispatchOrSendManCode != ''">#{dispatchOrSendManCode},</if>
<if test="dispatchOrSendManPhone != null and dispatchOrSendManPhone != ''">#{dispatchOrSendManPhone},</if>
<if test="signDate != null">#{signDate},</if>
<if test="signMan != null and signMan != ''">#{signMan},</if>
<if test="signSite != null and signSite != ''">#{signSite},</if>
<if test="signSiteCode != null and signSiteCode != ''">#{signSiteCode},</if>
2024-04-30 15:36:01 +00:00
<if test="recordMan != null and recordMan != ''">#{recordMan},</if>
2024-03-01 09:13:00 +00:00
<if test="recordManCode != null and recordManCode != ''">#{recordManCode},</if>
<if test="recordManPhone != null and recordManPhone != ''">#{recordManPhone},</if>
<if test="recordSiteCode != null and recordSiteCode != ''">#{recordSiteCode},</if>
2024-05-10 08:40:04 +00:00
<if test="carNo != null and carNo != ''">#{carNo},</if>
<if test="bagNo != null and bagNo != ''">#{bagNo},</if>
2024-03-01 09:13:00 +00:00
<if test="truckMan != null and truckMan != ''">#{truckMan},</if>
<if test="truckCode != null and truckCode != ''">#{truckCode},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
<if test="picUrl != null and picUrl != ''">#{picUrl},</if>
2024-06-03 09:59:22 +00:00
<if test="publicTraceInfo != null and publicTraceInfo != ''">#{publicTraceInfo},</if>
<if test="innerTraceInfo != null and innerTraceInfo != ''">#{innerTraceInfo},</if>
2024-08-04 07:22:39 +00:00
<if test="relId != null and relId != ''">#{relId},</if>
2024-03-01 09:13:00 +00:00
<if test="status != null and status != ''">#{status},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
2024-04-30 14:52:23 +00:00
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
</trim>
2024-03-01 09:13:00 +00:00
</insert>
<update id="updateEmisTmsScanRecord" parameterType="EmisTmsScanRecord">
update emis_tms_scan_record
<trim prefix="SET" suffixOverrides=",">
2024-06-21 13:00:31 +00:00
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code = #{mainBillCode},</if>
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill = #{blSubBill},</if>
<if test="orderSn != null and orderSn != ''">order_sn = #{orderSn},</if>
2024-03-01 09:13:00 +00:00
<if test="scanType != null and scanType != ''">scan_type = #{scanType},</if>
<if test="preOrNextStation != null and preOrNextStation != ''">pre_or_next_station = #{preOrNextStation},</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''">pre_or_next_station_code = #{preOrNextStationCode},</if>
<if test="preOrNextStationPhone != null and preOrNextStationPhone != ''">pre_or_next_station_phone = #{preOrNextStationPhone},</if>
<if test="preOrNextManCode != null and preOrNextManCode != ''">pre_or_next_man_code = #{preOrNextManCode},</if>
<if test="preOrNextManPhone != null and preOrNextManPhone != ''">pre_or_next_man_phone = #{preOrNextManPhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanDate != null">scan_date = #{scanDate},</if>
2024-03-01 09:13:00 +00:00
<if test="scanManCode != null and scanManCode != ''">scan_man_code = #{scanManCode},</if>
<if test="scanManPhone != null and scanManPhone != ''">scan_man_phone = #{scanManPhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanMan != null and scanMan != ''">scan_man = #{scanMan},</if>
<if test="preOrNextMan != null and preOrNextMan != ''">pre_or_next_man = #{preOrNextMan},</if>
2024-03-01 09:13:00 +00:00
<if test="scanSite != null and scanSite != ''">scan_site = #{scanSite},</if>
<if test="scanSiteCode != null and scanSiteCode != ''">scan_site_code = #{scanSiteCode},</if>
<if test="scanSitePhone != null and scanSitePhone != ''">scan_site_phone = #{scanSitePhone},</if>
2024-04-30 15:36:01 +00:00
<if test="scanWeight != null">scan_weight = #{scanWeight},</if>
<if test="weight != null">weight = #{weight},</if>
2024-05-10 08:40:04 +00:00
<if test="destSiteCode != null and destSiteCode != ''">dest_site_code = #{destSiteCode},</if>
<if test="destCode != null and destCode != ''">dest_code = #{destCode},</if>
2024-03-01 09:13:00 +00:00
<if test="dispatchOrSendMan != null and dispatchOrSendMan != ''">dispatch_or_send_man = #{dispatchOrSendMan},</if>
<if test="dispatchOrSendManCode != null and dispatchOrSendManCode != ''">dispatch_or_send_man_code = #{dispatchOrSendManCode},</if>
<if test="dispatchOrSendManPhone != null and dispatchOrSendManPhone != ''">dispatch_or_send_man_phone = #{dispatchOrSendManPhone},</if>
<if test="signDate != null">sign_date = #{signDate},</if>
<if test="signMan != null and signMan != ''">sign_man = #{signMan},</if>
<if test="signSite != null and signSite != ''">sign_site = #{signSite},</if>
<if test="signSiteCode != null and signSiteCode != ''">sign_site_code = #{signSiteCode},</if>
2024-04-30 15:36:01 +00:00
<if test="recordMan != null and recordMan != ''">record_man = #{recordMan},</if>
2024-03-01 09:13:00 +00:00
<if test="recordManCode != null and recordManCode != ''">record_man_code = #{recordManCode},</if>
<if test="recordManPhone != null and recordManPhone != ''">record_man_phone = #{recordManPhone},</if>
<if test="recordSiteCode != null and recordSiteCode != ''">record_site_code = #{recordSiteCode},</if>
2024-05-10 08:40:04 +00:00
<if test="carNo != null and carNo != ''">car_no = #{carNo},</if>
<if test="bagNo != null and bagNo != ''">bag_no = #{bagNo},</if>
2024-03-01 09:13:00 +00:00
<if test="truckMan != null and truckMan != ''">truck_man = #{truckMan},</if>
<if test="truckCode != null and truckCode != ''">truck_code = #{truckCode},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="picUrl != null and picUrl != ''">pic_url = #{picUrl},</if>
2024-06-03 09:59:22 +00:00
<if test="publicTraceInfo != null and publicTraceInfo != ''">public_trace_info = #{publicTraceInfo},</if>
<if test="innerTraceInfo != null and innerTraceInfo != ''">inner_trace_info = #{innerTraceInfo},</if>
2024-08-04 07:22:39 +00:00
<if test="relId != null and relId != ''">rel_id = #{relId},</if>
2024-03-01 09:13:00 +00:00
<if test="status != null and status != ''">status = #{status},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
2024-04-30 14:52:23 +00:00
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
2024-03-01 09:13:00 +00:00
</trim>
where id = #{id}
</update>
2024-08-17 11:58:12 +00:00
<delete id="deleteTransferScanRecord" parameterType="String">
update emis_tms_scan_record set del_flag='1' where scan_type='80' and main_bill_code=#{billCode}
</delete>
2024-08-04 07:22:39 +00:00
<delete id="deletePromScanRecord" parameterType="String">
2024-09-06 08:51:55 +00:00
update emis_tms_scan_record set del_flag='1' where scan_type='-1' and main_bill_code=#{billCode} and rel_id=#{promId}
2024-08-04 07:22:39 +00:00
</delete>
2024-06-18 07:15:28 +00:00
2024-03-01 09:13:00 +00:00
<delete id="deleteEmisTmsScanRecordById" parameterType="Long">
2024-05-20 07:38:06 +00:00
update emis_tms_scan_record set del_flag='1' where id = #{id}
2024-03-01 09:13:00 +00:00
</delete>
<delete id="deleteEmisTmsScanRecordByIds" parameterType="String">
2024-05-20 07:38:06 +00:00
update emis_tms_scan_record set del_flag='1' where id in
2024-03-01 09:13:00 +00:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
2024-05-21 14:21:12 +00:00
2024-03-01 09:13:00 +00:00
</mapper>