新建分支
This commit is contained in:
134
src/main/resources/mapper/TbUserCouponsMapper.xml
Normal file
134
src/main/resources/mapper/TbUserCouponsMapper.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?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.TbUserCouponsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="coupons_price" jdbcType="DECIMAL" property="couponsPrice" />
|
||||
<result column="coupons_amount" jdbcType="DECIMAL" property="couponsAmount" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, coupons_price, coupons_amount, status, create_time, update_time, end_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_user_coupons
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByUserId" resultType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
select * from tb_user_coupons where user_id = #{userId}
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_user_coupons
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_user_coupons (id, user_id, coupons_price,
|
||||
coupons_amount, status, create_time,
|
||||
update_time, end_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
||||
#{couponsAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
insert into tb_user_coupons
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
coupons_price,
|
||||
</if>
|
||||
<if test="couponsAmount != null">
|
||||
coupons_amount,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
#{couponsPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="couponsAmount != null">
|
||||
#{couponsAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
update tb_user_coupons
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="couponsAmount != null">
|
||||
coupons_amount = #{couponsAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
update tb_user_coupons
|
||||
set user_id = #{userId,jdbcType=VARCHAR},
|
||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||
coupons_amount = #{couponsAmount,jdbcType=DECIMAL},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user