<?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.ks.app.mapper.user.WXUserInfoMapper">
|
<resultMap id="BaseResultMap"
|
type="com.ks.app.entity.user.WXUserInfo">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="system" property="system" jdbcType="VARCHAR"/>
|
<result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
|
<result column="sex" property="sex" jdbcType="INTEGER"/>
|
<result column="province" property="province" jdbcType="VARCHAR"/>
|
<result column="city" property="city" jdbcType="VARCHAR"/>
|
<result column="country" property="country" jdbcType="VARCHAR"/>
|
<result column="head_img_url" property="headImgUrl" jdbcType="VARCHAR"/>
|
<result column="open_id" property="openId" jdbcType="VARCHAR"/>
|
<result column="union_id" property="unionId" jdbcType="VARCHAR"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
<trim suffixOverrides=",">
|
id, system,nick_name,sex,province,city,country,head_img_url,open_id,union_id,create_time,update_time,
|
</trim>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from lt_user_wx where id = #{id, jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from lt_user_wx where id = #{id,jdbcType=BIGINT} for update
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
delete from
|
lt_user_wx where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.ks.app.entity.user.WXUserInfo"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into
|
lt_user_wx
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
system,
|
nick_name,
|
sex,
|
province,
|
city,
|
country,
|
head_img_url,
|
open_id,
|
union_id,
|
create_time,
|
update_time,
|
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
#{system},jdbcType=VARCHAR},
|
#{nickName},jdbcType=VARCHAR},
|
#{sex},jdbcType=INTEGER},
|
#{province},jdbcType=VARCHAR},
|
#{city},jdbcType=VARCHAR},
|
#{country},jdbcType=VARCHAR},
|
#{headImgUrl},jdbcType=VARCHAR},
|
#{openId},jdbcType=VARCHAR},
|
#{unionId},jdbcType=VARCHAR},
|
#{createTime},jdbcType=TIMESTAMP},
|
#{updateTime},jdbcType=TIMESTAMP},
|
|
</trim>
|
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.ks.app.entity.user.WXUserInfo"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into lt_user_wx
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="system != null">system,</if>
|
<if test="nickName != null">nick_name,</if>
|
<if test="sex != null">sex,</if>
|
<if test="province != null">province,</if>
|
<if test="city != null">city,</if>
|
<if test="country != null">country,</if>
|
<if test="headImgUrl != null">head_img_url,</if>
|
<if test="openId != null">open_id,</if>
|
<if test="unionId != null">union_id,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="system != null">#{system,jdbcType=VARCHAR},</if>
|
<if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
|
<if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
<if test="province != null">#{province,jdbcType=VARCHAR},</if>
|
<if test="city != null">#{city,jdbcType=VARCHAR},</if>
|
<if test="country != null">#{country,jdbcType=VARCHAR},</if>
|
<if test="headImgUrl != null">#{headImgUrl,jdbcType=VARCHAR},</if>
|
<if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
|
<if test="unionId != null">#{unionId,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.ks.app.entity.user.WXUserInfo">
|
update lt_user_wx
|
<set>
|
<if test="id != null">id = #{id,jdbcType=BIGINT},</if>
|
<if test="system != null">system = #{system,jdbcType=VARCHAR},</if>
|
<if test="nickName != null">nick_name = #{nickName,jdbcType=VARCHAR},</if>
|
<if test="sex != null">sex = #{sex,jdbcType=INTEGER},</if>
|
<if test="province != null">province = #{province,jdbcType=VARCHAR},</if>
|
<if test="city != null">city = #{city,jdbcType=VARCHAR},</if>
|
<if test="country != null">country = #{country,jdbcType=VARCHAR},</if>
|
<if test="headImgUrl != null">head_img_url = #{headImgUrl,jdbcType=VARCHAR},</if>
|
<if test="openId != null">open_id = #{openId,jdbcType=VARCHAR},</if>
|
<if test="unionId != null">union_id = #{unionId,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.ks.app.entity.user.WXUserInfo">
|
update lt_user_wx
|
<set>
|
<if test="system != null">system = #{system,jdbcType=VARCHAR},</if>
|
<if test="nickName != null">nick_name = #{nickName,jdbcType=VARCHAR},</if>
|
<if test="sex != null">sex = #{sex,jdbcType=INTEGER},</if>
|
<if test="province != null">province = #{province,jdbcType=VARCHAR},</if>
|
<if test="city != null">city = #{city,jdbcType=VARCHAR},</if>
|
<if test="country != null">country = #{country,jdbcType=VARCHAR},</if>
|
<if test="headImgUrl != null">head_img_url = #{headImgUrl,jdbcType=VARCHAR},</if>
|
<if test="openId != null">open_id = #{openId,jdbcType=VARCHAR},</if>
|
<if test="unionId != null">union_id = #{unionId,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<sql id="listWhere">
|
<if test="query.system!=null">
|
|
system=#{query.system}
|
</if>
|
|
<if test="query.unionId!=null">
|
union_id=#{query.unionId}
|
</if>
|
</sql>
|
|
<select id="list"
|
resultMap="BaseResultMap">
|
SELECT * FROM lt_user_wx
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" open=" order by " separator="," item="item">
|
#{item}
|
</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
|
|
<select id="count"
|
resultType="java.lang.Long">
|
SELECT count(*) FROM lt_user_wx
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
</select>
|
|
|
</mapper>
|