Files
zhwl/zhwl-wcsc/target/classes/mapper/wcsc/ZdyWcscOrderItemMapper.xml

483 lines
19 KiB
XML
Raw Normal View History

2025-07-01 17:54:58 +08:00
<?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.zhwl.wcsc.mapper.ZdyWcscOrderItemMapper">
<resultMap type="ZdyWcscOrderItem" id="ZdyWcscOrderItemResult">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="orderId" column="order_id"/>
<result property="storeId" column="store_id"/>
<result property="goodsId" column="goods_id"/>
<result property="adminId" column="admin_id"/>
<result property="goodsSkuPriceId" column="goods_sku_price_id"/>
<result property="activityId" column="activity_id"/>
<result property="activityType" column="activity_type"/>
<result property="itemGoodsSkuPriceId" column="item_goods_sku_price_id"/>
<result property="goodsSkuText" column="goods_sku_text"/>
<result property="goodsTitle" column="goods_title"/>
<result property="goodsImage" column="goods_image"/>
<result property="goodsOriginalPrice" column="goods_original_price"/>
<result property="discountFee" column="discount_fee"/>
<result property="totalPrice" column="total_price"/>
<result property="goodsPrice" column="goods_price"/>
<result property="payPrice" column="pay_price"/>
<result property="goodsNum" column="goods_num"/>
<result property="dispatchStatus" column="dispatch_status"/>
<result property="dispatchFee" column="dispatch_fee"/>
<result property="dispatchType" column="dispatch_type"/>
<result property="dispatchId" column="dispatch_id"/>
<result property="aftersaleStatus" column="aftersale_status"/>
<result property="commentStatus" column="comment_status"/>
<result property="refundStatus" column="refund_status"/>
<result property="refundFee" column="refund_fee"/>
<result property="refundCause" column="refund_cause"/>
<result property="refundMsg" column="refund_msg"/>
<result property="expressName" column="express_name"/>
<result property="expressNo" column="express_no"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="deletetime" column="deletetime"/>
<result property="read" column="read"/>
<result property="title" column="title"/>
<result property="priceStock" column="pub_stock"/>
<result property="priceSales" column="pub_sales"/>
<result property="priceSn" column="pub_sn"/>
<result property="priceWeight" column="pub_weight"/>
<result property="price" column="pub_price"/>
<result property="priceStatus" column="pub_status"/>
<result property="nickName" column="nickName"/>
<result property="dispatchStatusText" column="dispatchStatusText"/>
<result property="aftersaleStatusText" column="aftersaleStatusText"/>
<result property="commentStatusText" column="commentStatusText"/>
<result property="refundStatusText" column="refundStatusText"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectZdyWcscOrderItemVo">
SELECT it.id,
it.user_id,
it.order_id,
it.store_id,
it.goods_id,
it.admin_id,
it.goods_sku_price_id,
it.activity_id,
it.activity_type,
it.item_goods_sku_price_id,
it.goods_sku_text,
it.goods_title,
it.goods_image,
it.goods_original_price,
it.discount_fee,
it.total_price,
it.goods_price,
it.pay_price,
it.goods_num,
it.dispatch_status,
it.dispatch_fee,
it.dispatch_type,
it.dispatch_id,
it.aftersale_status,
it.comment_status,
it.refund_status,
it.refund_fee,
it.refund_cause,
it.refund_msg,
it.express_name,
it.express_no,
it.create_time,
it.update_time,
it.deletetime,
it.`read`,
it.create_by,
it.update_by,
it.dept_id,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_dispatch_status'
AND dict_value = it.dispatch_status) AS dispatchStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_aftersale_status'
AND dict_value = it.aftersale_status) AS aftersaleStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_comment_status'
AND dict_value = it.comment_status) AS commentStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_refund_status'
AND dict_value = it.refund_status) AS refundStatusText,
good.title,
pr.weigh AS pub_weigh,
pr.image AS pub_image,
pr.stock AS pub_stock,
pr.sales AS pub_sales,
pr.sn AS pub_sn,
pr.weight AS pub_weight,
pr.price AS pub_price,
pr.STATUS AS pub_status,
su.nick_name AS nickName
FROM zdy_wcsc_order_item it
LEFT JOIN zdy_wcsc_goods good ON good.id = it.goods_id
LEFT JOIN zdy_wcsc_goods_sku_price pr ON pr.id = it.goods_sku_price_id
LEFT JOIN sys_user su ON su.user_id = it.admin_id
</sql>
<select id="selectZdyWcscOrderItemList" parameterType="ZdyWcscOrderItem" resultMap="ZdyWcscOrderItemResult">
<include refid="selectZdyWcscOrderItemVo"/>
<where>
ISNULL(it.deletetime)
<if test="userId != null ">
and it.user_id = #{userId}
</if>
<if test="orderId != null ">
and it.order_id = #{orderId}
</if>
<if test="storeId != null ">
and it.store_id = #{storeId}
</if>
<if test="goodsId != null ">
and it.goods_id = #{goodsId}
</if>
<if test="adminId != null ">
and it.admin_id = #{adminId}
</if>
<if test="goodsSkuPriceId != null ">
and it.goods_sku_price_id = #{goodsSkuPriceId}
</if>
<if test="activityId != null ">
and it.activity_id = #{activityId}
</if>
<if test="activityType != null and activityType != ''">
and it.activity_type = #{activityType}
</if>
<if test="itemGoodsSkuPriceId != null ">
and it.item_goods_sku_price_id = #{itemGoodsSkuPriceId}
</if>
</where>
</select>
<select id="selectZdyWcscOrderItemById" parameterType="Long"
resultMap="ZdyWcscOrderItemResult">
<include refid="selectZdyWcscOrderItemVo"/>
where it.id = #{id}
</select>
<insert id="insertZdyWcscOrderItem" parameterType="ZdyWcscOrderItem" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_wcsc_order_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,
</if>
<if test="orderId != null">order_id,
</if>
<if test="storeId != null">store_id,
</if>
<if test="goodsId != null">goods_id,
</if>
<if test="adminId != null">admin_id,
</if>
<if test="goodsSkuPriceId != null">goods_sku_price_id,
</if>
<if test="activityId != null">activity_id,
</if>
<if test="activityType != null">activity_type,
</if>
<if test="itemGoodsSkuPriceId != null">item_goods_sku_price_id,
</if>
<if test="goodsSkuText != null">goods_sku_text,
</if>
<if test="goodsTitle != null">goods_title,
</if>
<if test="goodsImage != null">goods_image,
</if>
<if test="goodsOriginalPrice != null">goods_original_price,
</if>
<if test="discountFee != null">discount_fee,
</if>
<if test="totalPrice != null">total_price,
</if>
<if test="goodsPrice!= null">goods_price,
</if>
<if test="payPrice!= null">pay_price,
</if>
<if test="goodsNum != null">goods_num,
</if>
<if test="dispatchStatus != null">dispatch_status,
</if>
<if test="dispatchFee != null">dispatch_fee,
</if>
<if test="dispatchType != null">dispatch_type,
</if>
<if test="dispatchId != null">dispatch_id,
</if>
<if test="aftersaleStatus != null">aftersale_status,
</if>
<if test="commentStatus != null">comment_status,
</if>
<if test="refundStatus != null">refund_status,
</if>
<if test="refundFee != null">refund_fee,
</if>
<if test="refundCause != null">refund_cause,
</if>
<if test="refundMsg != null">refund_msg,
</if>
<if test="expressName != null">express_name,
</if>
<if test="expressNo != null">express_no,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="deletetime != null">deletetime,
</if>
<if test="read != null">`read`,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},
</if>
<if test="orderId != null">#{orderId},
</if>
<if test="storeId != null">#{storeId},
</if>
<if test="goodsId != null">#{goodsId},
</if>
<if test="adminId != null">#{adminId},
</if>
<if test="goodsSkuPriceId != null">#{goodsSkuPriceId},
</if>
<if test="activityId != null">#{activityId},
</if>
<if test="activityType != null">#{activityType},
</if>
<if test="itemGoodsSkuPriceId != null">#{itemGoodsSkuPriceId},
</if>
<if test="goodsSkuText != null">#{goodsSkuText},
</if>
<if test="goodsTitle != null">#{goodsTitle},
</if>
<if test="goodsImage != null">#{goodsImage},
</if>
<if test="goodsOriginalPrice != null">#{goodsOriginalPrice},
</if>
<if test="discountFee != null">#{discountFee},
</if>
<if test="totalPrice != null">#{totalPrice},
</if>
<if test="goodsPrice!= null">#{goodsPrice},
</if>
<if test="payPrice!= null">#{payPrice},
</if>
<if test="goodsNum != null">#{goodsNum},
</if>
<if test="dispatchStatus != null">#{dispatchStatus},
</if>
<if test="dispatchFee != null">#{dispatchFee},
</if>
<if test="dispatchType != null">#{dispatchType},
</if>
<if test="dispatchId != null">#{dispatchId},
</if>
<if test="aftersaleStatus != null">#{aftersaleStatus},
</if>
<if test="commentStatus != null">#{commentStatus},
</if>
<if test="refundStatus != null">#{refundStatus},
</if>
<if test="refundFee != null">#{refundFee},
</if>
<if test="refundCause != null">#{refundCause},
</if>
<if test="refundMsg != null">#{refundMsg},
</if>
<if test="expressName != null">#{expressName},
</if>
<if test="expressNo != null">#{expressNo},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="deletetime != null">#{deletetime},
</if>
<if test="read != null">#{read},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyWcscOrderItem" parameterType="ZdyWcscOrderItem">
update zdy_wcsc_order_item
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id =
#{userId},
</if>
<if test="orderId != null">order_id =
#{orderId},
</if>
<if test="storeId != null">store_id =
#{storeId},
</if>
<if test="goodsId != null">goods_id =
#{goodsId},
</if>
<if test="adminId != null">admin_id =
#{adminId},
</if>
<if test="goodsSkuPriceId != null">goods_sku_price_id =
#{goodsSkuPriceId},
</if>
<if test="activityId != null">activity_id =
#{activityId},
</if>
<if test="activityType != null">activity_type =
#{activityType},
</if>
<if test="itemGoodsSkuPriceId != null">item_goods_sku_price_id =
#{itemGoodsSkuPriceId},
</if>
<if test="goodsSkuText != null">goods_sku_text =
#{goodsSkuText},
</if>
<if test="goodsTitle != null">goods_title =
#{goodsTitle},
</if>
<if test="goodsImage != null">goods_image =
#{goodsImage},
</if>
<if test="goodsOriginalPrice != null">goods_original_price =
#{goodsOriginalPrice},
</if>
<if test="discountFee != null">discount_fee =
#{discountFee},
</if>
<if test="totalPrice != null">total_price =
#{totalPrice},
</if>
<if test="goodsPrice != null">goods_price =
#{goodsPrice},
</if>
<if test="payPrice != null">pay_price =
#{payPrice},
</if>
<if test="goodsNum != null">goods_num =
#{goodsNum},
</if>
<if test="dispatchStatus != null">dispatch_status =
#{dispatchStatus},
</if>
<if test="dispatchFee != null">dispatch_fee =
#{dispatchFee},
</if>
<if test="dispatchType != null">dispatch_type =
#{dispatchType},
</if>
<if test="dispatchId != null">dispatch_id =
#{dispatchId},
</if>
<if test="aftersaleStatus != null">aftersale_status =
#{aftersaleStatus},
</if>
<if test="commentStatus != null">comment_status =
#{commentStatus},
</if>
<if test="refundStatus != null">refund_status =
#{refundStatus},
</if>
<if test="refundFee != null">refund_fee =
#{refundFee},
</if>
<if test="refundCause != null">refund_cause =
#{refundCause},
</if>
<if test="refundMsg != null">refund_msg =
#{refundMsg},
</if>
<if test="expressName != null">express_name =
#{expressName},
</if>
<if test="expressNo != null">express_no =
#{expressNo},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="deletetime != null">deletetime =
#{deletetime},
</if>
<if test="read != null">`read` =
#{read},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyWcscOrderItemById" parameterType="Long">
delete
from zdy_wcsc_order_item
where id = #{id}
</delete>
<delete id="deleteZdyWcscOrderItemByIds" parameterType="String">
delete from zdy_wcsc_order_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyWcscOrderItemByOrderId"
resultMap="ZdyWcscOrderItemResult">
<include refid="selectZdyWcscOrderItemVo"/>
where it.order_id = #{orderId}
<if test="dispatchStatus != null">
and it.dispatch_status = #{dispatchStatus}
</if>
</select>
<select id="selectZdyWcscOrderItemByIds" parameterType="String" resultMap="ZdyWcscOrderItemResult">
select * from zdy_wcsc_order_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectOrderItemAllReceipt" resultMap="ZdyWcscOrderItemResult">
select * from zdy_wcsc_order_item
where order_id = #{orderId}
and dispatch_status in (0, 1)
and aftersale_status = 0
and refund_status = 0
</select>
</mapper>