175 lines
7.6 KiB
XML
175 lines
7.6 KiB
XML
![]() |
<?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.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper">
|
||
|
|
||
|
<!-- 可根据自己的需求,是否要使用 -->
|
||
|
<resultMap id="cueOrderVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO">
|
||
|
<result property="orderId" column="order_id"/>
|
||
|
<result property="userId" column="user_id"/>
|
||
|
<result property="userName" column="user_name"/>
|
||
|
<result property="userPhone" column="user_phone"/>
|
||
|
<result property="orderType" column="order_type"/>
|
||
|
<result property="orderStatus" column="order_status"/>
|
||
|
<result property="flawImgUrl" column="flaw_img_url"/>
|
||
|
<result property="evidenceOfPayment" column="evidence_of_payment"/>
|
||
|
<result property="orderRemark" column="order_remark"/>
|
||
|
<result property="estimatedAmount" column="estimated_amount"/>
|
||
|
<result property="actualAmount" column="actual_amount"/>
|
||
|
<result property="voucherAmount" column="voucher_amount"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="updateTime" column="update_time"/>
|
||
|
<result property="isPayed" column="is_payed"/>
|
||
|
<result property="payType" column="pay_type"/>
|
||
|
<result property="payTime" column="pay_time"/>
|
||
|
<result property="deliveryTime" column="delivery_time"/>
|
||
|
<result property="finallyTime" column="finally_time"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="Vo_Column_List">
|
||
|
order_id,user_id,user_name,user_phone,order_type,order_status,flaw_img_url,evidence_of_payment,order_remark,estimated_amount,actual_amount,voucher_amount,deleted,create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time
|
||
|
</sql>
|
||
|
|
||
|
<select id="list" resultMap="cueOrderVOMap">
|
||
|
SELECT
|
||
|
<include refid="Vo_Column_List" />
|
||
|
FROM
|
||
|
cue_order
|
||
|
<where>
|
||
|
deleted = 0
|
||
|
<if test="dto.userName != null and dto.userName != ''">
|
||
|
AND user_name LIKE CONCAT('%', #{dto.userName}, '%')
|
||
|
</if>
|
||
|
<if test="userPhone != null and dto.userPhone != ''">
|
||
|
AND user_phone LIKE CONCAT('%', #{dto.userPhone}, '%')
|
||
|
</if>
|
||
|
<if test="orderType != null">
|
||
|
AND order_type = #{orderType}
|
||
|
</if>
|
||
|
<if test="orderStatus != null">
|
||
|
AND order_status = #{orderStatus}
|
||
|
</if>
|
||
|
<if test="isPayed != null">
|
||
|
AND is_payed = #{isPayed}
|
||
|
</if>
|
||
|
<if test="payType != null">
|
||
|
AND pay_type = #{payType}
|
||
|
</if>
|
||
|
</where>
|
||
|
ORDER BY
|
||
|
order_id DESC
|
||
|
</select>
|
||
|
|
||
|
<select id="getById" resultMap="cueOrderVOMap">
|
||
|
SELECT
|
||
|
<include refid="Vo_Column_List" />
|
||
|
FROM
|
||
|
cue_order
|
||
|
WHERE
|
||
|
order_id = #{orderId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="save" useGeneratedKeys="true" keyProperty="orderId">
|
||
|
INSERT INTO cue_order
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="userId != null">user_id,</if>
|
||
|
<if test="userName != null and userName != ''">user_name,</if>
|
||
|
<if test="userPhone != null and userPhone != ''">user_phone,</if>
|
||
|
<if test="orderType != null">order_type,</if>
|
||
|
<if test="orderStatus != null">order_status,</if>
|
||
|
<if test="flawImgUrl != null and flawImgUrl != ''">flaw_img_url,</if>
|
||
|
<if test="evidenceOfPayment != null">evidence_of_payment,</if>
|
||
|
<if test="orderRemark != null and orderRemark != ''">order_remark,</if>
|
||
|
<if test="estimatedAmount != null and evidenceOfPayment != ''">estimated_amount,</if>
|
||
|
<if test="actualAmount != null">actual_amount,</if>
|
||
|
<if test="voucherAmount != null">voucher_amount,</if>
|
||
|
<if test="createTime != null">create_time,</if>
|
||
|
<if test="isPayed != null">is_payed,</if>
|
||
|
<if test="payType != null">pay_type,</if>
|
||
|
<if test="payTime != null">pay_time,</if>
|
||
|
<if test="deliveryTime != null">delivery_time,</if>
|
||
|
<if test="finallyTime != null">finally_time,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="userId != null">#{userId},</if>
|
||
|
<if test="userName != null and userName != ''">#{userName},</if>
|
||
|
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
|
||
|
<if test="orderType != null">#{orderType},</if>
|
||
|
<if test="orderStatus != null">#{orderStatus},</if>
|
||
|
<if test="flawImgUrl != null and flawImgUrl != ''">#{flawImgUrl},</if>
|
||
|
<if test="evidenceOfPayment != null and evidenceOfPayment != ''">#{evidenceOfPayment},</if>
|
||
|
<if test="orderRemark != null and orderRemark != ''">#{orderRemark},</if>
|
||
|
<if test="estimatedAmount != null">#{estimatedAmount},</if>
|
||
|
<if test="actualAmount != null">#{actualAmount},</if>
|
||
|
<if test="voucherAmount != null">#{voucherAmount},</if>
|
||
|
<if test="createTime != null">#{createTime},</if>
|
||
|
<if test="isPayed != null">#{isPayed},</if>
|
||
|
<if test="payType != null">#{payType},</if>
|
||
|
<if test="payTime != null">#{payTime},</if>
|
||
|
<if test="deliveryTime != null">#{deliveryTime},</if>
|
||
|
<if test="finallyTime != null">#{finallyTime},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="update">
|
||
|
UPDATE cue_order
|
||
|
<set>
|
||
|
<if test="userId != null">
|
||
|
user_id = #{userId},
|
||
|
</if>
|
||
|
<if test="userName != null and userName != ''">
|
||
|
user_name = #{userName},
|
||
|
</if>
|
||
|
<if test="userPhone != null and userPhone != ''">
|
||
|
user_phone = #{userPhone},
|
||
|
</if>
|
||
|
<if test="orderType != null">
|
||
|
order_type = #{orderType},
|
||
|
</if>
|
||
|
<if test="orderStatus != null">
|
||
|
order_status = #{orderStatus},
|
||
|
</if>
|
||
|
<if test="flawImgUrl != null and flawImgUrl != ''">
|
||
|
flaw_img_url = #{flawImgUrl},
|
||
|
</if>
|
||
|
<if test="evidenceOfPayment != null and evidenceOfPayment != ''">
|
||
|
evidence_of_payment = #{evidenceOfPayment},
|
||
|
</if>
|
||
|
<if test="orderRemark != null and orderRemark != ''">
|
||
|
order_remark = #{orderRemark},
|
||
|
</if>
|
||
|
<if test="estimatedAmount != null">
|
||
|
estimated_amount = #{estimatedAmount},
|
||
|
</if>
|
||
|
<if test="actualAmount != null">
|
||
|
actual_amount = #{actualAmount},
|
||
|
</if>
|
||
|
<if test="voucherAmount != null">
|
||
|
voucher_amount = #{voucherAmount},
|
||
|
</if>
|
||
|
<if test="deleted != null">
|
||
|
deleted = #{deleted},
|
||
|
</if>
|
||
|
<if test="updateTime != null">
|
||
|
update_time = #{updateTime},
|
||
|
</if>
|
||
|
<if test="isPayed != null">
|
||
|
is_payed = #{isPayed},
|
||
|
</if>
|
||
|
<if test="payType != null">
|
||
|
pay_type = #{payType},
|
||
|
</if>
|
||
|
<if test="payTime != null">
|
||
|
pay_time = #{payTime},
|
||
|
</if>
|
||
|
<if test="deliveryTime != null">
|
||
|
delivery_time = #{deliveryTime},
|
||
|
</if>
|
||
|
<if test="finallyTime != null">
|
||
|
finally_time = #{finallyTime},
|
||
|
</if>
|
||
|
</set>
|
||
|
where
|
||
|
order_id = #{orderId}
|
||
|
</update>
|
||
|
</mapper>
|