123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805 |
- <?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.caimei.modules.user.dao.CmUserDao">
- <sql id="cmUserColumns">
- a.userID AS "userID",
- a.mobile AS "mobile",
- a.userOrganizeID AS "userOrganizeID",
- a.bindMobile AS "bindMobile",
- a.email AS "email",
- a.account AS "account",
- a.realName AS "realName",
- a.userIdentity AS "userIdentity",
- a.companyUserID AS "companyUserID",
- a.openID AS "openID",
- a.userName AS "userName",
- a.source AS "source",
- a.image AS "image",
- a.password AS "password",
- a.userLevelID AS "userLevelID",
- a.name AS "name",
- a.nick AS "nick",
- a.sex AS "sex",
- a.registerUserTypeID AS "registerUserTypeID",
- a.manufacturerFlag AS "manufacturerFlag",
- a.manufacturerStatus AS "manufacturerStatus",
- a.shopID AS "shopID",
- a.serviceProviderFlag AS "serviceProviderFlag",
- a.clubFlag AS "clubFlag",
- a.masterFlag AS "masterFlag",
- a.normalFlag AS "normalFlag",
- a.auditStatus AS "auditStatus",
- a.auditTime AS "auditTime",
- a.auditNote AS "auditNote",
- a.registerTime AS "registerTime",
- a.registerIP AS "registerIP",
- a.loginTime AS "loginTime",
- a.loginFailTime AS "loginFailTime",
- a.loginIP AS "loginIP",
- a.validFlag AS "validFlag",
- a.emailCheckFlag AS "emailCheckFlag",
- a.mobileCheckFlag AS "mobileCheckFlag",
- a.clubStatus AS "clubStatus",
- a.clubID AS "clubID",
- a.agreeFlag AS "agreeFlag",
- a.activationCode AS "activationCode",
- a.activationDate AS "activationDate",
- a.serviceProviderStatus AS "serviceProviderStatus",
- a.serviceProviderID AS "serviceProviderID",
- a.masterStatus AS "masterStatus",
- a.masterID AS "masterID",
- a.userMoney AS "userMoney",
- a.ableUserMoney as "ableUserMoney",
- a.point AS "point",
- a.shopERPFlag AS "shopERPFlag",
- a.fromUserID AS "fromUserID",
- a.fromUserName AS "fromUserName",
- a.logoffTime AS "logoffTime",
- a.appKey AS "appKey",
- a.appSecret AS "appSecret",
- a.sampleFlag AS "sampleFlag",
- a.scanFlag AS "scanFlag",
- a.sysroleid AS "sysroleid",
- a.gender AS "gender",
- a.age AS "age",
- a.salerbuyer AS "salerbuyer",
- a.position AS "position",
- a.skill AS "skill",
- a.workage AS "workage",
- a.wechat AS "wechat",
- a.qq AS "qq",
- a.smsFlag AS "smsFlag",
- a.userBeans AS "userBeans",
- a.privateShopFlag AS "privateShopFlag",
- a.privateClubFlag AS "privateClubFlag",
- a.isMeiDaoAuthorized AS "isMeiDaoAuthorized",
- a.guideFlag AS "guideFlag",
- a.userPermission AS "userPermission"
- </sql>
- <sql id="cmUserJoins">
- </sql>
- <select id="get" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- <include refid="cmUserJoins"/>
- WHERE a.userID = #{id}
- </select>
- <select id="findList" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- <include refid="cmUserJoins"/>
- <where>
- <if test="userID != null and userID != ''">
- AND a.userID = #{userID}
- </if>
- <if test="mobile != null and mobile != ''">
- AND (a.mobile LIKE
- <if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
- OR a.bindMobile LIKE
- <if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
- )
- </if>
- <if test="email != null and email != ''">
- AND a.email LIKE
- <if test="dbName == 'oracle'">'%'||#{email}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{email}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{email},'%')</if>
- </if>
- <if test="userName != null and userName != ''">
- AND a.userName LIKE
- <if test="dbName == 'oracle'">'%'||#{userName}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
- </if>
- <if test="startTime != null and startTime != ''">
- AND (a.registerTime > #{startTime} OR a.registerTime = #{startTime})
- </if>
- <if test="endTime != null and endTime != ''">
- AND (a.registerTime < #{endTime} OR a.registerTime = #{endTime})
- </if>
- <if test="userOrganizeID != null and userOrganizeID != ''">
- AND a.userOrganizeID = #{userOrganizeID}
- </if>
- <choose>
- <when test="registerUserTypeID != null and registerUserTypeID != ''">
- AND a.registerUserTypeID = #{registerUserTypeID}
- </when>
- <otherwise>
- AND a.registerUserTypeID IN (0,10,1,24,34,2,32,3,23,33)
- </otherwise>
- </choose>
- <!--<if test="registerUserTypeID != null and registerUserTypeID != ''">-->
- <!--AND a.registerUserTypeID = #{registerUserTypeID}-->
- <!--</if>-->
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.userID DESC
- </otherwise>
- </choose>
- </select>
- <!--适用于企业通过手机号码查询用户-->
- <select id="findListBuyBindMobile" resultType="CmUser">
- SELECT
- *
- FROM user a
- <where>
- a.bindMobile = #{bindMobile}
- <if test="clubID != null and clubID != ''">
- AND a.clubID != #{clubID}
- </if>
- </where>
- </select>
- <!--星范商城查询会所-->
- <select id="findListBuyUserInfo" resultType="CmUser">
- SELECT
- a.*
- ,c.linkMan AS "linkMan"
- ,t.name as "town"
- ,ci.name as "city"
- ,p.name as "province"
- ,c.address AS "address"
- FROM user a
- LEFT JOIN club c on c.userID = a.userID
- LEFT JOIN town t on t.townID = c.townID
- LEFT JOIN city ci ON ci.cityID = c.cityID
- LEFT JOIN province p ON p.provinceID = c.provinceID
- <where>
- a.userOrganizeID = #{userOrganizeID}
- <if test="bindMobile != null and bindMobile != ''">
- AND a.bindMobile LIKE concat('%',#{bindMobile},'%')
- </if>
- <if test="name != null and name != ''">
- AND a.name LIKE concat('%',#{name},'%')
- </if>
- <if test="linkMan != null and linkMan != ''">
- AND c.linkMan LIKE concat('%',#{linkMan},'%')
- </if>
- <if test="startTime != null and startTime != ''">
- AND a.registerTime <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND a.registerTime <![CDATA[ <= ]]> #{endTime}
- </if>
- <if test="clubStatus != null and clubStatus != ''">
- AND a.clubStatus = #{clubStatus}
- </if>
- </where>
- ORDER BY a.registerTime DESC
- </select>
- <select id="findAllList" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- <include refid="cmUserJoins"/>
- <where>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.userID DESC
- </otherwise>
- </choose>
- </select>
- <insert id="insert" parameterType="CmUser" keyProperty="userID" useGeneratedKeys="true">
- INSERT INTO user(
- userOrganizeID,
- account,
- realName,
- userIdentity,
- companyUserID,
- openID,
- mobile,
- bindMobile,
- userPermission,
- email,
- userName,
- source,
- image,
- password,
- userLevelID,
- name,
- nick,
- sex,
- registerUserTypeID,
- manufacturerFlag,
- manufacturerStatus,
- shopID,
- serviceProviderFlag,
- clubFlag,
- masterFlag,
- normalFlag,
- auditStatus,
- auditTime,
- auditNote,
- registerTime,
- registerIP,
- loginTime,
- loginFailTime,
- loginIP,
- validFlag,
- emailCheckFlag,
- mobileCheckFlag,
- clubStatus,
- <if test="clubID != null and clubID != ''">
- clubID,
- </if>
- agreeFlag,
- activationCode,
- activationDate,
- serviceProviderStatus,
- serviceProviderID,
- masterStatus,
- masterID,
- userMoney,
- ableUserMoney,
- point,
- shopERPFlag,
- fromUserID,
- fromUserName,
- logoffTime,
- appKey,
- appSecret,
- sampleFlag,
- scanFlag,
- sysroleid,
- gender,
- age,
- salerbuyer,
- position,
- skill,
- workage,
- wechat,
- qq,
- smsFlag,
- userBeans,
- privateShopFlag,
- privateClubFlag,
- isMeiDaoAuthorized
- ) VALUES (
- #{userOrganizeID},
- #{account},
- #{realName},
- #{userIdentity},
- #{companyUserID},
- #{openID},
- #{mobile},
- #{bindMobile},
- #{userPermission},
- #{email},
- #{userName},
- #{source},
- #{image},
- #{password},
- #{userLevelID},
- #{name},
- #{nick},
- #{sex},
- #{registerUserTypeID},
- #{manufacturerFlag},
- #{manufacturerStatus},
- #{shopID},
- #{serviceProviderFlag},
- #{clubFlag},
- #{masterFlag},
- #{normalFlag},
- #{auditStatus},
- #{auditTime},
- #{auditNote},
- #{registerTime},
- #{registerIP},
- #{loginTime},
- #{loginFailTime},
- #{loginIP},
- #{validFlag},
- #{emailCheckFlag},
- #{mobileCheckFlag},
- #{clubStatus},
- <if test="clubID != null and clubID != ''">
- #{clubID},
- </if>
- #{agreeFlag},
- #{activationCode},
- #{activationDate},
- #{serviceProviderStatus},
- #{serviceProviderID},
- #{masterStatus},
- #{masterID},
- #{userMoney},
- #{ableUserMoney},
- #{point},
- #{shopERPFlag},
- #{fromUserID},
- #{fromUserName},
- #{logoffTime},
- #{appKey},
- #{appSecret},
- #{sampleFlag},
- #{scanFlag},
- #{sysroleid},
- #{gender},
- #{age},
- #{salerbuyer},
- #{position},
- #{skill},
- #{workage},
- #{wechat},
- #{qq},
- #{smsFlag},
- #{userBeans},
- #{privateShopFlag},
- #{privateClubFlag},
- #{isMeiDaoAuthorized}
- )
- </insert>
- <update id="update">
- UPDATE user SET
- <if test="account != null and account != ''">
- account = #{account},
- </if>
- <if test="bindMobile != null and bindMobile != ''">
- bindMobile = #{bindMobile},
- </if>
- <if test="realName != null">
- realName = #{realName},
- </if>
- <if test="userIdentity != null and userIdentity != ''">
- userIdentity = #{userIdentity},
- </if>
- <if test="companyUserID != null and companyUserID != ''">
- companyUserID = #{companyUserID},
- </if>
- <if test="openID != null and openID != ''">
- openID = #{openID},
- </if>
- <if test="mobile != null and mobile != ''">
- mobile = #{mobile},
- </if>
- <if test="userPermission != null and userPermission != ''">
- userPermission = #{userPermission},
- </if>
- <if test="email != null and email != ''">
- email = #{email},
- </if>
- <if test="userName != null and userName != ''">
- userName = #{userName},
- </if>
- <if test="image != null and image != ''">
- image = #{image},
- </if>
- <if test="password != null and password != ''">
- password = #{password},
- </if>
- <if test="userLevelID != null and userLevelID != ''">
- userLevelID = #{userLevelID},
- </if>
- <if test="name != null and name != ''">
- name = #{name},
- </if>
- <if test="nick != null and nick != ''">
- nick = #{nick},
- </if>
- <if test="sex != null and sex != ''">
- sex = #{sex},
- </if>
- <if test="registerUserTypeID != null and registerUserTypeID != ''">
- registerUserTypeID = #{registerUserTypeID},
- </if>
- <if test="manufacturerFlag != null and manufacturerFlag != ''">
- manufacturerFlag = #{manufacturerFlag},
- </if>
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
- manufacturerStatus = #{manufacturerStatus},
- </if>
- <if test="shopID != null and shopID != ''">
- shopID = #{shopID},
- </if>
- <if test="serviceProviderFlag != null and serviceProviderFlag != ''">
- serviceProviderFlag = #{serviceProviderFlag},
- </if>
- <if test="clubFlag != null and clubFlag != ''">
- clubFlag = #{clubFlag},
- </if>
- <if test="masterFlag != null and masterFlag != ''">
- masterFlag = #{masterFlag},
- </if>
- <if test="normalFlag != null and normalFlag != ''">
- normalFlag = #{normalFlag},
- </if>
- <if test="auditStatus != null and auditStatus != ''">
- auditStatus = #{auditStatus},
- </if>
- <if test="auditTime != null">
- auditTime = #{auditTime},
- </if>
- <if test="auditNote != null and auditNote != ''">
- auditNote = #{auditNote},
- </if>
- <if test="registerTime != null ">
- registerTime = #{registerTime},
- </if>
- <if test="registerIP != null and registerIP != ''">
- registerIP = #{registerIP},
- </if>
- <if test="loginTime != null and loginTime != ''">
- loginTime = #{loginTime},
- </if>
- <if test="loginFailTime != null and loginFailTime != ''">
- loginFailTime = #{loginFailTime},
- </if>
- <if test="loginIP != null and loginIP != ''">
- loginIP = #{loginIP},
- </if>
- <if test="validFlag != null and validFlag != ''">
- validFlag = #{validFlag},
- </if>
- <if test="emailCheckFlag != null and emailCheckFlag != ''">
- emailCheckFlag = #{emailCheckFlag},
- </if>
- <if test="mobileCheckFlag != null and mobileCheckFlag != ''">
- mobileCheckFlag = #{mobileCheckFlag},
- </if>
- <if test="clubStatus != null and clubStatus != ''">
- clubStatus = #{clubStatus},
- </if>
- <if test="clubID != null and clubID != ''">
- clubID = #{clubID},
- </if>
- <if test="agreeFlag != null and agreeFlag != ''">
- agreeFlag = #{agreeFlag},
- </if>
- <if test="activationCode != null and activationCode != ''">
- activationCode = #{activationCode},
- </if>
- <if test="activationDate != null ">
- activationDate = #{activationDate},
- </if>
- <if test="serviceProviderStatus != null and serviceProviderStatus != ''">
- serviceProviderStatus = #{serviceProviderStatus},
- </if>
- <if test="serviceProviderID != null and serviceProviderID != ''">
- serviceProviderID = #{serviceProviderID},
- </if>
- <if test="masterStatus != null and masterStatus != ''">
- masterStatus = #{masterStatus},
- </if>
- <if test="masterID != null and masterID != ''">
- masterID = #{masterID},
- </if>
- <if test="userMoney != null and userMoney != ''">
- userMoney = #{userMoney},
- </if>
- <if test="point != null and point != ''">
- point = #{point},
- </if>
- <if test="shopERPFlag != null and shopERPFlag != ''">
- shopERPFlag = #{shopERPFlag},
- </if>
- <if test="fromUserID != null and fromUserID != ''">
- fromUserID = #{fromUserID},
- </if>
- <if test="fromUserName != null and fromUserName != ''">
- fromUserName = #{fromUserName},
- </if>
- <if test="logoffTime != null and logoffTime != ''">
- logoffTime = #{logoffTime},
- </if>
- <if test="appKey != null and appKey != ''">
- appKey = #{appKey},
- </if>
- <if test="appSecret != null and appSecret != ''">
- appSecret = #{appSecret},
- </if>
- <if test="sampleFlag != null and sampleFlag != ''">
- sampleFlag = #{sampleFlag},
- </if>
- <if test="scanFlag != null and scanFlag != ''">
- scanFlag = #{scanFlag},
- </if>
- <if test="sysroleid != null and sysroleid != ''">
- sysroleid = #{sysroleid},
- </if>
- <if test="gender != null and gender != ''">
- gender = #{gender},
- </if>
- <if test="age != null and age != ''">
- age = #{age},
- </if>
- <if test="salerbuyer != null and salerbuyer != ''">
- salerbuyer = #{salerbuyer},
- </if>
- <if test="position != null and position != ''">
- position = #{position},
- </if>
- <if test="skill != null and skill != ''">
- skill = #{skill},
- </if>
- <if test="workage != null and workage != ''">
- workage = #{workage},
- </if>
- <if test="wechat != null and wechat != ''">
- wechat = #{wechat},
- </if>
- <if test="qq != null and qq != ''">
- qq = #{qq},
- </if>
- <if test="smsFlag != null and smsFlag != ''">
- smsFlag = #{smsFlag},
- </if>
- <if test="userBeans != null and userBeans != ''">
- userBeans = #{userBeans},
- </if>
- <if test="privateShopFlag != null and privateShopFlag != ''">
- privateShopFlag = #{privateShopFlag},
- </if>
- <if test="privateClubFlag != null and privateClubFlag != ''">
- privateClubFlag = #{privateClubFlag},
- </if>
- <if test="isMeiDaoAuthorized != null and isMeiDaoAuthorized != ''">
- isMeiDaoAuthorized = #{isMeiDaoAuthorized},
- </if>
- <if test="guideFlag != null and guideFlag != ''">
- guideFlag = #{guideFlag},
- </if>
- userID = #{userID}
- WHERE userID = #{userID}
- </update>
- <delete id="delete">
- DELETE FROM user
- WHERE userID = #{userID}
- </delete>
- <select id="findUserByRegisterType" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user
- <where>
- registerUserTypeID = #{registerUserTypeID}
- </where>
- </select>
- <select id="findAllPersonalUser" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user
- <where>
- registerUserTypeID IN (0,5,10,24,34,2,32,23,33)
- </where>
- </select>
- <select id="findByCompanyUserID" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- WHERE
- a.companyUserID=#{companyUserID} AND a.userID != #{companyUserID}
- ORDER BY case when registerUserTypeID in (1,2,3) then 1 else 0 end ,
- case when registerUserTypeID in (24,23) then 1 else 0 end ,
- case when auditStatus = 0 then 1 else 0 end ,
- auditTime DESC
- </select>
- <update id="updateEmployeeStatus">
- UPDATE user
- <set>
- <if test="userPermission != null and userPermission != ''">
- userPermission = #{userPermission},
- </if>
- <if test="clubStatus != null and clubStatus != ''">
- clubStatus = #{clubStatus},
- </if>
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
- manufacturerStatus = #{manufacturerStatus},
- </if>
- <if test="tipStatus != null and tipStatus != ''">
- tipStatus = #{tipStatus},
- </if>
- </set>
- WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID}
- </update>
- <update id="updateUserStatus">
- UPDATE user
- <set>
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
- manufacturerStatus = #{manufacturerStatus},
- </if>
- <if test="validFlag != null and validFlag != ''">
- validFlag = #{validFlag},
- </if>
- </set>
- WHERE userID = #{userID}
- </update>
- <update id="updateShopStatus">
- UPDATE shop
- <set>
- <if test="status != null and status != ''">
- status = #{status},
- </if>
- </set>
- WHERE userID = #{userID}
- </update>
- <update id="updateUserAudit">
- UPDATE user
- <set>
- <if test="auditStatus != null and auditStatus != ''">
- auditStatus = #{auditStatus},
- </if>
- <if test="auditNote != null and auditNote != ''">
- auditNote = #{auditNote},
- </if>
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
- manufacturerStatus = #{manufacturerStatus},
- </if>
- <if test="auditTime != null and auditTime != ''">
- auditTime = #{auditTime},
- </if>
- <if test="validFlag != null and validFlag != ''">
- validFlag = #{validFlag},
- </if>
- </set>
- WHERE userID = #{userId}
- </update>
- <update id="updateShopAudit">
- UPDATE shop
- <set>
- <if test="auditStatus != null and auditStatus != ''">
- auditStatus = #{auditStatus},
- </if>
- <if test="auditNote != null and auditNote != ''">
- auditNote = #{auditNote},
- </if>
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
- status = #{manufacturerStatus},
- </if>
- <if test="auditTime != null and auditTime != ''">
- auditTime = #{auditTime},
- </if>
- </set>
- WHERE shopID = #{shopId}
- </update>
- <update id="updateEmployeePermission">
- UPDATE user SET userPermission = #{userPermission}
- WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID} AND auditStatus = '1'
- </update>
- <update id="updateUserInfo">
- UPDATE user SET
- realName = #{realName},
- name = #{name},
- userName = #{userName},
- bindMobile = #{bindMobile},
- email = #{email}
- WHERE userID = #{userID}
- </update>
- <update id="initEmployeeInfo">
- UPDATE user SET
- companyUserID = NULL,
- userIdentity = '0',
- userPermission = '1',
- registerUserTypeID = '10' ,
- auditStatus = NULL ,
- auditTime = NULL ,
- userName = realName,
- name = NULL ,
- clubID = NULL ,
- clubStatus = NULL ,
- shopID = NULL ,
- manufacturerStatus = NULL ,
- tipStatus = '1'
- WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID}
- </update>
- <update id="updateAbleUserMoney">
- UPDATE user SET
- ableUserMoney = #{ableUserMoney}
- WHERE userID = #{userId}
- </update>
- <update id="updateMoney">
- UPDATE user SET
- userMoney = #{userMoney},
- ableUserMoney = #{ableUserMoney}
- WHERE userID = #{userID}
- </update>
- <select id="findUserByMobile" resultType="CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- WHERE a.mobile=#{mobile}
- </select>
- <select id="getUserPayOrder" resultType="com.caimei.modules.order.entity.NewShopOrder">
- select *
- from cm_shop_order
- where
- (`status` = 2 || `status` = 3 || `status` = 4 || `status` = 5)
- AND userID=#{userId}
- </select>
- <select id="selectByMobileOrEmail" resultType="com.caimei.modules.user.entity.CmUser">
- select u.*,cu.mobile as operatorMobile from user u
- left join cm_mall_operation_user cu on cu.userID = u.userID
- where (u.bindMobile = #{mobileOrEmail}
- or u.email = #{mobileOrEmail}
- or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1))
- AND u.userIdentity IN (1,2,3,4)
- AND u.userOrganizeID = 0
- <if test="source == 'www'">
- AND u.registerUserTypeID IN (1,3,4)
- </if>
- <if test="source == 'crm'">
- AND u.registerUserTypeID IN (1,2,3,32,4)
- </if>
- </select>
- <update id="updateUserBeans">
- UPDATE USER SET userBeans = #{userBeans} WHERE userID = #{userID}
- </update>
- <select id="findUserByOrganizeId" resultType="com.caimei.modules.user.entity.CmUser">
- SELECT
- <include refid="cmUserColumns"/>
- FROM user a
- WHERE a.userOrganizeID=#{organizeId}
- limit 1
- </select>
- <select id="getOrganizeStoreName" resultType="java.lang.String">
- select name from cm_organize_store where id = #{organizeStoreId}
- </select>
- <update id="updateByClubStatus">
- UPDATE user SET clubStatus = #{clubStatus} WHERE userID = #{confirmUserId}
- </update>
- </mapper>
|