yanghb
2023-04-21 75a2623173bcc4a235aa1f99f7ef28519186160b
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml
@@ -13,8 +13,6 @@
        <result column="cargoType" property="cargoType"/>
        <result column="urgent" property="urgent"/>
        <result column="cargoNumber" property="cargoNumber"/>
        <result column="userImg" property="userImg"/>
        <result column="driverImg" property="driverImg"/>
        <result column="remark" property="remark"/>
        <result column="placementLon" property="placementLon"/>
        <result column="placementLat" property="placementLat"/>
@@ -41,7 +39,6 @@
        <result column="orderMoney" property="orderMoney"/>
        <result column="travelMoney" property="travelMoney"/>
        <result column="tipMoney" property="tipMoney"/>
        <result column="holidayFee" property="holidayFee"/>
        <result column="redPacketMoney" property="redPacketMoney"/>
        <result column="couponMoney" property="couponMoney"/>
        <result column="redPacketId" property="redPacketId"/>
@@ -49,12 +46,8 @@
        <result column="discount" property="discount"/>
        <result column="discountMoney" property="discountMoney"/>
        <result column="activityId" property="activityId"/>
        <result column="taxiCardId" property="taxiCardId"/>
        <result column="userTaxiCardId" property="userTaxiCardId"/>
        <result column="discountAmount" property="discountAmount"/>
        <result column="companyId" property="companyId"/>
        <result column="payMoney" property="payMoney"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
        <result column="travelTime" property="travelTime"/>
@@ -163,14 +156,8 @@
        state as state,
        orderMoney as orderMoney,
        payMoney as payMoney,
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney,
        userImg,
        driverImg,
        thankYouFee,
        DATE_FORMAT(arriveTimeExpect, '%Y-%m-%d %H:%i') as arriveTimeExpect,
        IF(endServiceTime is not null,DATE_FORMAT(endServiceTime, '%Y-%m-%d %H:%i'),'') as endServiceTime,
        pickUpCode
        from t_order_logistics as a where userId = #{uid} and a.type = #{type} order by insertTime desc limit #{pageNum}, #{size}
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney
        from t_order_logistics as a where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -187,7 +174,7 @@
    <select id="queryInvoiceOrder" resultType="map">
        select
        id as orderId,
        id as id,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -198,39 +185,22 @@
        `type` as orderType
        from t_order_logistics where state in (9)
        <if test="type == 1">
            and (invoiceId is null or invoiceId in (select id from t_invoice where state = 3))
            and invoiceId is null and invoiceId in (select id from t_invoice where state != 2)
        </if>
        <if test="type == 2">
            and invoiceId in (select id from t_invoice where state = 2)
        </if>
        <if test="null != startTime">
            and travelTime >= #{startTime}
        <if test="null != startTime and null != endTime">
            and travelTime between #{startTime} and #{endTime}
        </if>
        <if test="null != startMoney">
            and payMoney >= #{startMoney}
        </if>
        <if test="null != endTime">
            and  #{endTime}>= travelTime
        </if>
        <if test="null != endMoney">
            and   #{endMoney}>=payMoney
        <if test="null != startMoney and null != endMoney">
            and payMoney between #{startMoney} and #{endMoney}
        </if>
        <if test="null !=uid">
            and userId = #{uid}
        </if>
        <if test="null != orderType">
            and `type` = #{orderType}
        </if>
    </select>
    <select id="queryByState" resultType="com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics">
        select * from t_order_logistics where isDelete = 1 and userId = #{uid}
        <if test="null != state">
            and state in
            <foreach collection="state" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>