71 lines
2.1 KiB
XML
71 lines
2.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.fhy.mapper.GcarMapper" >
|
|
<resultMap id="BaseResultMap" type="com.fhy.pojo.Gcar" >
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
<result column="user_id" property="userId" jdbcType="INTEGER" />
|
|
<result column="gtime" property="gtime" jdbcType="VARCHAR" />
|
|
<result column="gstatus" property="gstatus" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
|
id, user_id, gtime, gstatus
|
|
</sql>
|
|
|
|
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.fhy.pojo.Gcar" >
|
|
insert into gcar
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >
|
|
id,
|
|
</if>
|
|
<if test="userId != null" >
|
|
user_id,
|
|
</if>
|
|
<if test="gtime != null" >
|
|
gtime,
|
|
</if>
|
|
<if test="gstatus != null" >
|
|
gstatus,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="userId != null" >
|
|
#{userId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="gtime != null" >
|
|
#{gtime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="gstatus != null" >
|
|
#{gstatus,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from gcar
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.fhy.pojo.Gcar" >
|
|
update gcar
|
|
<set >
|
|
<if test="userId != null" >
|
|
user_id = #{userId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="gtime != null" >
|
|
gtime = #{gtime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="gstatus != null" >
|
|
gstatus = #{gstatus,jdbcType=INTEGER},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
</mapper> |