123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.caimei.modules.order.dao.LogisticsBatchDao">
- <sql id="columns">
- a.id AS id,
- a.shopOrderID AS shopOrderID,
- a.orderID AS orderID,
- a.outStoreTimes AS outStoreTimes,
- a.mailer AS mailer,
- a.shopID AS shopID,
- a.updateDate AS updateDate,
- a.deliveryTime AS deliveryTime,
- a.receiptTime AS receiptTime,
- a.remarkImage AS remarkImage,
- a.remark AS remark
- </sql>
- <insert id="insert" parameterType="LogisticsBatch" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_logistics_batch (
- shopOrderID,
- orderID,
- outStoreTimes,
- mailer,
- shopID,
- updateDate,
- deliveryTime,
- receiptTime,
- remarkImage,
- remark
- ) VALUES (
- #{shopOrderID},
- #{orderID},
- #{outStoreTimes},
- #{mailer},
- #{shopID},
- #{updateDate},
- #{deliveryTime},
- #{receiptTime},
- #{remarkImage},
- #{remark}
- )
- </insert>
- <select id="findByShopOrderID" resultType="LogisticsBatch">
- select <include refid="columns"/>
- from cm_logistics_batch a where a.shopOrderID = #{shopOrderID}
- order by a.outStoreTimes desc
- </select>
- <select id="findByShopOrderIDWithTimes" resultType="LogisticsBatch">
- select <include refid="columns"/>
- from cm_logistics_batch a where a.shopOrderID = #{shopOrderID}
- and a.outStoreTimes = #{outStoreTimes}
- order by a.outStoreTimes desc
- </select>
- <select id="get" resultType="LogisticsBatch">
- select <include refid="columns"/>
- from cm_logistics_batch a where a.id = #{id}
- </select>
- <select id="findByOrderID" resultType="LogisticsBatch">
- select <include refid="columns"/>
- from cm_logistics_batch a where a.orderID = #{orderID}
- order by a.deliveryTime desc
- </select>
- <select id="findBatch" resultType="LogisticsBatch">
- select <include refid="columns"/>
- from cm_logistics_batch a
- <where>
- 1 = 1
- <if test="orderID != null and orderID != ''">
- and a.orderID = #{orderID}
- </if>
- <if test="logisticsBatchID != null and logisticsBatchID != ''">
- and a.logisticsBatchID = #{logisticsBatchID}
- </if>
- </where>
- order by a.deliveryTime desc
- </select>
- </mapper>
|