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.
323 lines
12 KiB
323 lines
12 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.health.persist.mapper.JourneyMapper">
|
|
<resultMap id="BaseResultMap" type="com.ccsens.health.bean.po.Journey">
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
|
<result column="trip_mode" jdbcType="TINYINT" property="tripMode" />
|
|
<result column="car_no" jdbcType="VARCHAR" property="carNo" />
|
|
<result column="start_time" jdbcType="BIGINT" property="startTime" />
|
|
<result column="end_time" jdbcType="BIGINT" property="endTime" />
|
|
<result column="journey_type" jdbcType="TINYINT" property="journeyType" />
|
|
<result column="together" jdbcType="VARCHAR" property="together" />
|
|
<result column="self_fill" jdbcType="TINYINT" property="selfFill" />
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
|
|
</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, user_id, trip_mode, car_no, start_time, end_time, journey_type, together, self_fill,
|
|
created_at, updated_at, rec_status
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.ccsens.health.bean.po.JourneyExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from t_journey
|
|
<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_journey
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
delete from t_journey
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="com.ccsens.health.bean.po.JourneyExample">
|
|
delete from t_journey
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.ccsens.health.bean.po.Journey">
|
|
insert into t_journey (id, user_id, trip_mode,
|
|
car_no, start_time, end_time,
|
|
journey_type, together, self_fill,
|
|
created_at, updated_at, rec_status
|
|
)
|
|
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{tripMode,jdbcType=TINYINT},
|
|
#{carNo,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
|
|
#{journeyType,jdbcType=TINYINT}, #{together,jdbcType=VARCHAR}, #{selfFill,jdbcType=TINYINT},
|
|
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.ccsens.health.bean.po.Journey">
|
|
insert into t_journey
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="tripMode != null">
|
|
trip_mode,
|
|
</if>
|
|
<if test="carNo != null">
|
|
car_no,
|
|
</if>
|
|
<if test="startTime != null">
|
|
start_time,
|
|
</if>
|
|
<if test="endTime != null">
|
|
end_time,
|
|
</if>
|
|
<if test="journeyType != null">
|
|
journey_type,
|
|
</if>
|
|
<if test="together != null">
|
|
together,
|
|
</if>
|
|
<if test="selfFill != null">
|
|
self_fill,
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at,
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at,
|
|
</if>
|
|
<if test="recStatus != null">
|
|
rec_status,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="tripMode != null">
|
|
#{tripMode,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="carNo != null">
|
|
#{carNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="startTime != null">
|
|
#{startTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="endTime != null">
|
|
#{endTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="journeyType != null">
|
|
#{journeyType,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="together != null">
|
|
#{together,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="selfFill != null">
|
|
#{selfFill,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
#{createdAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
#{updatedAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="recStatus != null">
|
|
#{recStatus,jdbcType=TINYINT},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.ccsens.health.bean.po.JourneyExample" resultType="java.lang.Long">
|
|
select count(*) from t_journey
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update t_journey
|
|
<set>
|
|
<if test="record.id != null">
|
|
id = #{record.id,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.userId != null">
|
|
user_id = #{record.userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.tripMode != null">
|
|
trip_mode = #{record.tripMode,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="record.carNo != null">
|
|
car_no = #{record.carNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.startTime != null">
|
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.endTime != null">
|
|
end_time = #{record.endTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.journeyType != null">
|
|
journey_type = #{record.journeyType,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="record.together != null">
|
|
together = #{record.together,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.selfFill != null">
|
|
self_fill = #{record.selfFill,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="record.createdAt != null">
|
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.updatedAt != null">
|
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.recStatus != null">
|
|
rec_status = #{record.recStatus,jdbcType=TINYINT},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update t_journey
|
|
set id = #{record.id,jdbcType=BIGINT},
|
|
user_id = #{record.userId,jdbcType=BIGINT},
|
|
trip_mode = #{record.tripMode,jdbcType=TINYINT},
|
|
car_no = #{record.carNo,jdbcType=VARCHAR},
|
|
start_time = #{record.startTime,jdbcType=BIGINT},
|
|
end_time = #{record.endTime,jdbcType=BIGINT},
|
|
journey_type = #{record.journeyType,jdbcType=TINYINT},
|
|
together = #{record.together,jdbcType=VARCHAR},
|
|
self_fill = #{record.selfFill,jdbcType=TINYINT},
|
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
|
rec_status = #{record.recStatus,jdbcType=TINYINT}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.health.bean.po.Journey">
|
|
update t_journey
|
|
<set>
|
|
<if test="userId != null">
|
|
user_id = #{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="tripMode != null">
|
|
trip_mode = #{tripMode,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="carNo != null">
|
|
car_no = #{carNo,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="startTime != null">
|
|
start_time = #{startTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="endTime != null">
|
|
end_time = #{endTime,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="journeyType != null">
|
|
journey_type = #{journeyType,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="together != null">
|
|
together = #{together,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="selfFill != null">
|
|
self_fill = #{selfFill,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="recStatus != null">
|
|
rec_status = #{recStatus,jdbcType=TINYINT},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.health.bean.po.Journey">
|
|
update t_journey
|
|
set user_id = #{userId,jdbcType=BIGINT},
|
|
trip_mode = #{tripMode,jdbcType=TINYINT},
|
|
car_no = #{carNo,jdbcType=VARCHAR},
|
|
start_time = #{startTime,jdbcType=BIGINT},
|
|
end_time = #{endTime,jdbcType=BIGINT},
|
|
journey_type = #{journeyType,jdbcType=TINYINT},
|
|
together = #{together,jdbcType=VARCHAR},
|
|
self_fill = #{selfFill,jdbcType=TINYINT},
|
|
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
|
rec_status = #{recStatus,jdbcType=TINYINT}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
</mapper>
|