Files
wx-cashier-service/src/main/resources/mapper/TbWiningUserMapper.xml
2024-04-10 18:16:28 +08:00

180 lines
6.7 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.TbWiningUserMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
<result column="is_user" jdbcType="VARCHAR" property="isUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="is_refund" jdbcType="VARCHAR" property="isRefund" />
<result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
<result column="refund_no" jdbcType="VARCHAR" property="refundNo" />
<result column="refund_pay_type" jdbcType="VARCHAR" property="refundPayType" />
<result column="trade_day" jdbcType="VARCHAR" property="tradeDay" />
<result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" />
</resultMap>
<sql id="Base_Column_List">
id, user_name, order_no, order_amount, is_user, create_time, is_refund, refund_amount,
refund_no, refund_pay_type, trade_day, refund_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_wining_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_wining_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
insert into tb_wining_user (id, user_name, order_no,
order_amount, is_user, create_time,
is_refund, refund_amount, refund_no,
refund_pay_type, trade_day, refund_time
)
values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL}, #{isUser,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{isRefund,jdbcType=VARCHAR}, #{refundAmount,jdbcType=DECIMAL}, #{refundNo,jdbcType=VARCHAR},
#{refundPayType,jdbcType=VARCHAR}, #{tradeDay,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
insert into tb_wining_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="orderNo != null">
order_no,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="isUser != null">
is_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="isRefund != null">
is_refund,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="refundNo != null">
refund_no,
</if>
<if test="refundPayType != null">
refund_pay_type,
</if>
<if test="tradeDay != null">
trade_day,
</if>
<if test="refundTime != null">
refund_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="orderNo != null">
#{orderNo,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="isUser != null">
#{isUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="isRefund != null">
#{isRefund,jdbcType=VARCHAR},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundNo != null">
#{refundNo,jdbcType=VARCHAR},
</if>
<if test="refundPayType != null">
#{refundPayType,jdbcType=VARCHAR},
</if>
<if test="tradeDay != null">
#{tradeDay,jdbcType=VARCHAR},
</if>
<if test="refundTime != null">
#{refundTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
update tb_wining_user
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="orderNo != null">
order_no = #{orderNo,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=DECIMAL},
</if>
<if test="isUser != null">
is_user = #{isUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="isRefund != null">
is_refund = #{isRefund,jdbcType=VARCHAR},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundNo != null">
refund_no = #{refundNo,jdbcType=VARCHAR},
</if>
<if test="refundPayType != null">
refund_pay_type = #{refundPayType,jdbcType=VARCHAR},
</if>
<if test="tradeDay != null">
trade_day = #{tradeDay,jdbcType=VARCHAR},
</if>
<if test="refundTime != null">
refund_time = #{refundTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
update tb_wining_user
set user_name = #{userName,jdbcType=VARCHAR},
order_no = #{orderNo,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
is_user = #{isUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
is_refund = #{isRefund,jdbcType=VARCHAR},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
refund_no = #{refundNo,jdbcType=VARCHAR},
refund_pay_type = #{refundPayType,jdbcType=VARCHAR},
trade_day = #{tradeDay,jdbcType=VARCHAR},
refund_time = #{refundTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectAllByTrade" resultType="com.chaozhanggui.system.cashierservice.entity.TbWiningUser">
select * from tb_wining_user where trade_day = #{day}
</select>
</mapper>