192 lines
8.6 KiB
XML
192 lines
8.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.chaozhanggui.system.cashierservice.dao.TbGroupOrderInfoMapper">
|
|
|
|
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbGroupOrderInfo" id="TbGroupOrderInfoMap">
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
<result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
|
<result property="merchantId" column="merchant_id" jdbcType="INTEGER"/>
|
|
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
|
<result property="proId" column="pro_id" jdbcType="INTEGER"/>
|
|
<result property="proImg" column="pro_img" jdbcType="VARCHAR"/>
|
|
<result property="proName" column="pro_name" jdbcType="VARCHAR"/>
|
|
<result property="expDate" column="exp_date" jdbcType="TIMESTAMP"/>
|
|
<result property="orderType" column="order_type" jdbcType="VARCHAR"/>
|
|
<result property="payType" column="pay_type" jdbcType="VARCHAR"/>
|
|
<result property="orderAmount" column="order_amount" jdbcType="NUMERIC"/>
|
|
<result property="saveAmount" column="save_amount" jdbcType="NUMERIC"/>
|
|
<result property="payAmount" column="pay_amount" jdbcType="NUMERIC"/>
|
|
<result property="refundAmount" column="refund_amount" jdbcType="NUMERIC"/>
|
|
<result property="refundNumber" column="refund_number" jdbcType="INTEGER"/>
|
|
<result property="number" column="number" jdbcType="INTEGER"/>
|
|
<result property="status" column="status" jdbcType="VARCHAR"/>
|
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
|
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
|
<result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
|
|
<result property="refundAble" column="refund_able" jdbcType="INTEGER"/>
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
<result property="verifier" column="verifier" jdbcType="VARCHAR"/>
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
<result property="payOrderNo" column="pay_order_no" jdbcType="VARCHAR"/>
|
|
<result property="tradeDay" column="trade_day" jdbcType="TIMESTAMP"/>
|
|
<result property="source" column="source" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
id
|
|
, order_no, merchant_id, shop_id, user_id, pro_id, pro_img, pro_name, exp_date, order_type, pay_type, order_amount, save_amount, pay_amount, refund_amount, refund_number, number, status, remark, phone, pay_time, refund_able, create_time, verifier, update_time, pay_order_no, trade_day, source </sql>
|
|
<sql id="List_Column">
|
|
id
|
|
, order_no, pro_name,pro_img,order_amount, pay_amount, number, status </sql>
|
|
|
|
<!--查询单个-->
|
|
<select id="queryById" resultMap="TbGroupOrderInfoMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
|
|
from tb_group_order_info
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<select id="selectByPayOrderNo" resultMap="TbGroupOrderInfoMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
|
|
from tb_group_order_info
|
|
where pay_order_no = #{payOrderNO}
|
|
</select>
|
|
|
|
<!--查询指定行数据-->
|
|
<select id="queryAll" resultType="com.chaozhanggui.system.cashierservice.entity.vo.GroupOrderListVo">
|
|
select
|
|
<include refid="List_Column"/>
|
|
|
|
from tb_group_order_info
|
|
<where>
|
|
<if test="userId != null">
|
|
and user_id = #{userId}
|
|
</if>
|
|
<if test="proName != null and proName != ''">
|
|
and pro_name = #{proName}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
and status = #{status}
|
|
</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<!--新增所有列-->
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
insert into tb_group_order_info(order_no, merchant_id, shop_id, user_id, pro_id, pro_name, pro_img,
|
|
exp_date, order_type, pay_type, order_amount, save_amount, pay_amount, number,
|
|
refund_number, status,
|
|
remark, phone, pay_time, refund_able, create_time, update_time, pay_order_no,
|
|
trade_day, source)
|
|
values (#{orderNo}, #{merchantId}, #{shopId}, #{userId}, #{proId}, #{proName}, #{proImg},
|
|
#{expDate}, #{orderType}, #{payType}, #{orderAmount}, #{saveAmount}, #{payAmount}, #{number},
|
|
#{refundNumber}, #{status}, #{remark},
|
|
#{phone}, #{payTime}, #{refundAble}, #{createTime}, #{updateTime}, #{payOrderNo}, #{tradeDay},
|
|
#{source})
|
|
</insert>
|
|
|
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
insert into tb_group_order_info(order_no,merchant_id, shop_id, user_id, pro_id, pro_name, pro_img,
|
|
exp_date, order_type, pay_type, order_amount, save_amount, pay_amount, number, status, remark, phone, pay_time,
|
|
refund_able, create_time, update_time, pay_order_no, trade_day, source)
|
|
values
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
(#{entity.orderNo},#{entity.merchantId} #{entity.shopId}, #{entity.userId}, #{entity.proId},
|
|
#{entity.proName},#{entity.proImg},
|
|
#{entity.expDate}, #{entity.orderType},
|
|
#{entity.payType}, #{entity.orderAmount}, #{entity.saveAmount}, #{entity.payAmount}, #{entity.number},
|
|
#{entity.status},
|
|
#{entity.remark}, #{entity.phone}, #{entity.payTime}, #{entity.refundAble}, #{entity.createTime},
|
|
#{entity.updateTime}, #{entity.payOrderNo}, #{entity.tradeDay}, #{entity.source})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<!--通过主键修改数据-->
|
|
<update id="update">
|
|
update tb_group_order_info
|
|
<set>
|
|
<if test="orderNo != null and orderNo != ''">
|
|
order_no = #{orderNo},
|
|
</if>
|
|
<if test="merchantId != null">
|
|
merchant_id = #{merchantId},
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id = #{shopId},
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id = #{userId},
|
|
</if>
|
|
<if test="proId != null">
|
|
pro_id = #{proId},
|
|
</if>
|
|
<if test="proName != null and proName != ''">
|
|
pro_name = #{proName},
|
|
</if>
|
|
<if test="proImg != null and proImg != ''">
|
|
pro_img = #{proImg},
|
|
</if>
|
|
<if test="expDate != null">
|
|
exp_date = #{expDate},
|
|
</if>
|
|
<if test="orderType != null and orderType != ''">
|
|
order_type = #{orderType},
|
|
</if>
|
|
<if test="payType != null and payType != ''">
|
|
pay_type = #{payType},
|
|
</if>
|
|
<if test="orderAmount != null">
|
|
order_amount = #{orderAmount},
|
|
</if>
|
|
<if test="saveAmount != null">
|
|
save_amount = #{saveAmount},
|
|
</if>
|
|
<if test="payAmount != null">
|
|
pay_amount = #{payAmount},
|
|
</if>
|
|
<if test="number != null">
|
|
number = #{number},
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
status = #{status},
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
remark = #{remark},
|
|
</if>
|
|
<if test="phone != null and phone != ''">
|
|
phone = #{phone},
|
|
</if>
|
|
<if test="payTime != null">
|
|
pay_time = #{payTime},
|
|
</if>
|
|
<if test="refundAble != null">
|
|
refund_able = #{refundAble},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time = #{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time = #{updateTime},
|
|
</if>
|
|
<if test="payOrderNo != null and payOrderNo != ''">
|
|
pay_order_no = #{payOrderNo},
|
|
</if>
|
|
<if test="tradeDay != null">
|
|
trade_day = #{tradeDay},
|
|
</if>
|
|
<if test="source != null">
|
|
source = #{source},
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
</mapper>
|
|
|