123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <?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.caimei365.user.mapper.OperationMapper">
- <select id="getOperationByMobile" resultType="com.caimei365.user.model.po.OperationPo">
- select o.id as id,
- o.userID as userId,
- o.mobile as mobile,
- o.clubID as clubId,
- o.shopID as shopId,
- o.unionId as unionId
- from cm_mall_operation_user o
- where o.mobile = #{mobile} and o.delFlag = '0'
- limit 1
- </select>
- <select id="countByInvitationCode" resultType="java.lang.Integer">
- select COUNT(*) from cm_mall_operation_user
- where invitationCode=#{invitationCode}
- </select>
- <select id="findClubNameById" resultType="java.lang.String">
- select name from club
- where clubID = #{clubId}
- </select>
- <select id="findShopNameById" resultType="java.lang.String">
- select name from shop
- where shopID = #{shopId}
- </select>
- <select id="getOperationCodeInfoById" resultType="com.caimei365.user.model.po.OperationPo">
- select o.id as id,
- o.mobile as mobile,
- o.clubID as clubId,
- o.shopID as shopId,
- o.status as status
- from cm_mall_operation_user o
- where o.id = #{id} and o.delFlag = '0'
- </select>
- <select id="getOperationListByUserId" resultType="com.caimei365.user.model.vo.OperationVo">
- select id, userID as userId, userType, userOrganizeID as organizeId, clubID as clubId, shopID as shopId, account, mobile,
- linkName, headimgurl as avatarUrl, invitationCode, status nickName, unionId, openid as openId, crmOpenid as crmOpenId, pcOpenid as pcOpenId,
- invitationCodeTime, bindTime, updateTime, addTime, delFlag
- from cm_mall_operation_user
- where userID = #{userId} and delFlag = 0
- <if test="mobile != null and mobile != ''">
- and mobile like concat('%',#{mobile,jdbcType=VARCHAR},'%')
- </if>
- <if test="linkName != null and linkName != ''">
- and linkName like concat('%',#{linkName,jdbcType=VARCHAR},'%')
- </if>
- order by addTime DESC
- </select>
- <update id="updateOperationOpenId">
- update cm_mall_operation_user
- set openid = #{openId}
- where userID = #{userId}
- </update>
- <update id="updateOperationUnionId">
- update cm_mall_operation_user
- set unionId = #{unionId}
- where userID = #{userId}
- </update>
- <update id="updateOperationByInvitation">
- update cm_mall_operation_user
- set unionId = #{unionId},
- openId = #{openId},
- nickName = #{nickName},
- headimgurl = #{avatarUrl},
- status = #{status},
- <if test="clubId != null and clubId != ''">
- clubId = #{clubId},
- shopId = null,
- </if>
- <if test="shopId != null and shopId != ''">
- shopId = #{shopId},
- clubId = null,
- </if>
- userType = #{userType}
- where id = #{id}
- </update>
- <update id="updateOperationByUnbind">
- update cm_mall_operation_user
- set unionId = #{unionId},
- openId = #{openId},
- nickName = #{nickName},
- bindTime = #{bindTime},
- updateTime = #{updateTime},
- status = #{status},
- userType = #{userType},
- <if test="clubId != null and clubId != ''">
- clubId = #{clubId},
- shopId = null,
- </if>
- <if test="shopId != null and shopId != ''">
- shopId = #{shopId},
- clubId = null,
- </if>
- delFlag = #{delFlag}
- where id = #{id}
- </update>
- <insert id="insertOperation" keyColumn="id" keyProperty="id" parameterType="com.caimei365.user.model.po.OperationPo">
- insert into cm_mall_operation_user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userOrganizeID != null">
- userOrganizeID,
- </if>
- <if test="userID != null">
- userID,
- </if>
- <if test="userType != null">
- userType,
- </if>
- <if test="shopID != null">
- shopID,
- </if>
- <if test="clubID != null">
- clubID,
- </if>
- <if test="account != null">
- account,
- </if>
- <if test="mobile != null">
- mobile,
- </if>
- <if test="linkName != null">
- linkName,
- </if>
- <if test="headimgurl != null">
- headimgurl,
- </if>
- <if test="invitationCode != null">
- invitationCode,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="nickName != null">
- nickName,
- </if>
- <if test="unionId != null">
- unionId,
- </if>
- <if test="openid != null">
- openid,
- </if>
- <if test="crmOpenid != null">
- crmOpenid,
- </if>
- <if test="pcOpenid != null">
- pcOpenid,
- </if>
- <if test="invitationCodeTime != null">
- invitationCodeTime,
- </if>
- <if test="bindTime != null">
- bindTime,
- </if>
- <if test="updateTime != null">
- updateTime,
- </if>
- <if test="addTime != null">
- addTime,
- </if>
- <if test="delFlag != null">
- delFlag,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="organizeId != null">
- #{organizeId},
- </if>
- <if test="userId != null">
- #{userId},
- </if>
- <if test="userType != null">
- #{userType},
- </if>
- <if test="shopID != null">
- #{shopId},
- </if>
- <if test="clubID != null">
- #{clubId},
- </if>
- <if test="account != null">
- #{account},
- </if>
- <if test="mobile != null">
- #{mobile},
- </if>
- <if test="linkName != null">
- #{linkName},
- </if>
- <if test="invitationCode != null">
- #{invitationCode},
- </if>
- <if test="status != null">
- #{status},
- </if>
- <if test="nickName != null">
- #{nickName},
- </if>
- <if test="unionId != null">
- #{unionId},
- </if>
- <if test="openId != null">
- #{openId},
- </if>
- <if test="crmOpenId != null">
- #{crmOpenId},
- </if>
- <if test="pcOpenId != null">
- #{pcOpenId},
- </if>
- <if test="invitationCodeTime">
- #{invitationCodeTime},
- </if>
- <if test="bindTime">
- #{bindTime},
- </if>
- <if test="updateTime != null">
- #{updateTime},
- </if>
- <if test="addTime != null">
- #{addTime},
- </if>
- <if test="delFlag != null">
- #{delFlag},
- </if>
- </trim>
- <selectKey resultType="java.lang.Integer" keyProperty="id">
- SELECT LAST_INSERT_ID()
- </selectKey>
- </insert>
- <update id="updateOperation" parameterType="com.caimei365.user.model.po.OperationPo">
- update cm_mall_operation_user
- <set>
- <if test="organizeId != null">
- userOrganizeID = #{organizeId},
- </if>
- <if test="userId != null">
- userID = #{userId},
- </if>
- <if test="userType != null">
- userType = #{userType},
- </if>
- <if test="shopId != null">
- shopID = #{shopId},
- </if>
- <if test="clubId != null">
- clubID = #{clubId},
- </if>
- <if test="account != null">
- account = #{account},
- </if>
- <if test="mobile != null">
- mobile = #{mobile},
- </if>
- <if test="linkName != null">
- linkName = #{linkName},
- </if>
- <if test="avatarUrl != null">
- headimgurl = #{avatarUrl},
- </if>
- <if test="invitationCode != null">
- invitationCode = #{invitationCode},
- </if>
- <if test="status != null">
- `status` = #{status},
- </if>
- <if test="nickName != null">
- nickName = #{nickName},
- </if>
- <if test="unionId != null">
- unionId = #{unionId},
- </if>
- <if test="openid != null">
- openid = #{openId},
- </if>
- <if test="crmOpenid != null">
- crmOpenid = #{crmOpenId},
- </if>
- <if test="pcOpenid != null">
- pcOpenid = #{pcOpenId},
- </if>
- <if test="invitationCodeTime != null">
- invitationCodeTime = #{invitationCodeTime},
- </if>
- <if test="bindTime != null">
- bindTime = #{bindTime},
- </if>
- <if test="updateTime != null">
- updateTime = #{updateTime},
- </if>
- <if test="addTime != null">
- addTime = #{addTime},
- </if>
- <if test="delFlag != null">
- delFlag = #{delFlag},
- </if>
- </set>
- where id = #{id}
- </update>
- </mapper>
|