|
@@ -3,7 +3,7 @@
|
|
|
<mapper namespace="com.caimei.modules.user.dao.CmUserDao">
|
|
|
|
|
|
<sql id="cmUserColumns">
|
|
|
- a.userID AS "userID",
|
|
|
+ a.userID AS "userID",
|
|
|
a.mobile AS "mobile",
|
|
|
a.userOrganizeID AS "userOrganizeID",
|
|
|
a.bindMobile AS "bindMobile",
|
|
@@ -25,24 +25,18 @@
|
|
|
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.clubStatus AS "clubStatus",
|
|
|
a.clubID AS "clubID",
|
|
|
a.agreeFlag AS "agreeFlag",
|
|
|
a.serviceProviderStatus AS "serviceProviderStatus",
|
|
|
a.serviceProviderID AS "serviceProviderID",
|
|
|
a.userMoney AS "userMoney",
|
|
|
a.ableUserMoney as "ableUserMoney",
|
|
|
- a.logoffTime AS "logoffTime",
|
|
|
- a.appKey AS "appKey",
|
|
|
- a.appSecret AS "appSecret",
|
|
|
a.scanFlag AS "scanFlag",
|
|
|
a.userBeans AS "userBeans",
|
|
|
- a.guideFlag AS "guideFlag",
|
|
|
- a.userPermission AS "userPermission"
|
|
|
- </sql>
|
|
|
+ a.guideFlag AS "guideFlag"
|
|
|
+ </sql>
|
|
|
|
|
|
<select id="get" resultType="CmUser">
|
|
|
SELECT
|
|
@@ -65,11 +59,11 @@
|
|
|
<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>
|
|
|
- )
|
|
|
+ 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
|
|
@@ -83,15 +77,15 @@
|
|
|
<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>
|
|
|
+ <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}
|
|
@@ -111,56 +105,53 @@
|
|
|
</choose>
|
|
|
</select>
|
|
|
|
|
|
- <!--适用于企业通过手机号码查询用户-->
|
|
|
- <select id="findListBuyBindMobile" resultType="com.caimei.modules.user.entity.CmUser">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM user a
|
|
|
- <where>
|
|
|
- a.bindMobile = #{bindMobile}
|
|
|
- <if test="clubID != null and clubID != ''">
|
|
|
- AND a.clubID != #{clubID}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+ <!--适用于企业通过手机号码查询用户-->
|
|
|
+ <select id="findListBuyBindMobile" resultType="com.caimei.modules.user.entity.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="com.caimei.modules.user.entity.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="findListBuyUserInfo" resultType="com.caimei.modules.user.entity.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>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.registerTime DESC
|
|
|
+ </select>
|
|
|
|
|
|
<select id="findAllList" resultType="CmUser">
|
|
|
SELECT
|
|
@@ -180,204 +171,172 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" parameterType="CmUser" keyProperty="userID" useGeneratedKeys="true">
|
|
|
- INSERT INTO user(
|
|
|
- userOrganizeID,
|
|
|
- account,
|
|
|
- realName,
|
|
|
- userIdentity,
|
|
|
- mobile,
|
|
|
- bindMobile,
|
|
|
- userPermission,
|
|
|
- email,
|
|
|
- userName,
|
|
|
- source,
|
|
|
- image,
|
|
|
- password,
|
|
|
- name,
|
|
|
- registerUserTypeID,
|
|
|
- manufacturerStatus,
|
|
|
- shopID,
|
|
|
- auditStatus,
|
|
|
- auditTime,
|
|
|
- auditNote,
|
|
|
- registerTime,
|
|
|
- registerIP,
|
|
|
- loginTime,
|
|
|
- loginFailTime,
|
|
|
- loginIP,
|
|
|
- validFlag,
|
|
|
- clubStatus,
|
|
|
- <if test="clubID != null and clubID != ''">
|
|
|
- clubID,
|
|
|
- </if>
|
|
|
- agreeFlag,
|
|
|
- serviceProviderStatus,
|
|
|
- serviceProviderID,
|
|
|
- userMoney,
|
|
|
- ableUserMoney,
|
|
|
- logoffTime,
|
|
|
- appKey,
|
|
|
- appSecret,
|
|
|
- scanFlag,
|
|
|
- userBeans
|
|
|
- ) VALUES (
|
|
|
- #{userOrganizeID},
|
|
|
- #{account},
|
|
|
- #{realName},
|
|
|
- #{userIdentity},
|
|
|
- #{mobile},
|
|
|
- #{bindMobile},
|
|
|
- #{userPermission},
|
|
|
- #{email},
|
|
|
- #{userName},
|
|
|
- #{source},
|
|
|
- #{image},
|
|
|
- #{password},
|
|
|
- #{name},
|
|
|
- #{registerUserTypeID},
|
|
|
- #{manufacturerStatus},
|
|
|
- #{shopID},
|
|
|
- #{auditStatus},
|
|
|
- #{auditTime},
|
|
|
- #{auditNote},
|
|
|
- #{registerTime},
|
|
|
- #{registerIP},
|
|
|
- #{loginTime},
|
|
|
- #{loginFailTime},
|
|
|
- #{loginIP},
|
|
|
- #{validFlag},
|
|
|
- #{clubStatus},
|
|
|
- <if test="clubID != null and clubID != ''">
|
|
|
- #{clubID},
|
|
|
- </if>
|
|
|
- #{agreeFlag},
|
|
|
- #{serviceProviderStatus},
|
|
|
- #{serviceProviderID},
|
|
|
- #{userMoney},
|
|
|
- #{ableUserMoney},
|
|
|
- #{logoffTime},
|
|
|
- #{appKey},
|
|
|
- #{appSecret},
|
|
|
- #{scanFlag},
|
|
|
- #{userBeans}
|
|
|
- )
|
|
|
- </insert>
|
|
|
+ INSERT INTO user(
|
|
|
+ userOrganizeID,
|
|
|
+ account,
|
|
|
+ realName,
|
|
|
+ userIdentity,
|
|
|
+ mobile,
|
|
|
+ bindMobile,
|
|
|
+ email,
|
|
|
+ userName,
|
|
|
+ source,
|
|
|
+ image,
|
|
|
+ password,
|
|
|
+ name,
|
|
|
+ registerUserTypeID,
|
|
|
+ manufacturerStatus,
|
|
|
+ shopID,
|
|
|
+ auditStatus,
|
|
|
+ auditTime,
|
|
|
+ auditNote,
|
|
|
+ registerTime,
|
|
|
+ registerIP,
|
|
|
+ loginTime,
|
|
|
+ loginIP,
|
|
|
+ validFlag,
|
|
|
+ <if test="clubID != null and clubID != ''">
|
|
|
+ clubID,
|
|
|
+ </if>
|
|
|
+ agreeFlag,
|
|
|
+ serviceProviderStatus,
|
|
|
+ serviceProviderID,
|
|
|
+ userMoney,
|
|
|
+ ableUserMoney,
|
|
|
+ scanFlag,
|
|
|
+ userBeans
|
|
|
+ ) VALUES (
|
|
|
+ #{userOrganizeID},
|
|
|
+ #{account},
|
|
|
+ #{realName},
|
|
|
+ #{userIdentity},
|
|
|
+ #{mobile},
|
|
|
+ #{bindMobile},
|
|
|
+ #{email},
|
|
|
+ #{userName},
|
|
|
+ #{source},
|
|
|
+ #{image},
|
|
|
+ #{password},
|
|
|
+ #{name},
|
|
|
+ #{registerUserTypeID},
|
|
|
+ #{manufacturerStatus},
|
|
|
+ #{shopID},
|
|
|
+ #{auditStatus},
|
|
|
+ #{auditTime},
|
|
|
+ #{auditNote},
|
|
|
+ #{registerTime},
|
|
|
+ #{registerIP},
|
|
|
+ #{loginTime},
|
|
|
+ #{loginIP},
|
|
|
+ #{validFlag},
|
|
|
+ <if test="clubID != null and clubID != ''">
|
|
|
+ #{clubID},
|
|
|
+ </if>
|
|
|
+ #{agreeFlag},
|
|
|
+ #{serviceProviderStatus},
|
|
|
+ #{serviceProviderID},
|
|
|
+ #{userMoney},
|
|
|
+ #{ableUserMoney},
|
|
|
+ #{scanFlag},
|
|
|
+ #{userBeans}
|
|
|
+ )
|
|
|
+ </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="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="name != null and name != ''">
|
|
|
- name = #{name},
|
|
|
- </if>
|
|
|
- <if test="registerUserTypeID != null and registerUserTypeID != ''">
|
|
|
- registerUserTypeID = #{registerUserTypeID},
|
|
|
- </if>
|
|
|
- <if test="manufacturerStatus != null and manufacturerStatus != ''">
|
|
|
- manufacturerStatus = #{manufacturerStatus},
|
|
|
- </if>
|
|
|
- <if test="shopID != null and shopID != ''">
|
|
|
- shopID = #{shopID},
|
|
|
- </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="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="serviceProviderStatus != null and serviceProviderStatus != ''">
|
|
|
- serviceProviderStatus = #{serviceProviderStatus},
|
|
|
- </if>
|
|
|
- <if test="serviceProviderID != null and serviceProviderID != ''">
|
|
|
- serviceProviderID = #{serviceProviderID},
|
|
|
- </if>
|
|
|
- <if test="userMoney != null and userMoney != ''">
|
|
|
- userMoney = #{userMoney},
|
|
|
- </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="scanFlag != null and scanFlag != ''">
|
|
|
- scanFlag = #{scanFlag},
|
|
|
- </if>
|
|
|
- <if test="userBeans != null and userBeans != ''">
|
|
|
- userBeans = #{userBeans},
|
|
|
- </if>
|
|
|
- <if test="guideFlag != null and guideFlag != ''">
|
|
|
- guideFlag = #{guideFlag},
|
|
|
- </if>
|
|
|
- userID = #{userID}
|
|
|
- WHERE userID = #{userID}
|
|
|
- </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="mobile != null and mobile != ''">
|
|
|
+ mobile = #{mobile},
|
|
|
+ </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="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="registerUserTypeID != null and registerUserTypeID != ''">
|
|
|
+ registerUserTypeID = #{registerUserTypeID},
|
|
|
+ </if>
|
|
|
+ <if test="manufacturerStatus != null and manufacturerStatus != ''">
|
|
|
+ manufacturerStatus = #{manufacturerStatus},
|
|
|
+ </if>
|
|
|
+ <if test="shopID != null and shopID != ''">
|
|
|
+ shopID = #{shopID},
|
|
|
+ </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="loginIP != null and loginIP != ''">
|
|
|
+ loginIP = #{loginIP},
|
|
|
+ </if>
|
|
|
+ <if test="validFlag != null and validFlag != ''">
|
|
|
+ validFlag = #{validFlag},
|
|
|
+ </if>
|
|
|
+ <if test="clubID != null and clubID != ''">
|
|
|
+ clubID = #{clubID},
|
|
|
+ </if>
|
|
|
+ <if test="agreeFlag != null and agreeFlag != ''">
|
|
|
+ agreeFlag = #{agreeFlag},
|
|
|
+ </if>
|
|
|
+ <if test="serviceProviderStatus != null and serviceProviderStatus != ''">
|
|
|
+ serviceProviderStatus = #{serviceProviderStatus},
|
|
|
+ </if>
|
|
|
+ <if test="serviceProviderID != null and serviceProviderID != ''">
|
|
|
+ serviceProviderID = #{serviceProviderID},
|
|
|
+ </if>
|
|
|
+ <if test="userMoney != null and userMoney != ''">
|
|
|
+ userMoney = #{userMoney},
|
|
|
+ </if>
|
|
|
+ <if test="userBeans != null and userBeans != ''">
|
|
|
+ userBeans = #{userBeans},
|
|
|
+ </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>
|
|
|
+ DELETE
|
|
|
+ FROM user
|
|
|
+ WHERE userID = #{userID}
|
|
|
+ </delete>
|
|
|
|
|
|
<select id="findUserByRegisterType" resultType="CmUser">
|
|
|
SELECT
|
|
@@ -408,66 +367,47 @@
|
|
|
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 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>
|
|
|
+ <if test="validFlag != null and validFlag != ''">
|
|
|
+ validFlag = #{validFlag},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE userID = #{userID}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateShopStatus">
|
|
|
- UPDATE shop
|
|
|
+ UPDATE shop
|
|
|
<set>
|
|
|
<if test="status != null and status != ''">
|
|
|
status = #{status},
|
|
|
</if>
|
|
|
</set>
|
|
|
WHERE userID = #{userID}
|
|
|
- </update>
|
|
|
+ </update>
|
|
|
|
|
|
<update id="updateUserAudit">
|
|
|
UPDATE user
|
|
|
<set>
|
|
|
- <if test="auditStatus != null and auditStatus != ''">
|
|
|
- auditStatus = #{auditStatus},
|
|
|
- </if>
|
|
|
+ <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>
|
|
|
+ <if test="auditTime != null and auditTime != ''">
|
|
|
+ auditTime = #{auditTime},
|
|
|
+ </if>
|
|
|
+ <if test="validFlag != null and validFlag != ''">
|
|
|
+ validFlag = #{validFlag},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE userID = #{userId}
|
|
|
</update>
|
|
@@ -475,133 +415,116 @@
|
|
|
<update id="updateShopAudit">
|
|
|
UPDATE shop
|
|
|
<set>
|
|
|
- <if test="auditStatus != null and auditStatus != ''">
|
|
|
- auditStatus = #{auditStatus},
|
|
|
- </if>
|
|
|
+ <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>
|
|
|
+ <if test="auditTime != null and auditTime != ''">
|
|
|
+ auditTime = #{auditTime},
|
|
|
+ </if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- checkMan = #{name},
|
|
|
- </if>
|
|
|
+ checkMan = #{name},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE shopID = #{shopId}
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateUserInfo">
|
|
|
+ UPDATE user
|
|
|
+ SET realName = #{realName},
|
|
|
+ name = #{name},
|
|
|
+ userName = #{userName},
|
|
|
+ bindMobile = #{bindMobile},
|
|
|
+ email = #{email}
|
|
|
+ WHERE userID = #{userID}
|
|
|
+ </update>
|
|
|
|
|
|
- <update id="updateEmployeePermission">
|
|
|
- UPDATE user SET userPermission = #{userPermission}
|
|
|
- WHERE 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="updateAbleUserMoney">
|
|
|
- UPDATE user SET
|
|
|
- ableUserMoney = #{ableUserMoney}
|
|
|
- WHERE userID = #{userId}
|
|
|
- </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>
|
|
|
+ <update id="updateMoney">
|
|
|
+ UPDATE user
|
|
|
+ SET userMoney = #{userMoney},
|
|
|
+ ableUserMoney = #{ableUserMoney}
|
|
|
+ WHERE userID = #{userID}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="findUserByMobile" resultType="com.caimei.modules.user.entity.CmUser">
|
|
|
- SELECT
|
|
|
- <include refid="cmUserColumns"/>
|
|
|
- FROM user a
|
|
|
- WHERE a.mobile=#{mobile}
|
|
|
- </select>
|
|
|
+ <select id="findUserByMobile" resultType="com.caimei.modules.user.entity.CmUser">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmUserColumns"/>
|
|
|
+ FROM user a
|
|
|
+ WHERE a.mobile=#{mobile}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getUserPayOrder" resultType="com.caimei.po.neworder.CmShopOrder">
|
|
|
+ <select id="getUserPayOrder" resultType="com.caimei.po.neworder.CmShopOrder">
|
|
|
select *
|
|
|
from cm_shop_order
|
|
|
- where userID=#{userId}
|
|
|
+ where 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})
|
|
|
- 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>
|
|
|
- UNION
|
|
|
- select u.*,cu.mobile as operatorMobile from user u
|
|
|
- left join cm_mall_operation_user cu on cu.userID = u.userID
|
|
|
- where 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 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})
|
|
|
+ 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>
|
|
|
+ UNION
|
|
|
+ select u.*,cu.mobile as operatorMobile from user u
|
|
|
+ left join cm_mall_operation_user cu on cu.userID = u.userID
|
|
|
+ where 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>
|
|
|
|
|
|
- <select id="findUserByOrganizeId" resultType="com.caimei.modules.user.entity.CmUser">
|
|
|
- SELECT
|
|
|
- <include refid="cmUserColumns"/>
|
|
|
- FROM user a
|
|
|
- WHERE a.userOrganizeID=#{organizeId}
|
|
|
- limit 1
|
|
|
- </select>
|
|
|
+ <update id="updateUserBeans">
|
|
|
+ UPDATE USER
|
|
|
+ SET userBeans = #{userBeans}
|
|
|
+ WHERE userID = #{userID}
|
|
|
+ </update>
|
|
|
|
|
|
- <update id="updateByClubStatus">
|
|
|
- UPDATE user SET clubStatus = #{clubStatus} WHERE userID = #{confirmUserId}
|
|
|
- </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="findByConfirmTime" resultType="date">
|
|
|
- SELECT
|
|
|
- confirmTime
|
|
|
- FROM
|
|
|
- club_confirm_record
|
|
|
- WHERE
|
|
|
- userId = #{userId}
|
|
|
- ORDER BY
|
|
|
- confirmTime DESC
|
|
|
- LIMIT
|
|
|
- 1
|
|
|
- </select>
|
|
|
- <select id="findUserBeans" resultType="java.lang.Integer">
|
|
|
- select userBeans
|
|
|
- from user
|
|
|
- where userID = #{userId}
|
|
|
- </select>
|
|
|
- <select id="selOrgan" resultType="com.caimei.modules.user.entity.CmOrganValueSystem">
|
|
|
- select * from cm_organ_value_system where userID = #{userId} and stage = 0 limit 1
|
|
|
- </select>
|
|
|
- <insert id="insertOrgan">
|
|
|
- INSERT INTO cm_organ_value_system
|
|
|
- (userID, stage, delType)
|
|
|
- VALUES(#{userId},0,1)
|
|
|
- </insert>
|
|
|
+ <select id="findUserBeans" resultType="java.lang.Integer">
|
|
|
+ select userBeans
|
|
|
+ from user
|
|
|
+ where userID = #{userId}
|
|
|
+ </select>
|
|
|
+ <select id="selOrgan" resultType="com.caimei.modules.user.entity.CmOrganValueSystem">
|
|
|
+ select *
|
|
|
+ from cm_organ_value_system
|
|
|
+ where userID = #{userId}
|
|
|
+ and stage = 0
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+ <insert id="insertOrgan">
|
|
|
+ INSERT INTO cm_organ_value_system
|
|
|
+ (userID, stage, delType)
|
|
|
+ VALUES (#{userId}, 0, 1)
|
|
|
+ </insert>
|
|
|
</mapper>
|