<?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.taoke.autopay.dao.ClientInfoMapper">
|
<resultMap id="BaseResultMap" type="com.taoke.autopay.entity.ClientInfo">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="name" property="name" jdbcType="VARCHAR"/>
|
<result column="account" property="account" jdbcType="VARCHAR"/>
|
<result column="pwd" property="pwd" jdbcType="VARCHAR"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="active_time" property="activeTime" jdbcType="TIMESTAMP"/>
|
<result column="rule" property="rule" jdbcType="INTEGER"/>
|
<result column="client_type" property="clientType" jdbcType="INTEGER"/>
|
</resultMap>
|
<sql id="Base_Column_List">id,`name`,account,pwd,create_time,active_time,rule,client_type</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>
|
from table_user where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>
|
from table_user where id = #{id,jdbcType=BIGINT} for update
|
</select>
|
<sql id="listWhereSQL">
|
<if test="query.id!=null">AND id = #{query.id}</if>
|
<if test="query.name!=null">AND `name` = #{query.name}</if>
|
<if test="query.account!=null">AND account = #{query.account}</if>
|
<if test="query.pwd!=null">AND pwd = #{query.pwd}</if>
|
<if test="query.minCreateTime!=null">AND create_time >= #{query.minCreateTime}</if>
|
<if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} > create_time</if>
|
<if test="query.minActiveTime!=null">AND active_time >= #{query.minActiveTime}</if>
|
<if test="query.maxActiveTime!=null">AND #{query.maxActiveTime} > active_time</if>
|
<if test="query.rule!=null">AND rule = #{query.rule}</if>
|
<if test="query.clientType!=null">AND client_type = #{query.clientType}</if>
|
</sql>
|
<select id="list" resultMap="BaseResultMap">select
|
<include refid="Base_Column_List"/>
|
from table_user where 1=1
|
<include refid="listWhereSQL"/>
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" item="item" open=" order by " separator=",">${item}</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
|
|
<select id="listByIds" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>
|
from table_user where 1=1
|
<if test="ids!=null">
|
<foreach collection="ids" item="item" open="and (" separator=" or " close=")">id=#{item}
|
</foreach>
|
</if>
|
</select>
|
|
<select id="count" resultType="java.lang.Long">select count(*) from table_user where 1=1
|
<include refid="listWhereSQL"/>
|
</select>
|
<delete id="deleteByPrimaryKey"
|
parameterType="java.lang.Long">delete from table_user where id = #{id,jdbcType=BIGINT}</delete>
|
<insert id="insert" parameterType="com.taoke.autopay.entity.ClientInfo" useGeneratedKeys="true"
|
keyProperty="id">insert into table_user (id,`name`,account,pwd,create_time,active_time,rule,client_type) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{account,jdbcType=VARCHAR},#{pwd,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{rule,jdbcType=INTEGER},#{clientType,jdbcType=INTEGER})</insert>
|
<insert id="insertSelective" parameterType="com.taoke.autopay.entity.ClientInfo" useGeneratedKeys="true"
|
keyProperty="id">insert into table_user
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="name != null">`name`,</if>
|
<if test="account != null">account,</if>
|
<if test="pwd != null">pwd,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="activeTime != null">active_time,</if>
|
<if test="rule != null">rule,</if>
|
<if test="clientType != null">client_type,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
<if test="account != null">#{account,jdbcType=VARCHAR},</if>
|
<if test="pwd != null">#{pwd,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="activeTime != null">#{activeTime,jdbcType=TIMESTAMP},</if>
|
<if test="rule != null">#{rule,jdbcType=INTEGER},</if>
|
<if test="clientType != null">#{clientType,jdbcType=INTEGER},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.taoke.autopay.entity.ClientInfo">update table_user set `name` = #{name,jdbcType=VARCHAR},account = #{account,jdbcType=VARCHAR},pwd = #{pwd,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},active_time = #{activeTime,jdbcType=TIMESTAMP},rule = #{rule,jdbcType=INTEGER},client_type = #{clientType,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.ClientInfo">update table_user
|
<set>
|
<if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
|
<if test="account != null">account=#{account,jdbcType=VARCHAR},</if>
|
<if test="pwd != null">pwd=#{pwd,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="activeTime != null">active_time=#{activeTime,jdbcType=TIMESTAMP},</if>
|
<if test="rule != null">rule=#{rule,jdbcType=INTEGER},</if>
|
<if test="clientType != null">client_type=#{clientType,jdbcType=INTEGER},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
<update id="clearActiveTime" parameterType="java.lang.Long">update table_user
|
<set>
|
active_time = NULL
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
</mapper>
|