You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
8.2 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.sztzjy.marketing.mapper.StuSpendingLevelMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuSpendingLevel">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="gender" jdbcType="INTEGER" property="gender" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="annual_income" jdbcType="INTEGER" property="annualIncome" />
<result column="spending_score" jdbcType="INTEGER" property="spendingScore" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, gender, age, annual_income, spending_score
</sql>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuSpendingLevelExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_spending_level
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_spending_level
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_spending_level
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuSpendingLevelExample">
delete from stu_spending_level
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuSpendingLevel">
insert into stu_spending_level (id, gender, age,
annual_income, spending_score)
values (#{id,jdbcType=INTEGER}, #{gender,jdbcType=INTEGER}, #{age,jdbcType=INTEGER},
#{annualIncome,jdbcType=INTEGER}, #{spendingScore,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuSpendingLevel">
insert into stu_spending_level
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="gender != null">
gender,
</if>
<if test="age != null">
age,
</if>
<if test="annualIncome != null">
annual_income,
</if>
<if test="spendingScore != null">
spending_score,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="gender != null">
#{gender,jdbcType=INTEGER},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="annualIncome != null">
#{annualIncome,jdbcType=INTEGER},
</if>
<if test="spendingScore != null">
#{spendingScore,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuSpendingLevelExample" resultType="java.lang.Long">
select count(*) from stu_spending_level
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_spending_level
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=INTEGER},
</if>
<if test="record.age != null">
age = #{record.age,jdbcType=INTEGER},
</if>
<if test="record.annualIncome != null">
annual_income = #{record.annualIncome,jdbcType=INTEGER},
</if>
<if test="record.spendingScore != null">
spending_score = #{record.spendingScore,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_spending_level
set id = #{record.id,jdbcType=INTEGER},
gender = #{record.gender,jdbcType=INTEGER},
age = #{record.age,jdbcType=INTEGER},
annual_income = #{record.annualIncome,jdbcType=INTEGER},
spending_score = #{record.spendingScore,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuSpendingLevel">
update stu_spending_level
<set>
<if test="gender != null">
gender = #{gender,jdbcType=INTEGER},
</if>
<if test="age != null">
age = #{age,jdbcType=INTEGER},
</if>
<if test="annualIncome != null">
annual_income = #{annualIncome,jdbcType=INTEGER},
</if>
<if test="spendingScore != null">
spending_score = #{spendingScore,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuSpendingLevel">
update stu_spending_level
set gender = #{gender,jdbcType=INTEGER},
age = #{age,jdbcType=INTEGER},
annual_income = #{annualIncome,jdbcType=INTEGER},
spending_score = #{spendingScore,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="addList">
INSERT INTO tch_start_course_name_list (id, gender, age, annual_income, spending_score)
VALUES
<foreach collection="stuSpendingLevels" item="stuSpendingLevel" separator=",">
(#{stuSpendingLevel.id}, #{stuSpendingLevel.gender}, #{stuSpendingLevel.age}, #{stuSpendingLevel.annual_income}, #{stuSpendingLevel.spending_score})
</foreach>
</insert>
</mapper>