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

97 lines
3.8 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.TbWiningParamsMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="min_price" jdbcType="DECIMAL" property="minPrice" />
<result column="max_price" jdbcType="DECIMAL" property="maxPrice" />
<result column="wining_num" jdbcType="INTEGER" property="winingNum" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="wining_user_num" jdbcType="INTEGER" property="winingUserNum" />
</resultMap>
<sql id="Base_Column_List">
id, min_price, max_price, wining_num, wining_user_num,status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_wining_params
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultType="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
select * from tb_wining_params where status = 'true'
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_wining_params
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
insert into tb_wining_params (id, min_price, max_price,
wining_num, wining_user_num)
values (#{id,jdbcType=INTEGER}, #{minPrice,jdbcType=DECIMAL}, #{maxPrice,jdbcType=DECIMAL},
#{winingNum,jdbcType=INTEGER}, #{winingUserNum,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
insert into tb_wining_params
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="minPrice != null">
min_price,
</if>
<if test="maxPrice != null">
max_price,
</if>
<if test="winingNum != null">
wining_num,
</if>
<if test="winingUserNum != null">
wining_user_num,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="minPrice != null">
#{minPrice,jdbcType=DECIMAL},
</if>
<if test="maxPrice != null">
#{maxPrice,jdbcType=DECIMAL},
</if>
<if test="winingNum != null">
#{winingNum,jdbcType=INTEGER},
</if>
<if test="winingUserNum != null">
#{winingUserNum,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
update tb_wining_params
<set>
<if test="minPrice != null">
min_price = #{minPrice,jdbcType=DECIMAL},
</if>
<if test="maxPrice != null">
max_price = #{maxPrice,jdbcType=DECIMAL},
</if>
<if test="winingNum != null">
wining_num = #{winingNum,jdbcType=INTEGER},
</if>
<if test="winingUserNum != null">
wining_user_num = #{winingUserNum,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbWiningParams">
update tb_wining_params
set min_price = #{minPrice,jdbcType=DECIMAL},
max_price = #{maxPrice,jdbcType=DECIMAL},
wining_num = #{winingNum,jdbcType=INTEGER},
wining_user_num = #{winingUserNum,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>