| | |
| | | <result column="last_logintime" property="lastLoginTime"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
|
| | | <result column="tuiguang_code" property="tuiGuangCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="appid" property="appId" jdbcType="VARCHAR" />
|
| | | <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
|
| | | <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
|
| | |
| | | <result column="last_logintime" property="lastLoginTime"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
|
| | | <result column="tuiguang_code" property="tuiGuangCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="appid" property="appId" jdbcType="VARCHAR" />
|
| | | <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
|
| | | <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
|
| | |
| | | jdbcType="VARCHAR" />
|
| | |
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | | </sql>
|
| | | <!-- 不能查询缓存 -->
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user
|
| | | (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc)
|
| | | (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc,platform)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{tuiGuangCode,jdbcType=VARCHAR},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR})
|
| | | (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{platform,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | |
| | | <if test="createtime != null">createtime,</if>
|
| | | <if test="lastLoginTime != null">last_logintime,</if>
|
| | | <if test="lastLoginIp != null">loginip,</if>
|
| | | <if test="tuiGuangCode != null">tuiguang_code,</if>
|
| | | <if test="type != null">type,</if>
|
| | | <if test="appId != null">appid,</if>
|
| | | <if test="myHongBao != null">my_hongBao,</if>
|
| | | <if test="payPassword != null">pay_password,</if>
|
| | |
| | | <if test="phone != null">phone,</if>
|
| | | <if test="state != null">state,</if>
|
| | | <if test="stateDesc != null">state_desc,</if>
|
| | | <if test="platform != null">platform,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | |
| | | <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginTime != null">#{lastLoginTime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginIp != null">#{lastLoginIp,jdbcType=VARCHAR},</if>
|
| | | <if test="tuiGuangCode != null">#{tuiGuangCode,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
| | | <if test="appId != null">#{appId,jdbcType=VARCHAR},</if>
|
| | | <if test="myHongBao != null">#{myHongBao,jdbcType=DECIMAL},</if>
|
| | | <if test="payPassword != null">#{payPassword,jdbcType=VARCHAR},</if>
|
| | |
| | | <if test="phone != null">#{phone,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR}</if>
|
| | | <if test="platform != null">#{platform,jdbcType=VARCHAR}</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo">update
|
| | |
| | | #{portrait,jdbcType=VARCHAR},createtime =
|
| | | #{createtime,jdbcType=BIGINT},last_logintime =
|
| | | #{lastLoginTime,jdbcType=BIGINT},loginip =
|
| | | #{lastLoginIp,jdbcType=VARCHAR},tuiguang_code =
|
| | | #{tuiGuangCode,jdbcType=VARCHAR},appid =
|
| | | #{lastLoginIp,jdbcType=VARCHAR},type =
|
| | | #{type,jdbcType=INTEGER},appid =
|
| | | #{appId,jdbcType=VARCHAR},my_hongBao =
|
| | | #{myHongBao,jdbcType=DECIMAL},pay_password =
|
| | | #{payPassword,jdbcType=VARCHAR},sid =
|
| | |
| | | <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginTime != null">last_logintime=#{lastLoginTime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginIp != null">loginip=#{lastLoginIp,jdbcType=VARCHAR},</if>
|
| | | <if test="tuiGuangCode != null">tuiguang_code=#{tuiGuangCode,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">type=#{type,jdbcType=INTEGER},</if>
|
| | | <if test="appId != null">appid=#{appId,jdbcType=VARCHAR},</if>
|
| | | <if test="myHongBao != null">my_hongBao=#{myHongBao,jdbcType=DECIMAL},</if>
|
| | | <if test="payPassword != null">pay_password=#{payPassword,jdbcType=VARCHAR},</if>
|
| | |
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_user
|
| | | where wx_union_id=#{unionId} AND state = 0
|
| | | LIMIT 1
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="getEffectiveUserInfoByWXOpenId" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_user
|
| | | where wx_open_id=#{wxOpenId} AND state = 0
|
| | | LIMIT 1
|
| | | </select>
|
| | |
|
| | |
| | | <if test="userState == 2">
|
| | | AND u.`state` =2 <!-- 封禁用户 -->
|
| | | </if>
|
| | |
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | |
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | | DATE_FORMAT(#{startTime},'%Y%m%d')
|
| | |
| | | </if>
|
| | | <if test="userState == 2">
|
| | | AND u.`state` =2 <!-- 封禁用户 -->
|
| | | </if>
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countNewUserByDate" resultType="java.util.HashMap">
|
| | | <select id="countNewUserByDate" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT h.`id`) AS showValue,
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | | ORDER BY h.`createtime`
|
| | | </select>
|
| | |
|
| | | <select id="getTodayHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getTodayHasOrder" resultMap="ChartMap">
|
| | | SELECT COALESCE(COUNT(DISTINCT u.`id`),0) AS 'showValue',
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | |
|
| | |
|
| | |
|
| | | <select id="getWeekHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getWeekHasOrder" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT hb.uid) AS
|
| | | showValue,FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'showDate'
|
| | | FROM (SELECT COUNT(v2.`hb_id`) AS num,v2.hb_uid AS uid
|
| | |
| | | u.`createtime`
|
| | | </select>
|
| | |
|
| | | <select id="getInfoByPhoneOrInviteCode" resultMap="BaseResultMap">
|
| | | <select id="getUserInfoByInviteCode" resultMap="BaseResultMap">
|
| | | SELECT * FROM
|
| | | yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =
|
| | | u.`id`
|
| | | WHERE
|
| | | uf.`uie_invite_code` IS NOT NULL
|
| | | AND (u.`phone` =#{phone} OR
|
| | | uf.`uie_invite_code` = #{inviteCode})
|
| | | WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR
|
| | | uf.`uie_invite_code` = #{inviteCode}
|
| | | LIMIT 1
|
| | | </select>
|
| | |
|
| | |
| | | where u.state=0
|
| | | </select>
|
| | |
|
| | | <select id="getAutoExtractUser" resultMap="BaseResultMap">
|
| | | SELECT u.* FROM `yeshi_ec_user_info_extra` t
|
| | | LEFT JOIN `yeshi_ec_user`
|
| | | u ON u.`id` = t.`uie_uid`
|
| | | WHERE t.`uie_auto_extract` = 1 AND
|
| | | t.uie_active_time <![CDATA[>=]]>
|
| | | #{beganDate} AND t.uie_active_time <![CDATA[<]]>
|
| | | #{endDate}
|
| | | AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
|
| | | AND u.`state`
|
| | | = 0 AND u.`my_hongBao` <![CDATA[>=]]>
|
| | | #{money}
|
| | | AND u.`wx_open_id` IS NOT NULL AND
|
| | | LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]>
|
| | | 0
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="getAutoExtractUserTo1212" resultMap="BaseResultMap">
|
| | | SELECT u.* FROM (SELECT v2.`hb_uid` FROM `yeshi_ec_hongbao_v2` v2
|
| | | WHERE <![CDATA[v2.`hb_create_time` > '2019-01-01' AND v2.`hb_create_time` < '2019-06-18']]>
|
| | | GROUP BY hb_uid)h
|
| | | LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid`
|
| | | = h.hb_uid
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
|
| | | WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]>
|
| | | AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
|
| | | AND u.`state` = 0 AND
|
| | | u.`my_hongBao`<![CDATA[> 1]]>
|
| | | AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByType" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_user u
|
| | | where u.type=#{type} limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countByType" resultType="java.lang.Long"
|
| | | parameterType="java.lang.Integer">
|
| | | select count(*) from
|
| | | yeshi_ec_user u where u.type=#{0}
|
| | | </select>
|
| | |
|
| | | </mapper>
|