132 lines
5.1 KiB
XML
132 lines
5.1 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.TbSystemCouponsMapper">
|
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
<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="type_name" jdbcType="VARCHAR" property="typeName" />
|
|
<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, name, coupons_price, coupons_amount, status, create_time, update_time, end_time,type_name
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from tb_system_coupons
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<select id="selectAll" resultType="com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons">
|
|
select * from tb_system_coupons where status = '0' and name = #{type}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from tb_system_coupons
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons">
|
|
insert into tb_system_coupons (id, name, coupons_price,
|
|
coupons_amount, status, create_time,
|
|
update_time, end_time,type_name)
|
|
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
|
#{couponsAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{typeName,jdbcType=VARCHAR})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons">
|
|
insert into tb_system_coupons
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</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="name != null">
|
|
#{name,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.TbSystemCoupons">
|
|
update tb_system_coupons
|
|
<set>
|
|
<if test="name != null">
|
|
name = #{name,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.TbSystemCoupons">
|
|
update tb_system_coupons
|
|
set name = #{name,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> |