123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952 |
- <?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.chelvc.cloud.vehicle.server.dao.OmsOrderMapper">
-
- <resultMap type="com.chelvc.cloud.vehicle.server.entity.OmsOrder" id="OmsOrderResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="couponId" column="coupon_id" />
- <result property="orderSn" column="order_sn" />
- <result property="createTime" column="create_time" />
- <result property="memberUsername" column="member_username" />
- <result property="totalAmount" column="total_amount" />
- <result property="payAmount" column="pay_amount" />
- <result property="freightAmount" column="freight_amount" />
- <result property="promotionAmount" column="promotion_amount" />
- <result property="integrationAmount" column="integration_amount" />
- <result property="couponAmount" column="coupon_amount" />
- <result property="discountAmount" column="discount_amount" />
- <result property="payType" column="pay_type" />
- <result property="sourceType" column="source_type" />
- <result property="status" column="status" />
- <result property="orderType" column="order_type" />
- <result property="deliveryCompany" column="delivery_company" />
- <result property="deliverySn" column="delivery_sn" />
- <result property="autoConfirmDay" column="auto_confirm_day" />
- <result property="integration" column="integration" />
- <result property="growth" column="growth" />
- <result property="promotionInfo" column="promotion_info" />
- <result property="billType" column="bill_type" />
- <result property="billHeader" column="bill_header" />
- <result property="billContent" column="bill_content" />
- <result property="billReceiverPhone" column="bill_receiver_phone" />
- <result property="billReceiverEmail" column="bill_receiver_email" />
- <result property="receiverName" column="receiver_name" />
- <result property="receiverPhone" column="receiver_phone" />
- <result property="receiverPostCode" column="receiver_post_code" />
- <result property="receiverProvince" column="receiver_province" />
- <result property="receiverCity" column="receiver_city" />
- <result property="receiverRegion" column="receiver_region" />
- <result property="receiverDetailAddress" column="receiver_detail_address" />
- <result property="note" column="note" />
- <result property="confirmStatus" column="confirm_status" />
- <result property="deleteStatus" column="delete_status" />
- <result property="useIntegration" column="use_integration" />
- <result property="paymentTime" column="payment_time" />
- <result property="deliveryTime" column="delivery_time" />
- <result property="receiveTime" column="receive_time" />
- <result property="commentTime" column="comment_time" />
- </resultMap>
- <sql id="selectOmsOrderVo">
- select id, user_id, coupon_id, order_sn, create_time, member_username, total_amount, pay_amount, freight_amount, promotion_amount, integration_amount, coupon_amount, discount_amount, pay_type, source_type, status, order_type, delivery_company, delivery_sn, auto_confirm_day, integration, growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone, bill_receiver_email, receiver_name, receiver_phone, receiver_post_code, receiver_province, receiver_city, receiver_region, receiver_detail_address, note, confirm_status, delete_status, use_integration, payment_time, delivery_time, receive_time, comment_time from oms_order
- </sql>
- <select id="selectOmsOrderList" parameterType="com.chelvc.cloud.vehicle.server.entity.OmsOrder" resultMap="OmsOrderResult">
- <include refid="selectOmsOrderVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="couponId != null "> and coupon_id = #{couponId}</if>
- <if test="orderSn != null and orderSn != ''"> and order_sn = #{orderSn}</if>
- <if test="memberUsername != null and memberUsername != ''"> and member_username like concat('%', #{memberUsername}, '%')</if>
- <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
- <if test="payAmount != null "> and pay_amount = #{payAmount}</if>
- <if test="freightAmount != null "> and freight_amount = #{freightAmount}</if>
- <if test="promotionAmount != null "> and promotion_amount = #{promotionAmount}</if>
- <if test="integrationAmount != null "> and integration_amount = #{integrationAmount}</if>
- <if test="couponAmount != null "> and coupon_amount = #{couponAmount}</if>
- <if test="discountAmount != null "> and discount_amount = #{discountAmount}</if>
- <if test="payType != null "> and pay_type = #{payType}</if>
- <if test="sourceType != null "> and source_type = #{sourceType}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="orderType != null "> and order_type = #{orderType}</if>
- <if test="deliveryCompany != null and deliveryCompany != ''"> and delivery_company = #{deliveryCompany}</if>
- <if test="deliverySn != null and deliverySn != ''"> and delivery_sn = #{deliverySn}</if>
- <if test="autoConfirmDay != null "> and auto_confirm_day = #{autoConfirmDay}</if>
- <if test="integration != null "> and integration = #{integration}</if>
- <if test="growth != null "> and growth = #{growth}</if>
- <if test="promotionInfo != null and promotionInfo != ''"> and promotion_info = #{promotionInfo}</if>
- <if test="billType != null "> and bill_type = #{billType}</if>
- <if test="billHeader != null and billHeader != ''"> and bill_header = #{billHeader}</if>
- <if test="billContent != null and billContent != ''"> and bill_content = #{billContent}</if>
- <if test="billReceiverPhone != null and billReceiverPhone != ''"> and bill_receiver_phone = #{billReceiverPhone}</if>
- <if test="billReceiverEmail != null and billReceiverEmail != ''"> and bill_receiver_email = #{billReceiverEmail}</if>
- <if test="receiverName != null and receiverName != ''"> and receiver_name like concat('%', #{receiverName}, '%')</if>
- <if test="receiverPhone != null and receiverPhone != ''"> and receiver_phone = #{receiverPhone}</if>
- <if test="receiverPostCode != null and receiverPostCode != ''"> and receiver_post_code = #{receiverPostCode}</if>
- <if test="receiverProvince != null and receiverProvince != ''"> and receiver_province = #{receiverProvince}</if>
- <if test="receiverCity != null and receiverCity != ''"> and receiver_city = #{receiverCity}</if>
- <if test="receiverRegion != null and receiverRegion != ''"> and receiver_region = #{receiverRegion}</if>
- <if test="receiverDetailAddress != null and receiverDetailAddress != ''"> and receiver_detail_address = #{receiverDetailAddress}</if>
- <if test="note != null and note != ''"> and note = #{note}</if>
- <if test="confirmStatus != null "> and confirm_status = #{confirmStatus}</if>
- <if test="deleteStatus != null "> and delete_status = #{deleteStatus}</if>
- <if test="useIntegration != null "> and use_integration = #{useIntegration}</if>
- <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
- <if test="deliveryTime != null "> and delivery_time = #{deliveryTime}</if>
- <if test="receiveTime != null "> and receive_time = #{receiveTime}</if>
- <if test="commentTime != null "> and comment_time = #{commentTime}</if>
- <if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
- </where>
- </select>
-
- <select id="selectOmsOrderById" parameterType="Long" resultMap="OmsOrderResult">
- <include refid="selectOmsOrderVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertOmsOrder" parameterType="com.chelvc.cloud.vehicle.server.entity.OmsOrder" useGeneratedKeys="true" keyProperty="id">
- insert into oms_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="couponId != null">coupon_id,</if>
- <if test="orderSn != null">order_sn,</if>
- <if test="createTime != null">create_time,</if>
- <if test="memberUsername != null">member_username,</if>
- <if test="totalAmount != null">total_amount,</if>
- <if test="payAmount != null">pay_amount,</if>
- <if test="freightAmount != null">freight_amount,</if>
- <if test="promotionAmount != null">promotion_amount,</if>
- <if test="integrationAmount != null">integration_amount,</if>
- <if test="couponAmount != null">coupon_amount,</if>
- <if test="discountAmount != null">discount_amount,</if>
- <if test="payType != null">pay_type,</if>
- <if test="sourceType != null">source_type,</if>
- <if test="status != null">status,</if>
- <if test="orderType != null">order_type,</if>
- <if test="deliveryCompany != null">delivery_company,</if>
- <if test="deliverySn != null">delivery_sn,</if>
- <if test="autoConfirmDay != null">auto_confirm_day,</if>
- <if test="integration != null">integration,</if>
- <if test="growth != null">growth,</if>
- <if test="promotionInfo != null">promotion_info,</if>
- <if test="billType != null">bill_type,</if>
- <if test="billHeader != null">bill_header,</if>
- <if test="billContent != null">bill_content,</if>
- <if test="billReceiverPhone != null">bill_receiver_phone,</if>
- <if test="billReceiverEmail != null">bill_receiver_email,</if>
- <if test="receiverName != null and receiverName != ''">receiver_name,</if>
- <if test="receiverPhone != null and receiverPhone != ''">receiver_phone,</if>
- <if test="receiverPostCode != null">receiver_post_code,</if>
- <if test="receiverProvince != null">receiver_province,</if>
- <if test="receiverCity != null">receiver_city,</if>
- <if test="receiverRegion != null">receiver_region,</if>
- <if test="receiverDetailAddress != null">receiver_detail_address,</if>
- <if test="note != null">note,</if>
- <if test="confirmStatus != null">confirm_status,</if>
- <if test="deleteStatus != null">delete_status,</if>
- <if test="useIntegration != null">use_integration,</if>
- <if test="paymentTime != null">payment_time,</if>
- <if test="deliveryTime != null">delivery_time,</if>
- <if test="receiveTime != null">receive_time,</if>
- <if test="commentTime != null">comment_time,</if>
- <if test="modifyTime != null">modify_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="couponId != null">#{couponId},</if>
- <if test="orderSn != null">#{orderSn},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="memberUsername != null">#{memberUsername},</if>
- <if test="totalAmount != null">#{totalAmount},</if>
- <if test="payAmount != null">#{payAmount},</if>
- <if test="freightAmount != null">#{freightAmount},</if>
- <if test="promotionAmount != null">#{promotionAmount},</if>
- <if test="integrationAmount != null">#{integrationAmount},</if>
- <if test="couponAmount != null">#{couponAmount},</if>
- <if test="discountAmount != null">#{discountAmount},</if>
- <if test="payType != null">#{payType},</if>
- <if test="sourceType != null">#{sourceType},</if>
- <if test="status != null">#{status},</if>
- <if test="orderType != null">#{orderType},</if>
- <if test="deliveryCompany != null">#{deliveryCompany},</if>
- <if test="deliverySn != null">#{deliverySn},</if>
- <if test="autoConfirmDay != null">#{autoConfirmDay},</if>
- <if test="integration != null">#{integration},</if>
- <if test="growth != null">#{growth},</if>
- <if test="promotionInfo != null">#{promotionInfo},</if>
- <if test="billType != null">#{billType},</if>
- <if test="billHeader != null">#{billHeader},</if>
- <if test="billContent != null">#{billContent},</if>
- <if test="billReceiverPhone != null">#{billReceiverPhone},</if>
- <if test="billReceiverEmail != null">#{billReceiverEmail},</if>
- <if test="receiverName != null and receiverName != ''">#{receiverName},</if>
- <if test="receiverPhone != null and receiverPhone != ''">#{receiverPhone},</if>
- <if test="receiverPostCode != null">#{receiverPostCode},</if>
- <if test="receiverProvince != null">#{receiverProvince},</if>
- <if test="receiverCity != null">#{receiverCity},</if>
- <if test="receiverRegion != null">#{receiverRegion},</if>
- <if test="receiverDetailAddress != null">#{receiverDetailAddress},</if>
- <if test="note != null">#{note},</if>
- <if test="confirmStatus != null">#{confirmStatus},</if>
- <if test="deleteStatus != null">#{deleteStatus},</if>
- <if test="useIntegration != null">#{useIntegration},</if>
- <if test="paymentTime != null">#{paymentTime},</if>
- <if test="deliveryTime != null">#{deliveryTime},</if>
- <if test="receiveTime != null">#{receiveTime},</if>
- <if test="commentTime != null">#{commentTime},</if>
- <if test="modifyTime != null">#{modifyTime},</if>
- </trim>
- </insert>
- <update id="updateOmsOrder" parameterType="com.chelvc.cloud.vehicle.server.entity.OmsOrder">
- update oms_order
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="couponId != null">coupon_id = #{couponId},</if>
- <if test="orderSn != null">order_sn = #{orderSn},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="memberUsername != null">member_username = #{memberUsername},</if>
- <if test="totalAmount != null">total_amount = #{totalAmount},</if>
- <if test="payAmount != null">pay_amount = #{payAmount},</if>
- <if test="freightAmount != null">freight_amount = #{freightAmount},</if>
- <if test="promotionAmount != null">promotion_amount = #{promotionAmount},</if>
- <if test="integrationAmount != null">integration_amount = #{integrationAmount},</if>
- <if test="couponAmount != null">coupon_amount = #{couponAmount},</if>
- <if test="discountAmount != null">discount_amount = #{discountAmount},</if>
- <if test="payType != null">pay_type = #{payType},</if>
- <if test="sourceType != null">source_type = #{sourceType},</if>
- <if test="status != null">status = #{status},</if>
- <if test="orderType != null">order_type = #{orderType},</if>
- <if test="deliveryCompany != null">delivery_company = #{deliveryCompany},</if>
- <if test="deliverySn != null">delivery_sn = #{deliverySn},</if>
- <if test="autoConfirmDay != null">auto_confirm_day = #{autoConfirmDay},</if>
- <if test="integration != null">integration = #{integration},</if>
- <if test="growth != null">growth = #{growth},</if>
- <if test="promotionInfo != null">promotion_info = #{promotionInfo},</if>
- <if test="billType != null">bill_type = #{billType},</if>
- <if test="billHeader != null">bill_header = #{billHeader},</if>
- <if test="billContent != null">bill_content = #{billContent},</if>
- <if test="billReceiverPhone != null">bill_receiver_phone = #{billReceiverPhone},</if>
- <if test="billReceiverEmail != null">bill_receiver_email = #{billReceiverEmail},</if>
- <if test="receiverName != null and receiverName != ''">receiver_name = #{receiverName},</if>
- <if test="receiverPhone != null and receiverPhone != ''">receiver_phone = #{receiverPhone},</if>
- <if test="receiverPostCode != null">receiver_post_code = #{receiverPostCode},</if>
- <if test="receiverProvince != null">receiver_province = #{receiverProvince},</if>
- <if test="receiverCity != null">receiver_city = #{receiverCity},</if>
- <if test="receiverRegion != null">receiver_region = #{receiverRegion},</if>
- <if test="receiverDetailAddress != null">receiver_detail_address = #{receiverDetailAddress},</if>
- <if test="note != null">note = #{note},</if>
- <if test="confirmStatus != null">confirm_status = #{confirmStatus},</if>
- <if test="deleteStatus != null">delete_status = #{deleteStatus},</if>
- <if test="useIntegration != null">use_integration = #{useIntegration},</if>
- <if test="paymentTime != null">payment_time = #{paymentTime},</if>
- <if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
- <if test="receiveTime != null">receive_time = #{receiveTime},</if>
- <if test="commentTime != null">comment_time = #{commentTime},</if>
- <if test="modifyTime != null">modify_time = #{modifyTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteOmsOrderById" parameterType="Long">
- delete from oms_order where id = #{id}
- </delete>
- <delete id="deleteOmsOrderByIds" parameterType="String">
- delete from oms_order where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="countByExample" parameterType="com.chelvc.cloud.vehicle.api.dto.OmsOrderExampleDTO" resultType="java.lang.Long">
- select count(*) from oms_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <delete id="deleteByExample" parameterType="com.chelvc.cloud.vehicle.api.dto.OmsOrderExampleDTO">
- delete from oms_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from oms_order
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insertSelective" parameterType="com.chelvc.cloud.vehicle.server.entity.OmsOrder">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into oms_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="memberId != null">
- member_id,
- </if>
- <if test="couponId != null">
- coupon_id,
- </if>
- <if test="orderSn != null">
- order_sn,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="memberUsername != null">
- member_username,
- </if>
- <if test="totalAmount != null">
- total_amount,
- </if>
- <if test="payAmount != null">
- pay_amount,
- </if>
- <if test="freightAmount != null">
- freight_amount,
- </if>
- <if test="promotionAmount != null">
- promotion_amount,
- </if>
- <if test="integrationAmount != null">
- integration_amount,
- </if>
- <if test="couponAmount != null">
- coupon_amount,
- </if>
- <if test="discountAmount != null">
- discount_amount,
- </if>
- <if test="payType != null">
- pay_type,
- </if>
- <if test="sourceType != null">
- source_type,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="orderType != null">
- order_type,
- </if>
- <if test="deliveryCompany != null">
- delivery_company,
- </if>
- <if test="deliverySn != null">
- delivery_sn,
- </if>
- <if test="autoConfirmDay != null">
- auto_confirm_day,
- </if>
- <if test="integration != null">
- integration,
- </if>
- <if test="growth != null">
- growth,
- </if>
- <if test="promotionInfo != null">
- promotion_info,
- </if>
- <if test="billType != null">
- bill_type,
- </if>
- <if test="billHeader != null">
- bill_header,
- </if>
- <if test="billContent != null">
- bill_content,
- </if>
- <if test="billReceiverPhone != null">
- bill_receiver_phone,
- </if>
- <if test="billReceiverEmail != null">
- bill_receiver_email,
- </if>
- <if test="receiverName != null">
- receiver_name,
- </if>
- <if test="receiverPhone != null">
- receiver_phone,
- </if>
- <if test="receiverPostCode != null">
- receiver_post_code,
- </if>
- <if test="receiverProvince != null">
- receiver_province,
- </if>
- <if test="receiverCity != null">
- receiver_city,
- </if>
- <if test="receiverRegion != null">
- receiver_region,
- </if>
- <if test="receiverDetailAddress != null">
- receiver_detail_address,
- </if>
- <if test="note != null">
- note,
- </if>
- <if test="confirmStatus != null">
- confirm_status,
- </if>
- <if test="deleteStatus != null">
- delete_status,
- </if>
- <if test="useIntegration != null">
- use_integration,
- </if>
- <if test="paymentTime != null">
- payment_time,
- </if>
- <if test="deliveryTime != null">
- delivery_time,
- </if>
- <if test="receiveTime != null">
- receive_time,
- </if>
- <if test="commentTime != null">
- comment_time,
- </if>
- <if test="modifyTime != null">
- modify_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="memberId != null">
- #{memberId,jdbcType=BIGINT},
- </if>
- <if test="couponId != null">
- #{couponId,jdbcType=BIGINT},
- </if>
- <if test="orderSn != null">
- #{orderSn,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="memberUsername != null">
- #{memberUsername,jdbcType=VARCHAR},
- </if>
- <if test="totalAmount != null">
- #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="payAmount != null">
- #{payAmount,jdbcType=DECIMAL},
- </if>
- <if test="freightAmount != null">
- #{freightAmount,jdbcType=DECIMAL},
- </if>
- <if test="promotionAmount != null">
- #{promotionAmount,jdbcType=DECIMAL},
- </if>
- <if test="integrationAmount != null">
- #{integrationAmount,jdbcType=DECIMAL},
- </if>
- <if test="couponAmount != null">
- #{couponAmount,jdbcType=DECIMAL},
- </if>
- <if test="discountAmount != null">
- #{discountAmount,jdbcType=DECIMAL},
- </if>
- <if test="payType != null">
- #{payType,jdbcType=INTEGER},
- </if>
- <if test="sourceType != null">
- #{sourceType,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="orderType != null">
- #{orderType,jdbcType=INTEGER},
- </if>
- <if test="deliveryCompany != null">
- #{deliveryCompany,jdbcType=VARCHAR},
- </if>
- <if test="deliverySn != null">
- #{deliverySn,jdbcType=VARCHAR},
- </if>
- <if test="autoConfirmDay != null">
- #{autoConfirmDay,jdbcType=INTEGER},
- </if>
- <if test="integration != null">
- #{integration,jdbcType=INTEGER},
- </if>
- <if test="growth != null">
- #{growth,jdbcType=INTEGER},
- </if>
- <if test="promotionInfo != null">
- #{promotionInfo,jdbcType=VARCHAR},
- </if>
- <if test="billType != null">
- #{billType,jdbcType=INTEGER},
- </if>
- <if test="billHeader != null">
- #{billHeader,jdbcType=VARCHAR},
- </if>
- <if test="billContent != null">
- #{billContent,jdbcType=VARCHAR},
- </if>
- <if test="billReceiverPhone != null">
- #{billReceiverPhone,jdbcType=VARCHAR},
- </if>
- <if test="billReceiverEmail != null">
- #{billReceiverEmail,jdbcType=VARCHAR},
- </if>
- <if test="receiverName != null">
- #{receiverName,jdbcType=VARCHAR},
- </if>
- <if test="receiverPhone != null">
- #{receiverPhone,jdbcType=VARCHAR},
- </if>
- <if test="receiverPostCode != null">
- #{receiverPostCode,jdbcType=VARCHAR},
- </if>
- <if test="receiverProvince != null">
- #{receiverProvince,jdbcType=VARCHAR},
- </if>
- <if test="receiverCity != null">
- #{receiverCity,jdbcType=VARCHAR},
- </if>
- <if test="receiverRegion != null">
- #{receiverRegion,jdbcType=VARCHAR},
- </if>
- <if test="receiverDetailAddress != null">
- #{receiverDetailAddress,jdbcType=VARCHAR},
- </if>
- <if test="note != null">
- #{note,jdbcType=VARCHAR},
- </if>
- <if test="confirmStatus != null">
- #{confirmStatus,jdbcType=INTEGER},
- </if>
- <if test="deleteStatus != null">
- #{deleteStatus,jdbcType=INTEGER},
- </if>
- <if test="useIntegration != null">
- #{useIntegration,jdbcType=INTEGER},
- </if>
- <if test="paymentTime != null">
- #{paymentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deliveryTime != null">
- #{deliveryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="receiveTime != null">
- #{receiveTime,jdbcType=TIMESTAMP},
- </if>
- <if test="commentTime != null">
- #{commentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyTime != null">
- #{modifyTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <sql id="Base_Column_List">
- id, member_id, coupon_id, order_sn, create_time, member_username, total_amount, pay_amount,
- freight_amount, promotion_amount, integration_amount, coupon_amount, discount_amount,
- pay_type, source_type, status, order_type, delivery_company, delivery_sn, auto_confirm_day,
- integration, growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone,
- bill_receiver_email, receiver_name, receiver_phone, receiver_post_code, receiver_province,
- receiver_city, receiver_region, receiver_detail_address, note, confirm_status, delete_status,
- use_integration, payment_time, delivery_time, receive_time, comment_time, modify_time
- </sql>
- <select id="selectByExample" parameterType="com.chelvc.cloud.vehicle.api.dto.OmsOrderExampleDTO" resultMap="OmsOrderResult">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from oms_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update oms_order
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=BIGINT},
- </if>
- <if test="record.memberId != null">
- member_id = #{record.memberId,jdbcType=BIGINT},
- </if>
- <if test="record.couponId != null">
- coupon_id = #{record.couponId,jdbcType=BIGINT},
- </if>
- <if test="record.orderSn != null">
- order_sn = #{record.orderSn,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.memberUsername != null">
- member_username = #{record.memberUsername,jdbcType=VARCHAR},
- </if>
- <if test="record.totalAmount != null">
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.payAmount != null">
- pay_amount = #{record.payAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.freightAmount != null">
- freight_amount = #{record.freightAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.promotionAmount != null">
- promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.integrationAmount != null">
- integration_amount = #{record.integrationAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.couponAmount != null">
- coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.discountAmount != null">
- discount_amount = #{record.discountAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.payType != null">
- pay_type = #{record.payType,jdbcType=INTEGER},
- </if>
- <if test="record.sourceType != null">
- source_type = #{record.sourceType,jdbcType=INTEGER},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=INTEGER},
- </if>
- <if test="record.orderType != null">
- order_type = #{record.orderType,jdbcType=INTEGER},
- </if>
- <if test="record.deliveryCompany != null">
- delivery_company = #{record.deliveryCompany,jdbcType=VARCHAR},
- </if>
- <if test="record.deliverySn != null">
- delivery_sn = #{record.deliverySn,jdbcType=VARCHAR},
- </if>
- <if test="record.autoConfirmDay != null">
- auto_confirm_day = #{record.autoConfirmDay,jdbcType=INTEGER},
- </if>
- <if test="record.integration != null">
- integration = #{record.integration,jdbcType=INTEGER},
- </if>
- <if test="record.growth != null">
- growth = #{record.growth,jdbcType=INTEGER},
- </if>
- <if test="record.promotionInfo != null">
- promotion_info = #{record.promotionInfo,jdbcType=VARCHAR},
- </if>
- <if test="record.billType != null">
- bill_type = #{record.billType,jdbcType=INTEGER},
- </if>
- <if test="record.billHeader != null">
- bill_header = #{record.billHeader,jdbcType=VARCHAR},
- </if>
- <if test="record.billContent != null">
- bill_content = #{record.billContent,jdbcType=VARCHAR},
- </if>
- <if test="record.billReceiverPhone != null">
- bill_receiver_phone = #{record.billReceiverPhone,jdbcType=VARCHAR},
- </if>
- <if test="record.billReceiverEmail != null">
- bill_receiver_email = #{record.billReceiverEmail,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverName != null">
- receiver_name = #{record.receiverName,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverPhone != null">
- receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverPostCode != null">
- receiver_post_code = #{record.receiverPostCode,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverProvince != null">
- receiver_province = #{record.receiverProvince,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverCity != null">
- receiver_city = #{record.receiverCity,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverRegion != null">
- receiver_region = #{record.receiverRegion,jdbcType=VARCHAR},
- </if>
- <if test="record.receiverDetailAddress != null">
- receiver_detail_address = #{record.receiverDetailAddress,jdbcType=VARCHAR},
- </if>
- <if test="record.note != null">
- note = #{record.note,jdbcType=VARCHAR},
- </if>
- <if test="record.confirmStatus != null">
- confirm_status = #{record.confirmStatus,jdbcType=INTEGER},
- </if>
- <if test="record.deleteStatus != null">
- delete_status = #{record.deleteStatus,jdbcType=INTEGER},
- </if>
- <if test="record.useIntegration != null">
- use_integration = #{record.useIntegration,jdbcType=INTEGER},
- </if>
- <if test="record.paymentTime != null">
- payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.deliveryTime != null">
- delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.receiveTime != null">
- receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.commentTime != null">
- comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.modifyTime != null">
- modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <update id="updateByExample" parameterType="map">
- update oms_order
- set id = #{record.id,jdbcType=BIGINT},
- member_id = #{record.memberId,jdbcType=BIGINT},
- coupon_id = #{record.couponId,jdbcType=BIGINT},
- order_sn = #{record.orderSn,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- member_username = #{record.memberUsername,jdbcType=VARCHAR},
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- pay_amount = #{record.payAmount,jdbcType=DECIMAL},
- freight_amount = #{record.freightAmount,jdbcType=DECIMAL},
- promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
- integration_amount = #{record.integrationAmount,jdbcType=DECIMAL},
- coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
- discount_amount = #{record.discountAmount,jdbcType=DECIMAL},
- pay_type = #{record.payType,jdbcType=INTEGER},
- source_type = #{record.sourceType,jdbcType=INTEGER},
- status = #{record.status,jdbcType=INTEGER},
- order_type = #{record.orderType,jdbcType=INTEGER},
- delivery_company = #{record.deliveryCompany,jdbcType=VARCHAR},
- delivery_sn = #{record.deliverySn,jdbcType=VARCHAR},
- auto_confirm_day = #{record.autoConfirmDay,jdbcType=INTEGER},
- integration = #{record.integration,jdbcType=INTEGER},
- growth = #{record.growth,jdbcType=INTEGER},
- promotion_info = #{record.promotionInfo,jdbcType=VARCHAR},
- bill_type = #{record.billType,jdbcType=INTEGER},
- bill_header = #{record.billHeader,jdbcType=VARCHAR},
- bill_content = #{record.billContent,jdbcType=VARCHAR},
- bill_receiver_phone = #{record.billReceiverPhone,jdbcType=VARCHAR},
- bill_receiver_email = #{record.billReceiverEmail,jdbcType=VARCHAR},
- receiver_name = #{record.receiverName,jdbcType=VARCHAR},
- receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
- receiver_post_code = #{record.receiverPostCode,jdbcType=VARCHAR},
- receiver_province = #{record.receiverProvince,jdbcType=VARCHAR},
- receiver_city = #{record.receiverCity,jdbcType=VARCHAR},
- receiver_region = #{record.receiverRegion,jdbcType=VARCHAR},
- receiver_detail_address = #{record.receiverDetailAddress,jdbcType=VARCHAR},
- note = #{record.note,jdbcType=VARCHAR},
- confirm_status = #{record.confirmStatus,jdbcType=INTEGER},
- delete_status = #{record.deleteStatus,jdbcType=INTEGER},
- use_integration = #{record.useIntegration,jdbcType=INTEGER},
- payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
- delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
- receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
- comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
- modify_time = #{record.modifyTime,jdbcType=TIMESTAMP}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <!-- <resultMap id="orderDetailMap" type="com.chelvc.cloud.vehicle.api.dto.OmsOrderDetailDTO"-->
- <!-- extends="com.chelvc.cloud.vehicle.server.dao.OmsOrderMapper.BaseResultMap">-->
- <!-- <collection property="orderItemList" columnPrefix="ot_"-->
- <!-- resultMap="com.chelvc.cloud.vehicle.server.dao.OmsOrderItemMapper.BaseResultMap">-->
- <!-- </collection>-->
- <!-- </resultMap>-->
- <select id="getDetail" resultType="com.chelvc.cloud.vehicle.api.dto.OmsOrderItemDTO">
- SELECT
- o.id,
- o.order_sn,
- o.coupon_id,
- o.integration,
- o.user_id,
- ot.id ot_id,
- ot.goods_name ot_goods_name,
- ot.goods_sku_id ot_goods_sku_id,
- ot.goods_sku_code ot_goods_sku_code,
- ot.goods_quantity ot_goods_quantity
- FROM
- oms_order o
- LEFT JOIN oms_order_item ot ON o.id = ot.order_id
- WHERE
- o.id = #{orderId}
- </select>
- <update id="updateSkuStock">
- UPDATE pms_sku_stock
- SET
- stock = CASE id
- <foreach collection="itemList" item="item">
- WHEN #{item.goodsSkuId} THEN stock - #{item.goodsQuantity}
- </foreach>
- END,
- lock_stock = CASE id
- <foreach collection="itemList" item="item">
- WHEN #{item.goodsSkuId} THEN lock_stock - #{item.goodsQuantity}
- </foreach>
- END
- WHERE
- id IN
- <foreach collection="itemList" item="item" separator="," open="(" close=")">
- #{item.goodsSkuId}
- </foreach>
- </update>
- <select id="getTimeOutOrders" resultType="com.chelvc.cloud.vehicle.api.dto.OmsOrderDetailDTO">
- SELECT
- o.id,
- o.order_sn,
- o.coupon_id,
- o.integration,
- o.member_id,
- o.use_integration,
- ot.id ot_id,
- ot.product_name ot_product_name,
- ot.product_sku_id ot_product_sku_id,
- ot.product_sku_code ot_product_sku_code,
- ot.product_quantity ot_product_quantity
- FROM
- oms_order o
- LEFT JOIN oms_order_item ot ON o.id = ot.order_id
- WHERE
- o.status = 0
- AND o.create_time < date_add(NOW(), INTERVAL -#{minute} MINUTE);
- </select>
- <update id="updateOrderStatus">
- update oms_order
- set status=#{status}
- where id in
- <foreach collection="ids" item="id" separator="," open="(" close=")">
- #{id}
- </foreach>
- </update>
- <update id="releaseSkuStockLock">
- UPDATE pms_sku_stock
- SET
- lock_stock = CASE id
- <foreach collection="itemList" item="item">
- WHEN #{item.productSkuId} THEN lock_stock - #{item.productQuantity}
- </foreach>
- END
- WHERE
- id IN
- <foreach collection="itemList" item="item" separator="," open="(" close=")">
- #{item.productSkuId}
- </foreach>
- </update>
- <select id="getOrderQuantity" resultType="java.util.Map">
- SELECT
- count( 0 ) orderCount,
- sum( pay_amount ) amount
- FROM
- oms_order
- WHERE
- STATUS = '3'
- AND DATE_FORMAT( payment_time, 'yyyyMMdd' ) = DATE_FORMAT(
- now(),
- 'yyyyMMdd')
- </select>
- <select id="queryAmountByLastMonth" resultType="java.math.BigDecimal">
- select
- count(pay_amount)
- from
- oms_order
- where
- merchant_id = #{merchantId}
- and
- status = 3
- and
- payment_time between #{startLocalTime} and #{endLocalTime}
- </select>
- </mapper>
|