123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <?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.book.dao.cps.mapper.UserMapper">
- <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.User">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="openid" jdbcType="VARCHAR" property="openid" />
- <result column="unionid" jdbcType="VARCHAR" property="unionid" />
- <result column="visitor" jdbcType="VARCHAR" property="visitor" />
- <result column="nickname" jdbcType="VARCHAR" property="nickname" />
- <result column="sex" jdbcType="OTHER" property="sex" />
- <result column="mobile" jdbcType="CHAR" property="mobile" />
- <result column="avatar" jdbcType="VARCHAR" property="avatar" />
- <result column="is_subscribe" jdbcType="OTHER" property="isSubscribe" />
- <result column="subscription_extend" jdbcType="OTHER" property="subscriptionExtend" />
- <result column="subscribe_time" jdbcType="INTEGER" property="subscribeTime" />
- <result column="book_category_ids" jdbcType="VARCHAR" property="bookCategoryIds" />
- <result column="operate_time" jdbcType="INTEGER" property="operateTime" />
- <result column="is_pay" jdbcType="OTHER" property="isPay" />
- <result column="kandian" jdbcType="INTEGER" property="kandian" />
- <result column="free_kandian" jdbcType="INTEGER" property="freeKandian" />
- <result column="vip_endtime" jdbcType="INTEGER" property="vipEndtime" />
- <result column="register_ip" jdbcType="VARCHAR" property="registerIp" />
- <result column="country" jdbcType="VARCHAR" property="country" />
- <result column="area" jdbcType="VARCHAR" property="area" />
- <result column="province" jdbcType="VARCHAR" property="province" />
- <result column="city" jdbcType="VARCHAR" property="city" />
- <result column="isp" jdbcType="VARCHAR" property="isp" />
- <result column="channel_id" jdbcType="INTEGER" property="channelId" />
- <result column="state" jdbcType="OTHER" property="state" />
- <result column="createtime" jdbcType="INTEGER" property="createtime" />
- <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
- </resultMap>
- <sql id="Base_Column_List">
- id, openid, unionid, visitor, nickname, sex, mobile, avatar, is_subscribe, subscription_extend,
- subscribe_time, book_category_ids, operate_time, is_pay, kandian, free_kandian, vip_endtime,
- register_ip, country, area, province, city, isp, channel_id, `state`, createtime,
- updatetime
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user
- where id = #{id,jdbcType=BIGINT}
- </select>
- <select id="selectByUser" resultType="com.book.dao.cps.pojo.User" parameterType="com.book.dao.cps.pojo.User">
- select id from user
- <trim prefix="WHERE" prefixOverrides="AND | OR">
- <if test="openid!=null and openid!=''">
- and openid != #{openid}
- </if>
- <if test="mobile!=null and mobile!=''">
- and mobile != #{mobile}
- </if>
- <if test="channel_id!=null and channel_id!=0">
- and channel_id != #{channel_id}
- </if>
- </trim>
- </select>
- <select id="selectByOpenId" resultType="com.book.dao.cps.pojo.User">
- SELECT * from user WHERE openid = #{openid}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from user
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.User" useGeneratedKeys="true">
- insert into user (openid, unionid, visitor,
- nickname, sex, mobile, avatar,
- is_subscribe, subscription_extend, subscribe_time,
- book_category_ids, operate_time, is_pay,
- kandian, free_kandian, vip_endtime,
- register_ip, country, area,
- province, city, isp,
- channel_id, `state`, createtime,
- updatetime)
- values (#{openid,jdbcType=VARCHAR}, #{unionid,jdbcType=VARCHAR}, #{visitor,jdbcType=VARCHAR},
- #{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=OTHER}, #{mobile,jdbcType=CHAR}, #{avatar,jdbcType=VARCHAR},
- #{isSubscribe,jdbcType=OTHER}, #{subscriptionExtend,jdbcType=OTHER}, #{subscribeTime,jdbcType=INTEGER},
- #{bookCategoryIds,jdbcType=VARCHAR}, #{operateTime,jdbcType=INTEGER}, #{isPay,jdbcType=OTHER},
- #{kandian,jdbcType=INTEGER}, #{freeKandian,jdbcType=INTEGER}, #{vipEndtime,jdbcType=INTEGER},
- #{registerIp,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR},
- #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{isp,jdbcType=VARCHAR},
- #{channelId,jdbcType=INTEGER}, #{state,jdbcType=OTHER}, #{createtime,jdbcType=INTEGER},
- #{updatetime,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.User" useGeneratedKeys="true">
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="openid != null">
- openid,
- </if>
- <if test="unionid != null">
- unionid,
- </if>
- <if test="visitor != null">
- visitor,
- </if>
- <if test="nickname != null">
- nickname,
- </if>
- <if test="sex != null">
- sex,
- </if>
- <if test="mobile != null">
- mobile,
- </if>
- <if test="avatar != null">
- avatar,
- </if>
- <if test="isSubscribe != null">
- is_subscribe,
- </if>
- <if test="subscriptionExtend != null">
- subscription_extend,
- </if>
- <if test="subscribeTime != null">
- subscribe_time,
- </if>
- <if test="bookCategoryIds != null">
- book_category_ids,
- </if>
- <if test="operateTime != null">
- operate_time,
- </if>
- <if test="isPay != null">
- is_pay,
- </if>
- <if test="kandian != null">
- kandian,
- </if>
- <if test="freeKandian != null">
- free_kandian,
- </if>
- <if test="vipEndtime != null">
- vip_endtime,
- </if>
- <if test="registerIp != null">
- register_ip,
- </if>
- <if test="country != null">
- country,
- </if>
- <if test="area != null">
- area,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="city != null">
- city,
- </if>
- <if test="isp != null">
- isp,
- </if>
- <if test="channelId != null">
- channel_id,
- </if>
- <if test="state != null">
- `state`,
- </if>
- <if test="createtime != null">
- createtime,
- </if>
- <if test="updatetime != null">
- updatetime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="openid != null">
- #{openid,jdbcType=VARCHAR},
- </if>
- <if test="unionid != null">
- #{unionid,jdbcType=VARCHAR},
- </if>
- <if test="visitor != null">
- #{visitor,jdbcType=VARCHAR},
- </if>
- <if test="nickname != null">
- #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="sex != null">
- #{sex,jdbcType=OTHER},
- </if>
- <if test="mobile != null">
- #{mobile,jdbcType=CHAR},
- </if>
- <if test="avatar != null">
- #{avatar,jdbcType=VARCHAR},
- </if>
- <if test="isSubscribe != null">
- #{isSubscribe,jdbcType=OTHER},
- </if>
- <if test="subscriptionExtend != null">
- #{subscriptionExtend,jdbcType=OTHER},
- </if>
- <if test="subscribeTime != null">
- #{subscribeTime,jdbcType=INTEGER},
- </if>
- <if test="bookCategoryIds != null">
- #{bookCategoryIds,jdbcType=VARCHAR},
- </if>
- <if test="operateTime != null">
- #{operateTime,jdbcType=INTEGER},
- </if>
- <if test="isPay != null">
- #{isPay,jdbcType=OTHER},
- </if>
- <if test="kandian != null">
- #{kandian,jdbcType=INTEGER},
- </if>
- <if test="freeKandian != null">
- #{freeKandian,jdbcType=INTEGER},
- </if>
- <if test="vipEndtime != null">
- #{vipEndtime,jdbcType=INTEGER},
- </if>
- <if test="registerIp != null">
- #{registerIp,jdbcType=VARCHAR},
- </if>
- <if test="country != null">
- #{country,jdbcType=VARCHAR},
- </if>
- <if test="area != null">
- #{area,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="isp != null">
- #{isp,jdbcType=VARCHAR},
- </if>
- <if test="channelId != null">
- #{channelId,jdbcType=INTEGER},
- </if>
- <if test="state != null">
- #{state,jdbcType=OTHER},
- </if>
- <if test="createtime != null">
- #{createtime,jdbcType=INTEGER},
- </if>
- <if test="updatetime != null">
- #{updatetime,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.User">
- update user
- <set>
- <if test="openid != null">
- openid = #{openid,jdbcType=VARCHAR},
- </if>
- <if test="unionid != null">
- unionid = #{unionid,jdbcType=VARCHAR},
- </if>
- <if test="visitor != null">
- visitor = #{visitor,jdbcType=VARCHAR},
- </if>
- <if test="nickname != null">
- nickname = #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="sex != null">
- sex = #{sex,jdbcType=OTHER},
- </if>
- <if test="mobile != null">
- mobile = #{mobile,jdbcType=CHAR},
- </if>
- <if test="avatar != null">
- avatar = #{avatar,jdbcType=VARCHAR},
- </if>
- <if test="isSubscribe != null">
- is_subscribe = #{isSubscribe,jdbcType=OTHER},
- </if>
- <if test="subscriptionExtend != null">
- subscription_extend = #{subscriptionExtend,jdbcType=OTHER},
- </if>
- <if test="subscribeTime != null">
- subscribe_time = #{subscribeTime,jdbcType=INTEGER},
- </if>
- <if test="bookCategoryIds != null">
- book_category_ids = #{bookCategoryIds,jdbcType=VARCHAR},
- </if>
- <if test="operateTime != null">
- operate_time = #{operateTime,jdbcType=INTEGER},
- </if>
- <if test="isPay != null">
- is_pay = #{isPay,jdbcType=OTHER},
- </if>
- <if test="kandian != null">
- kandian = #{kandian,jdbcType=INTEGER},
- </if>
- <if test="freeKandian != null">
- free_kandian = #{freeKandian,jdbcType=INTEGER},
- </if>
- <if test="vipEndtime != null">
- vip_endtime = #{vipEndtime,jdbcType=INTEGER},
- </if>
- <if test="registerIp != null">
- register_ip = #{registerIp,jdbcType=VARCHAR},
- </if>
- <if test="country != null">
- country = #{country,jdbcType=VARCHAR},
- </if>
- <if test="area != null">
- area = #{area,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="isp != null">
- isp = #{isp,jdbcType=VARCHAR},
- </if>
- <if test="channelId != null">
- channel_id = #{channelId,jdbcType=INTEGER},
- </if>
- <if test="state != null">
- `state` = #{state,jdbcType=OTHER},
- </if>
- <if test="createtime != null">
- createtime = #{createtime,jdbcType=INTEGER},
- </if>
- <if test="updatetime != null">
- updatetime = #{updatetime,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.User">
- update user
- set openid = #{openid,jdbcType=VARCHAR},
- unionid = #{unionid,jdbcType=VARCHAR},
- visitor = #{visitor,jdbcType=VARCHAR},
- nickname = #{nickname,jdbcType=VARCHAR},
- sex = #{sex,jdbcType=OTHER},
- mobile = #{mobile,jdbcType=CHAR},
- avatar = #{avatar,jdbcType=VARCHAR},
- is_subscribe = #{isSubscribe,jdbcType=OTHER},
- subscription_extend = #{subscriptionExtend,jdbcType=OTHER},
- subscribe_time = #{subscribeTime,jdbcType=INTEGER},
- book_category_ids = #{bookCategoryIds,jdbcType=VARCHAR},
- operate_time = #{operateTime,jdbcType=INTEGER},
- is_pay = #{isPay,jdbcType=OTHER},
- kandian = #{kandian,jdbcType=INTEGER},
- free_kandian = #{freeKandian,jdbcType=INTEGER},
- vip_endtime = #{vipEndtime,jdbcType=INTEGER},
- register_ip = #{registerIp,jdbcType=VARCHAR},
- country = #{country,jdbcType=VARCHAR},
- area = #{area,jdbcType=VARCHAR},
- province = #{province,jdbcType=VARCHAR},
- city = #{city,jdbcType=VARCHAR},
- isp = #{isp,jdbcType=VARCHAR},
- channel_id = #{channelId,jdbcType=INTEGER},
- `state` = #{state,jdbcType=OTHER},
- createtime = #{createtime,jdbcType=INTEGER},
- updatetime = #{updatetime,jdbcType=INTEGER}
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|