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

576 lines
23 KiB

<?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.ccsens.ht.persist.mapper.HtPatientPersionalMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtPatientPersional">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="patient_id" jdbcType="BIGINT" property="patientId" />
<result column="smoking_history" jdbcType="TINYINT" property="smokingHistory" />
<result column="smoking_year" jdbcType="INTEGER" property="smokingYear" />
<result column="smoking_amount" jdbcType="INTEGER" property="smokingAmount" />
<result column="smoking_quit" jdbcType="TINYINT" property="smokingQuit" />
<result column="smoking_quit_year" jdbcType="INTEGER" property="smokingQuitYear" />
<result column="drink_history" jdbcType="TINYINT" property="drinkHistory" />
<result column="drink_year" jdbcType="INTEGER" property="drinkYear" />
<result column="drink_type" jdbcType="VARCHAR" property="drinkType" />
<result column="drink_amount" jdbcType="INTEGER" property="drinkAmount" />
<result column="tea_coffee_history" jdbcType="TINYINT" property="teaCoffeeHistory" />
<result column="tea_coffee_year" jdbcType="INTEGER" property="teaCoffeeYear" />
<result column="tea_coffee_type" jdbcType="VARCHAR" property="teaCoffeeType" />
<result column="tea_coffee_frequency" jdbcType="TINYINT" property="teaCoffeeFrequency" />
<result column="tea_coffee_quit" jdbcType="TINYINT" property="teaCoffeeQuit" />
<result column="tea_coffee_quit_year" jdbcType="INTEGER" property="teaCoffeeQuitYear" />
<result column="dietary_habit" jdbcType="VARCHAR" property="dietaryHabit" />
<result column="workout_time" jdbcType="TINYINT" property="workoutTime" />
<result column="sleep_time" jdbcType="INTEGER" property="sleepTime" />
<result column="snore" jdbcType="TINYINT" property="snore" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
<result column="drink_quit" jdbcType="TINYINT" property="drinkQuit" />
<result column="drink_quit_year" jdbcType="INTEGER" property="drinkQuitYear" />
</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, patient_id, smoking_history, smoking_year, smoking_amount, smoking_quit, smoking_quit_year,
drink_history, drink_year, drink_type, drink_amount, tea_coffee_history, tea_coffee_year,
tea_coffee_type, tea_coffee_frequency, tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder,
drink_quit, drink_quit_year
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_patient_persional
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_ht_patient_persional
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_patient_persional
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample">
delete from t_ht_patient_persional
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
insert into t_ht_patient_persional (id, patient_id, smoking_history,
smoking_year, smoking_amount, smoking_quit,
smoking_quit_year, drink_history, drink_year,
drink_type, drink_amount, tea_coffee_history,
tea_coffee_year, tea_coffee_type, tea_coffee_frequency,
tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore,
remark, create_time, update_time,
is_del, recorder, drink_quit,
drink_quit_year)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{smokingHistory,jdbcType=TINYINT},
#{smokingYear,jdbcType=INTEGER}, #{smokingAmount,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER},
#{drinkType,jdbcType=VARCHAR}, #{drinkAmount,jdbcType=INTEGER}, #{teaCoffeeHistory,jdbcType=TINYINT},
#{teaCoffeeYear,jdbcType=INTEGER}, #{teaCoffeeType,jdbcType=VARCHAR}, #{teaCoffeeFrequency,jdbcType=TINYINT},
#{teaCoffeeQuit,jdbcType=TINYINT}, #{teaCoffeeQuitYear,jdbcType=INTEGER}, #{dietaryHabit,jdbcType=VARCHAR},
#{workoutTime,jdbcType=TINYINT}, #{sleepTime,jdbcType=INTEGER}, #{snore,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT}, #{drinkQuit,jdbcType=TINYINT},
#{drinkQuitYear,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
insert into t_ht_patient_persional
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="patientId != null">
patient_id,
</if>
<if test="smokingHistory != null">
smoking_history,
</if>
<if test="smokingYear != null">
smoking_year,
</if>
<if test="smokingAmount != null">
smoking_amount,
</if>
<if test="smokingQuit != null">
smoking_quit,
</if>
<if test="smokingQuitYear != null">
smoking_quit_year,
</if>
<if test="drinkHistory != null">
drink_history,
</if>
<if test="drinkYear != null">
drink_year,
</if>
<if test="drinkType != null">
drink_type,
</if>
<if test="drinkAmount != null">
drink_amount,
</if>
<if test="teaCoffeeHistory != null">
tea_coffee_history,
</if>
<if test="teaCoffeeYear != null">
tea_coffee_year,
</if>
<if test="teaCoffeeType != null">
tea_coffee_type,
</if>
<if test="teaCoffeeFrequency != null">
tea_coffee_frequency,
</if>
<if test="teaCoffeeQuit != null">
tea_coffee_quit,
</if>
<if test="teaCoffeeQuitYear != null">
tea_coffee_quit_year,
</if>
<if test="dietaryHabit != null">
dietary_habit,
</if>
<if test="workoutTime != null">
workout_time,
</if>
<if test="sleepTime != null">
sleep_time,
</if>
<if test="snore != null">
snore,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
<if test="drinkQuit != null">
drink_quit,
</if>
<if test="drinkQuitYear != null">
drink_quit_year,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="patientId != null">
#{patientId,jdbcType=BIGINT},
</if>
<if test="smokingHistory != null">
#{smokingHistory,jdbcType=TINYINT},
</if>
<if test="smokingYear != null">
#{smokingYear,jdbcType=INTEGER},
</if>
<if test="smokingAmount != null">
#{smokingAmount,jdbcType=INTEGER},
</if>
<if test="smokingQuit != null">
#{smokingQuit,jdbcType=TINYINT},
</if>
<if test="smokingQuitYear != null">
#{smokingQuitYear,jdbcType=INTEGER},
</if>
<if test="drinkHistory != null">
#{drinkHistory,jdbcType=TINYINT},
</if>
<if test="drinkYear != null">
#{drinkYear,jdbcType=INTEGER},
</if>
<if test="drinkType != null">
#{drinkType,jdbcType=VARCHAR},
</if>
<if test="drinkAmount != null">
#{drinkAmount,jdbcType=INTEGER},
</if>
<if test="teaCoffeeHistory != null">
#{teaCoffeeHistory,jdbcType=TINYINT},
</if>
<if test="teaCoffeeYear != null">
#{teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="teaCoffeeType != null">
#{teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="teaCoffeeFrequency != null">
#{teaCoffeeFrequency,jdbcType=TINYINT},
</if>
<if test="teaCoffeeQuit != null">
#{teaCoffeeQuit,jdbcType=TINYINT},
</if>
<if test="teaCoffeeQuitYear != null">
#{teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="dietaryHabit != null">
#{dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="workoutTime != null">
#{workoutTime,jdbcType=TINYINT},
</if>
<if test="sleepTime != null">
#{sleepTime,jdbcType=INTEGER},
</if>
<if test="snore != null">
#{snore,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
<if test="drinkQuit != null">
#{drinkQuit,jdbcType=TINYINT},
</if>
<if test="drinkQuitYear != null">
#{drinkQuitYear,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultType="java.lang.Long">
select count(*) from t_ht_patient_persional
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_patient_persional
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.patientId != null">
patient_id = #{record.patientId,jdbcType=BIGINT},
</if>
<if test="record.smokingHistory != null">
smoking_history = #{record.smokingHistory,jdbcType=TINYINT},
</if>
<if test="record.smokingYear != null">
smoking_year = #{record.smokingYear,jdbcType=INTEGER},
</if>
<if test="record.smokingAmount != null">
smoking_amount = #{record.smokingAmount,jdbcType=INTEGER},
</if>
<if test="record.smokingQuit != null">
smoking_quit = #{record.smokingQuit,jdbcType=TINYINT},
</if>
<if test="record.smokingQuitYear != null">
smoking_quit_year = #{record.smokingQuitYear,jdbcType=INTEGER},
</if>
<if test="record.drinkHistory != null">
drink_history = #{record.drinkHistory,jdbcType=TINYINT},
</if>
<if test="record.drinkYear != null">
drink_year = #{record.drinkYear,jdbcType=INTEGER},
</if>
<if test="record.drinkType != null">
drink_type = #{record.drinkType,jdbcType=VARCHAR},
</if>
<if test="record.drinkAmount != null">
drink_amount = #{record.drinkAmount,jdbcType=INTEGER},
</if>
<if test="record.teaCoffeeHistory != null">
tea_coffee_history = #{record.teaCoffeeHistory,jdbcType=TINYINT},
</if>
<if test="record.teaCoffeeYear != null">
tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="record.teaCoffeeType != null">
tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="record.teaCoffeeFrequency != null">
tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT},
</if>
<if test="record.teaCoffeeQuit != null">
tea_coffee_quit = #{record.teaCoffeeQuit,jdbcType=TINYINT},
</if>
<if test="record.teaCoffeeQuitYear != null">
tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="record.dietaryHabit != null">
dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="record.workoutTime != null">
workout_time = #{record.workoutTime,jdbcType=TINYINT},
</if>
<if test="record.sleepTime != null">
sleep_time = #{record.sleepTime,jdbcType=INTEGER},
</if>
<if test="record.snore != null">
snore = #{record.snore,jdbcType=TINYINT},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
<if test="record.drinkQuit != null">
drink_quit = #{record.drinkQuit,jdbcType=TINYINT},
</if>
<if test="record.drinkQuitYear != null">
drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_patient_persional
set id = #{record.id,jdbcType=BIGINT},
patient_id = #{record.patientId,jdbcType=BIGINT},
smoking_history = #{record.smokingHistory,jdbcType=TINYINT},
smoking_year = #{record.smokingYear,jdbcType=INTEGER},
smoking_amount = #{record.smokingAmount,jdbcType=INTEGER},
smoking_quit = #{record.smokingQuit,jdbcType=TINYINT},
smoking_quit_year = #{record.smokingQuitYear,jdbcType=INTEGER},
drink_history = #{record.drinkHistory,jdbcType=TINYINT},
drink_year = #{record.drinkYear,jdbcType=INTEGER},
drink_type = #{record.drinkType,jdbcType=VARCHAR},
drink_amount = #{record.drinkAmount,jdbcType=INTEGER},
tea_coffee_history = #{record.teaCoffeeHistory,jdbcType=TINYINT},
tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER},
tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR},
tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT},
tea_coffee_quit = #{record.teaCoffeeQuit,jdbcType=TINYINT},
tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER},
dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR},
workout_time = #{record.workoutTime,jdbcType=TINYINT},
sleep_time = #{record.sleepTime,jdbcType=INTEGER},
snore = #{record.snore,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT},
drink_quit = #{record.drinkQuit,jdbcType=TINYINT},
drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
update t_ht_patient_persional
<set>
<if test="patientId != null">
patient_id = #{patientId,jdbcType=BIGINT},
</if>
<if test="smokingHistory != null">
smoking_history = #{smokingHistory,jdbcType=TINYINT},
</if>
<if test="smokingYear != null">
smoking_year = #{smokingYear,jdbcType=INTEGER},
</if>
<if test="smokingAmount != null">
smoking_amount = #{smokingAmount,jdbcType=INTEGER},
</if>
<if test="smokingQuit != null">
smoking_quit = #{smokingQuit,jdbcType=TINYINT},
</if>
<if test="smokingQuitYear != null">
smoking_quit_year = #{smokingQuitYear,jdbcType=INTEGER},
</if>
<if test="drinkHistory != null">
drink_history = #{drinkHistory,jdbcType=TINYINT},
</if>
<if test="drinkYear != null">
drink_year = #{drinkYear,jdbcType=INTEGER},
</if>
<if test="drinkType != null">
drink_type = #{drinkType,jdbcType=VARCHAR},
</if>
<if test="drinkAmount != null">
drink_amount = #{drinkAmount,jdbcType=INTEGER},
</if>
<if test="teaCoffeeHistory != null">
tea_coffee_history = #{teaCoffeeHistory,jdbcType=TINYINT},
</if>
<if test="teaCoffeeYear != null">
tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="teaCoffeeType != null">
tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="teaCoffeeFrequency != null">
tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT},
</if>
<if test="teaCoffeeQuit != null">
tea_coffee_quit = #{teaCoffeeQuit,jdbcType=TINYINT},
</if>
<if test="teaCoffeeQuitYear != null">
tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="dietaryHabit != null">
dietary_habit = #{dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="workoutTime != null">
workout_time = #{workoutTime,jdbcType=TINYINT},
</if>
<if test="sleepTime != null">
sleep_time = #{sleepTime,jdbcType=INTEGER},
</if>
<if test="snore != null">
snore = #{snore,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,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="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
<if test="drinkQuit != null">
drink_quit = #{drinkQuit,jdbcType=TINYINT},
</if>
<if test="drinkQuitYear != null">
drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
update t_ht_patient_persional
set patient_id = #{patientId,jdbcType=BIGINT},
smoking_history = #{smokingHistory,jdbcType=TINYINT},
smoking_year = #{smokingYear,jdbcType=INTEGER},
smoking_amount = #{smokingAmount,jdbcType=INTEGER},
smoking_quit = #{smokingQuit,jdbcType=TINYINT},
smoking_quit_year = #{smokingQuitYear,jdbcType=INTEGER},
drink_history = #{drinkHistory,jdbcType=TINYINT},
drink_year = #{drinkYear,jdbcType=INTEGER},
drink_type = #{drinkType,jdbcType=VARCHAR},
drink_amount = #{drinkAmount,jdbcType=INTEGER},
tea_coffee_history = #{teaCoffeeHistory,jdbcType=TINYINT},
tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER},
tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR},
tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT},
tea_coffee_quit = #{teaCoffeeQuit,jdbcType=TINYINT},
tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER},
dietary_habit = #{dietaryHabit,jdbcType=VARCHAR},
workout_time = #{workoutTime,jdbcType=TINYINT},
sleep_time = #{sleepTime,jdbcType=INTEGER},
snore = #{snore,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT},
drink_quit = #{drinkQuit,jdbcType=TINYINT},
drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>