<?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.WxUserInfoMapper">
|
<resultMap id="BaseResultMap" type="com.taoke.autopay.entity.WxUserInfo">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="openid" property="openId" jdbcType="VARCHAR"/>
|
<result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
|
<result column="portrait" property="portrait" jdbcType="VARCHAR"/>
|
<result column="login_time" property="loginTime" jdbcType="TIMESTAMP"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<result column="latest_ip" property="LatestIP" jdbcType="VARCHAR"/>
|
<result column="latest_ip_info" property="latestIPInfo" jdbcType="VARCHAR"/>
|
<result column="status" property="status" jdbcType="INTEGER"/>
|
</resultMap>
|
<sql id="Base_Column_List">id,openid,nick_name,portrait,login_time,create_time,update_time,latest_ip,latest_ip_info,status</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/> from table_wx_user where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/> from table_wx_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.openId!=null">AND openid = #{query.openId}</if>
|
<if test="query.nickName!=null">AND nick_name = #{query.nickName}</if>
|
<if test="query.searchKey!=null">AND (nick_name like '%${query.searchKey}%' or openid = #{query.searchKey})</if>
|
<if test="query.searchArea!=null">AND (latest_ip_info like '%${query.searchArea}%')</if>
|
<if test="query.portrait!=null">AND portrait = #{query.portrait}</if>
|
<if test="query.minLoginTime!=null">AND login_time >= #{query.minLoginTime}</if>
|
<if test="query.maxLoginTime!=null">AND #{query.maxLoginTime} > login_time</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.minUpdateTime!=null">AND update_time >= #{query.minUpdateTime}</if>
|
<if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} > update_time</if>
|
</sql>
|
<select id="list" resultMap="BaseResultMap">select
|
<include refid="Base_Column_List"/> from table_wx_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="count" resultType="java.lang.Long">select count(*) from table_wx_user where 1=1
|
<include refid="listWhereSQL"/>
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_wx_user where id = #{id,jdbcType=BIGINT}</delete>
|
<insert id="insert" parameterType="com.taoke.autopay.entity.WxUserInfo" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user (id,openid,nick_name,portrait,login_time,create_time,update_time,id,latest_ip,latest_ip_info,status) values (#{id,jdbcType=BIGINT},#{openId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{loginTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{LatestIP,jdbcType=VARCHAR},#{latestIPInfo,jdbcType=VARCHAR},#{status,jdbcType=INTEGER})</insert>
|
<insert id="insertSelective" parameterType="com.taoke.autopay.entity.WxUserInfo" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="openId != null">openid,</if>
|
<if test="nickName != null">nick_name,</if>
|
<if test="portrait != null">portrait,</if>
|
<if test="loginTime != null">login_time,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="LatestIP != null">latest_ip,</if>
|
<if test="latestIPInfo != null">latest_ip_info,</if>
|
<if test="status != null">status,</if>
|
</trim>values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
|
<if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
|
<if test="portrait != null">#{portrait,jdbcType=VARCHAR},</if>
|
<if test="loginTime != null">#{loginTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="LatestIP != null">#{LatestIP,jdbcType=VARCHAR},</if>
|
<if test="latestIPInfo != null">#{latestIPInfo,jdbcType=VARCHAR},</if>
|
<if test="status != null">#{status,jdbcType=INTEGER}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.taoke.autopay.entity.WxUserInfo">update table_wx_user set openid = #{openId,jdbcType=VARCHAR},nick_name = #{nickName,jdbcType=VARCHAR},portrait = #{portrait,jdbcType=VARCHAR},login_time = #{loginTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} ,latest_ip =#{LatestIP,jdbcType=VARCHAR}, latest_ip_info =#{latestIPInfo,jdbcType=VARCHAR}, status =#{status,jdbcType=INTEGER}, where id = #{id,jdbcType=BIGINT}</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.WxUserInfo">update table_wx_user
|
<set>
|
<if test="openId != null">openid=#{openId,jdbcType=VARCHAR},</if>
|
<if test="nickName != null">nick_name=#{nickName,jdbcType=VARCHAR},</if>
|
<if test="portrait != null">portrait=#{portrait,jdbcType=VARCHAR},</if>
|
<if test="loginTime != null">login_time=#{loginTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="LatestIP !=null">latest_ip =#{LatestIP,jdbcType=VARCHAR},</if>
|
<if test="latestIPInfo !=null">latest_ip_info =#{latestIPInfo,jdbcType=VARCHAR},</if>
|
<if test="status !=null">status =#{status,jdbcType=INTEGER},</if>
|
</set> where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|