|
@@ -1,373 +1,423 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?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">
|
|
<!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">
|
|
<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,
|
|
|
|
|
|
+ <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,
|
|
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,
|
|
register_ip, country, area, province, city, isp, channel_id, `state`, createtime,
|
|
updatetime
|
|
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>
|
|
|
|
|
|
+ </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" resultMap="BaseResultMap" parameterType="com.book.dao.cps.pojo.User">
|
|
<select id="selectByUser" resultMap="BaseResultMap" parameterType="com.book.dao.cps.pojo.User">
|
|
|
|
|
|
select id from 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 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>
|
|
|
|
|
|
|
|
|
|
+ </trim>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
<select id="selectByOpenId" resultMap="BaseResultMap">
|
|
<select id="selectByOpenId" resultMap="BaseResultMap">
|
|
- SELECT * from user WHERE openid = #{openid}
|
|
|
|
|
|
+ SELECT *
|
|
|
|
+ from user
|
|
|
|
+ WHERE openid = #{openid}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectListByPushMap" resultMap="BaseResultMap" parameterType="map">
|
|
|
|
+ SELECT * 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>
|
|
|
|
+ <if test="sex!=null and sex!='-1'">
|
|
|
|
+ and sex != #{sex}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tag!=null and tag!='-1'">
|
|
|
|
+ and (
|
|
|
|
+ tag like CONCAT(#{tag}, ',%')
|
|
|
|
+ or tag like CONCAT('%,',#{tag})
|
|
|
|
+ or tag like CONCAT('%,',#{tag}, ',%')
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="is_pay!=null and is_pay!='-1'">
|
|
|
|
+ and is_pay != #{is_pay}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="kandian_max!=null and kandian_max!=''">
|
|
|
|
+ and kandian <= #{kandian_max}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="kandian_min!=null and kandian_min!=''">
|
|
|
|
+ and kandian >= #{kandian_min}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="subscribe_time!=null and subscribe_time!='-1'">
|
|
|
|
+ and subscribe_time >= #{subscribe_time}
|
|
|
|
+ </if>
|
|
|
|
+ and operate_time < (UNIX_TIMESTAMP(NOW()) - 172800)
|
|
|
|
+
|
|
|
|
+ </trim>
|
|
|
|
+
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
<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>
|
|
|
|
|
|
+ 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>
|
|
<update id="updateUserKandian">
|
|
<update id="updateUserKandian">
|
|
- update user set kandian=#{kandian},free_kandian=#{freekandian},updatetime=#{updateTime}
|
|
|
|
- where id=#{user.id} and kandian=#{user.kandian} and free_kandian=#{user.freeKandian}
|
|
|
|
|
|
+ update user
|
|
|
|
+ set kandian=#{kandian},
|
|
|
|
+ free_kandian=#{freekandian},
|
|
|
|
+ updatetime=#{updateTime}
|
|
|
|
+ where id = #{user.id}
|
|
|
|
+ and kandian = #{user.kandian}
|
|
|
|
+ and free_kandian = #{user.freeKandian}
|
|
</update>
|
|
</update>
|
|
</mapper>
|
|
</mapper>
|