158 lines
5.7 KiB
XML
158 lines
5.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.TbMemberInMapper">
|
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
|
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
|
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
|
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
|
<result column="trade_no" jdbcType="VARCHAR" property="tradeNo" />
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, user_id, merchant_id, code, amount, status, order_no, trade_no, create_time,
|
|
update_time,shop_id
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from tb_member_in
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from tb_member_in
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn" useGeneratedKeys="true" keyProperty="id">
|
|
insert into tb_member_in (id, user_id, merchant_id,
|
|
code, amount, status,
|
|
order_no, trade_no, create_time,
|
|
update_time,shop_id)
|
|
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER},
|
|
#{code,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
|
|
#{orderNo,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
#{updateTime,jdbcType=TIMESTAMP},#{shopId,jdbcType=INTEGER})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
|
insert into tb_member_in
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="merchantId != null">
|
|
merchant_id,
|
|
</if>
|
|
<if test="code != null">
|
|
code,
|
|
</if>
|
|
<if test="amount != null">
|
|
amount,
|
|
</if>
|
|
<if test="status != null">
|
|
status,
|
|
</if>
|
|
<if test="orderNo != null">
|
|
order_no,
|
|
</if>
|
|
<if test="tradeNo != null">
|
|
trade_no,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="merchantId != null">
|
|
#{merchantId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="code != null">
|
|
#{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="amount != null">
|
|
#{amount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="status != null">
|
|
#{status,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="orderNo != null">
|
|
#{orderNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="tradeNo != null">
|
|
#{tradeNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
|
update tb_member_in
|
|
<set>
|
|
<if test="userId != null">
|
|
user_id = #{userId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="merchantId != null">
|
|
merchant_id = #{merchantId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="code != null">
|
|
code = #{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="amount != null">
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="status != null">
|
|
status = #{status,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="orderNo != null">
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="tradeNo != null">
|
|
trade_no = #{tradeNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
|
update tb_member_in
|
|
set user_id = #{userId,jdbcType=INTEGER},
|
|
merchant_id = #{merchantId,jdbcType=INTEGER},
|
|
code = #{code,jdbcType=VARCHAR},
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
status = #{status,jdbcType=VARCHAR},
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
|
trade_no = #{tradeNo,jdbcType=VARCHAR},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
<select id="selectByOrderNo" resultMap="BaseResultMap">
|
|
select * from tb_member_in where order_no=#{ordrNo}
|
|
</select>
|
|
</mapper> |