From 4f7d8924b8c5f4f019b16a8563e30c48abef441e Mon Sep 17 00:00:00 2001 From: sen <sen@qq.com> Date: 星期一, 01 九月 2025 13:30:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/yagwly_fa_master' into yagwly_fa_master --- service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 264 insertions(+), 0 deletions(-) diff --git a/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml b/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml new file mode 100644 index 0000000..85a9bd2 --- /dev/null +++ b/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml @@ -0,0 +1,264 @@ +<?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.ruoyi.cwgl.mapper.KeyCollectionInfoMapper"> + + <resultMap type="com.ruoyi.cwgl.domain.KeyCollectionInfo" id="KeyCollectionInfoResult"> + <result property="id" column="id" /> + <result property="customerName" column="customer_name" /> + <result property="carrier" column="carrier" /> + <result property="dispatchNo" column="dispatch_no" /> + <result property="driverName" column="driver_name" /> + <result property="driverMobile" column="driver_mobile" /> + <result property="licensePlateNumber" column="license_plate_number" /> + <result property="orderTime" column="order_time" /> + <result property="orderCreatedTime" column="order_created_time" /> + <result property="dispatchCreatedTime" column="dispatch_created_time" /> + <result property="keyCollectionTime" column="key_collection_time" /> + <result property="estimatedDepartureTime" column="estimated_departure_time" /> + <result property="requiredArrivalTime" column="required_arrival_time" /> + <result property="consignorAddress" column="consignor_address" /> + <result property="consigneeAddress" column="consignee_address" /> + <result property="mainDriver" column="main_driver" /> + <result property="pointNum" column="point_num" /> + <result property="transportMode" column="transport_mode" /> + <result property="assistantDriver" column="assistant_driver" /> + <result property="quantity" column="quantity" /> + <result property="dispatchQuantity" column="dispatch_quantity" /> + <result property="remark" column="remark" /> + </resultMap> + + <sql id="selectKeyCollectionInfoVo"> + select thisTab.id, thisTab.customer_name, thisTab.carrier, thisTab.dispatch_no, thisTab.driver_name, thisTab.driver_mobile, thisTab.license_plate_number, thisTab.order_time, thisTab.order_created_time, thisTab.dispatch_created_time, thisTab.key_collection_time, thisTab.estimated_departure_time, thisTab.required_arrival_time, thisTab.consignor_address, thisTab.consignee_address, thisTab.main_driver, thisTab.point_num, thisTab.transport_mode, thisTab.assistant_driver, thisTab.quantity, thisTab.dispatch_quantity, thisTab.remark from key_collection_info AS thisTab + </sql> + <sql id="selectKeyCollectionInfoVoCount"> + select count(0) from key_collection_info as thisTab + </sql> + + <sql id="whereCondition"> + <if test="customerName != null and customerName != ''"> and thisTab.customer_name like concat('%', #{customerName}, '%')</if> + <if test="carrier != null and carrier != ''"> and thisTab.carrier = #{carrier}</if> + <if test="dispatchNo != null and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if> + <if test="driverName != null and driverName != ''"> and thisTab.driver_name like concat('%', #{driverName}, '%')</if> + <if test="driverMobile != null and driverMobile != ''"> and thisTab.driver_mobile = #{driverMobile}</if> + <if test="licensePlateNumber != null and licensePlateNumber != ''"> and thisTab.license_plate_number = #{licensePlateNumber}</if> + <if test="orderTime != null "> and thisTab.order_time = #{orderTime}</if> + <if test="orderCreatedTime != null "> and thisTab.order_created_time = #{orderCreatedTime}</if> + <if test="dispatchCreatedTime != null "> and thisTab.dispatch_created_time = #{dispatchCreatedTime}</if> + <if test="keyCollectionTime != null "> and thisTab.key_collection_time = #{keyCollectionTime}</if> + <if test="estimatedDepartureTime != null "> and thisTab.estimated_departure_time = #{estimatedDepartureTime}</if> + <if test="requiredArrivalTime != null "> and thisTab.required_arrival_time = #{requiredArrivalTime}</if> + <if test="consignorAddress != null and consignorAddress != ''"> and thisTab.consignor_address = #{consignorAddress}</if> + <if test="consigneeAddress != null and consigneeAddress != ''"> and thisTab.consignee_address = #{consigneeAddress}</if> + <if test="mainDriver != null and mainDriver != ''"> and thisTab.main_driver = #{mainDriver}</if> + <if test="pointNum != null "> and thisTab.point_num = #{pointNum}</if> + <if test="transportMode != null and transportMode != ''"> and thisTab.transport_mode = #{transportMode}</if> + <if test="assistantDriver != null and assistantDriver != ''"> and thisTab.assistant_driver = #{assistantDriver}</if> + <if test="quantity != null "> and thisTab.quantity = #{quantity}</if> + <if test="dispatchQuantity != null "> and thisTab.dispatch_quantity = #{dispatchQuantity}</if> + </sql> + + <!--鏌ヨ--> + <select id="selectKeyCollectionInfoById" parameterType="Integer" resultMap="KeyCollectionInfoResult"> + <include refid="selectKeyCollectionInfoVo"/> + where id = #{id} + </select> + + <select id="selectKeyCollectionInfoCount" parameterType="com.ruoyi.cwgl.domain.KeyCollectionInfo" resultType="int"> + <include refid="selectKeyCollectionInfoVoCount"/> + <where> + <include refid="whereCondition"/> + </where> + </select> + + <select id="selectKeyCollectionInfoList" parameterType="com.ruoyi.cwgl.domain.KeyCollectionInfo" resultMap="KeyCollectionInfoResult"> + <include refid="selectKeyCollectionInfoVo"/> + <where> + <include refid="whereCondition"/> + </where> + order by thisTab.id desc + </select> + <select id="selectCwData" resultType="com.ruoyi.cwgl.domain.KeyCollectionInfo"> +SELECT + customer.`NAME` as customerName, + bp.`NAME` as carrier, + ts.DISPATCH_NO as dispatchNo, + driver_m.`NAME` as driverName, + driver_m.MOBILE as driverMobile, + vhc.LICENSE_PLATE_NUMBER as licensePlateNumber, + ord.ORDER_TIME as orderTime, + ord.CREATED_TIME as orderCreatedTime, + ts.CREATED_TIME as dispatchCreatedTime, + now() as keyCollectionTime, -- 鏀捐姹傛煡璇㈠埌鐨勬椂闂� + ord.ESTIMATED_DEPARTURE_TIME as estimatedDepartureTime, + ord.CONSIGNOR_ADDRESS_ADDR_INFO as consignorAddress, + ord.CONSIGNEE_ADDRESS_ADDR_INFO as consigneeAddress, + driver_m.`NAME` as mainDriver, + ts.POINT_NUM as pointNum, + ts.TRANSPORT_MODE as transportMode, + driver_a.`NAME` as assistantDriver, + ts.QUANTITY as quantity, + ts.REQUIRED_ARRIVAL_TIME as , + ts.DISPATCH_QUANTITY as dispatchQuantity, + ts.REMARK as remark, + TIMESTAMPDIFF(HOUR, ord.ORDER_TIME, ord.CREATED_TIME) as schedulingTimeout, + TIMESTAMPDIFF(HOUR, ord.ESTIMATED_DEPARTURE_TIME, NOW()) as keyTimeout + +FROM + tms_shipment ts + left JOIN oms_order ord ON ts.DISPATCH_NO = ord.DISPATCH_CODE + LEFT JOIN base_customer customer ON customer.ID = ord.CUSTOMER_ID + LEFT JOIN tms_vehicle vhc ON ts.VEHICLE_ID = vhc.id + LEFT JOIN base_provider bp ON bp.ID = ts.CARRIER_ID + LEFT JOIN tms_driver driver_m ON driver_m.ID = ts.MAIN_DRIVER_ID + LEFT JOIN tms_driver driver_a ON driver_a.ID = ts.ASSISTANT_DRIVER_ID +WHERE + ts.`STATUS` = 'A' + <if test="driverCode != null and driverCode != '' "> + and driver_m.MOBILE = #{driverCode} + </if> + <if test="driverName != null and driverName != ''"> + and driver_m.NAME = #{driverName} + </if> +ORDER BY ord.ESTIMATED_DEPARTURE_TIME asc +LIMIT 1 + + + + </select> + + <!-- 鏂板 --> + <insert id="insertKeyCollectionInfo" parameterType="com.ruoyi.cwgl.domain.KeyCollectionInfo" useGeneratedKeys="true" keyProperty="id"> + insert into key_collection_info + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="customerName != null">customer_name,</if> + <if test="carrier != null">carrier,</if> + <if test="dispatchNo != null">dispatch_no,</if> + <if test="driverName != null">driver_name,</if> + <if test="driverMobile != null">driver_mobile,</if> + <if test="licensePlateNumber != null">license_plate_number,</if> + <if test="orderTime != null">order_time,</if> + <if test="orderCreatedTime != null">order_created_time,</if> + <if test="dispatchCreatedTime != null">dispatch_created_time,</if> + <if test="keyCollectionTime != null">key_collection_time,</if> + <if test="estimatedDepartureTime != null">estimated_departure_time,</if> + <if test="requiredArrivalTime != null">required_arrival_time,</if> + <if test="consignorAddress != null">consignor_address,</if> + <if test="consigneeAddress != null">consignee_address,</if> + <if test="mainDriver != null">main_driver,</if> + <if test="pointNum != null">point_num,</if> + <if test="transportMode != null">transport_mode,</if> + <if test="assistantDriver != null">assistant_driver,</if> + <if test="quantity != null">quantity,</if> + <if test="dispatchQuantity != null">dispatch_quantity,</if> + <if test="remark != null">remark,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="customerName != null">#{customerName},</if> + <if test="carrier != null">#{carrier},</if> + <if test="dispatchNo != null">#{dispatchNo},</if> + <if test="driverName != null">#{driverName},</if> + <if test="driverMobile != null">#{driverMobile},</if> + <if test="licensePlateNumber != null">#{licensePlateNumber},</if> + <if test="orderTime != null">#{orderTime},</if> + <if test="orderCreatedTime != null">#{orderCreatedTime},</if> + <if test="dispatchCreatedTime != null">#{dispatchCreatedTime},</if> + <if test="keyCollectionTime != null">#{keyCollectionTime},</if> + <if test="estimatedDepartureTime != null">#{estimatedDepartureTime},</if> + <if test="requiredArrivalTime != null">#{requiredArrivalTime},</if> + <if test="consignorAddress != null">#{consignorAddress},</if> + <if test="consigneeAddress != null">#{consigneeAddress},</if> + <if test="mainDriver != null">#{mainDriver},</if> + <if test="pointNum != null">#{pointNum},</if> + <if test="transportMode != null">#{transportMode},</if> + <if test="assistantDriver != null">#{assistantDriver},</if> + <if test="quantity != null">#{quantity},</if> + <if test="dispatchQuantity != null">#{dispatchQuantity},</if> + <if test="remark != null">#{remark},</if> + </trim> + </insert> + + <insert id="insertKeyCollectionInfoBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> + insert into key_collection_info + <trim prefix="(" suffix=") values" suffixOverrides=","> + id,customer_name,carrier,dispatch_no,driver_name,driver_mobile,license_plate_number,order_time,order_created_time,dispatch_created_time,key_collection_time,estimated_departure_time,required_arrival_time,consignor_address,consignee_address,main_driver,point_num,transport_mode,assistant_driver,quantity,dispatch_quantity,remark, + </trim> + <foreach item="item" index="index" collection="list" separator=","> + <trim prefix="(" suffix=") " suffixOverrides=","> + #{item.id},#{item.customerName},#{item.carrier},#{item.dispatchNo},#{item.driverName},#{item.driverMobile},#{item.licensePlateNumber},#{item.orderTime},#{item.orderCreatedTime},#{item.dispatchCreatedTime},#{item.keyCollectionTime},#{item.estimatedDepartureTime},#{item.requiredArrivalTime},#{item.consignorAddress},#{item.consigneeAddress},#{item.mainDriver},#{item.pointNum},#{item.transportMode},#{item.assistantDriver},#{item.quantity},#{item.dispatchQuantity},#{item.remark}, + </trim> + </foreach> + </insert> + + <!-- 淇敼 --> + <update id="updateKeyCollectionInfo" parameterType="com.ruoyi.cwgl.domain.KeyCollectionInfo"> + update key_collection_info + <trim prefix="SET" suffixOverrides=","> + <if test="customerName != null">customer_name = #{customerName},</if> + <if test="carrier != null">carrier = #{carrier},</if> + <if test="dispatchNo != null">dispatch_no = #{dispatchNo},</if> + <if test="driverName != null">driver_name = #{driverName},</if> + <if test="driverMobile != null">driver_mobile = #{driverMobile},</if> + <if test="licensePlateNumber != null">license_plate_number = #{licensePlateNumber},</if> + <if test="orderTime != null">order_time = #{orderTime},</if> + <if test="orderCreatedTime != null">order_created_time = #{orderCreatedTime},</if> + <if test="dispatchCreatedTime != null">dispatch_created_time = #{dispatchCreatedTime},</if> + <if test="keyCollectionTime != null">key_collection_time = #{keyCollectionTime},</if> + <if test="estimatedDepartureTime != null">estimated_departure_time = #{estimatedDepartureTime},</if> + <if test="requiredArrivalTime != null">required_arrival_time = #{requiredArrivalTime},</if> + <if test="consignorAddress != null">consignor_address = #{consignorAddress},</if> + <if test="consigneeAddress != null">consignee_address = #{consigneeAddress},</if> + <if test="mainDriver != null">main_driver = #{mainDriver},</if> + <if test="pointNum != null">point_num = #{pointNum},</if> + <if test="transportMode != null">transport_mode = #{transportMode},</if> + <if test="assistantDriver != null">assistant_driver = #{assistantDriver},</if> + <if test="quantity != null">quantity = #{quantity},</if> + <if test="dispatchQuantity != null">dispatch_quantity = #{dispatchQuantity},</if> + <if test="remark != null">remark = #{remark},</if> + </trim> + where id = #{id} + </update> + <!-- 淇敼 --> + <update id="updateKeyCollectionInfoBatch" parameterType="java.util.List"> + <foreach collection="list" item="item" index="index" separator=";"> + update key_collection_info + <trim prefix="SET" suffixOverrides=","> + <if test="item.customerName != null">customer_name = #{item.customerName},</if> + <if test="item.carrier != null">carrier = #{item.carrier},</if> + <if test="item.dispatchNo != null">dispatch_no = #{item.dispatchNo},</if> + <if test="item.driverName != null">driver_name = #{item.driverName},</if> + <if test="item.driverMobile != null">driver_mobile = #{item.driverMobile},</if> + <if test="item.licensePlateNumber != null">license_plate_number = #{item.licensePlateNumber},</if> + <if test="item.orderTime != null">order_time = #{item.orderTime},</if> + <if test="item.orderCreatedTime != null">order_created_time = #{item.orderCreatedTime},</if> + <if test="item.dispatchCreatedTime != null">dispatch_created_time = #{item.dispatchCreatedTime},</if> + <if test="item.keyCollectionTime != null">key_collection_time = #{item.keyCollectionTime},</if> + <if test="item.estimatedDepartureTime != null">estimated_departure_time = #{item.estimatedDepartureTime},</if> + <if test="item.requiredArrivalTime != null">required_arrival_time = #{item.requiredArrivalTime},</if> + <if test="item.consignorAddress != null">consignor_address = #{item.consignorAddress},</if> + <if test="item.consigneeAddress != null">consignee_address = #{item.consigneeAddress},</if> + <if test="item.mainDriver != null">main_driver = #{item.mainDriver},</if> + <if test="item.pointNum != null">point_num = #{item.pointNum},</if> + <if test="item.transportMode != null">transport_mode = #{item.transportMode},</if> + <if test="item.assistantDriver != null">assistant_driver = #{item.assistantDriver},</if> + <if test="item.quantity != null">quantity = #{item.quantity},</if> + <if test="item.dispatchQuantity != null">dispatch_quantity = #{item.dispatchQuantity},</if> + <if test="item.remark != null">remark = #{item.remark},</if> + </trim> + where id = #{item.id} + </foreach> + </update> + + <!--鍒犻櫎--> + <delete id="deleteKeyCollectionInfoById" parameterType="Integer"> + delete from key_collection_info where id = #{id} + </delete> + <delete id="deleteKeyCollectionInfoByIds" parameterType="Integer"> + delete from key_collection_info where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> + +</mapper> \ No newline at end of file -- Gitblit v1.8.0