|
@@ -2,45 +2,59 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei365.user.mapper.BaseMapper">
|
|
|
<update id="updatePasswordByUserId">
|
|
|
- update user set password = #{password}
|
|
|
+ update user
|
|
|
+ set password = #{password}
|
|
|
where userID = #{userId}
|
|
|
</update>
|
|
|
<update id="updateMobileByUserId">
|
|
|
- update user set bindMobile = #{mobile}
|
|
|
+ update user
|
|
|
+ set bindMobile = #{mobile}
|
|
|
where userID = #{userId}
|
|
|
</update>
|
|
|
<update id="updateShopMobileByShopId">
|
|
|
- update shop set contractMobile = #{mobile}
|
|
|
+ update shop
|
|
|
+ set contractMobile = #{mobile}
|
|
|
where shopID = #{shopId}
|
|
|
</update>
|
|
|
<update id="updateClubMobileByClubId">
|
|
|
- update club set contractMobile = #{mobile}
|
|
|
+ update club
|
|
|
+ set contractMobile = #{mobile}
|
|
|
where clubID = #{clubId}
|
|
|
</update>
|
|
|
<select id="getUserIdByEmail" resultType="java.lang.Integer">
|
|
|
- select userID from user
|
|
|
- where email = #{email} and userIdentity in (1,2,3,4)
|
|
|
+ select userID
|
|
|
+ from user
|
|
|
+ where email = #{email}
|
|
|
+ and userIdentity in (1, 2, 3, 4)
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getUserIdByUserId" resultType="java.lang.Integer">
|
|
|
- select userID from user
|
|
|
- where userID = #{userId} and userIdentity in (1,2,3,4)
|
|
|
+ select userID
|
|
|
+ from user
|
|
|
+ where userID = #{userId}
|
|
|
+ and userIdentity in (1, 2, 3, 4)
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getUserIdByMobile" resultType="java.lang.Integer">
|
|
|
- SELECT u.userID FROM USER u
|
|
|
- LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
|
|
|
- WHERE u.bindMobile = #{mobile} and u.userIdentity in (1,2,3,4)
|
|
|
+ SELECT u.userID
|
|
|
+ FROM USER u
|
|
|
+ LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
|
|
|
+ WHERE u.bindMobile = #{mobile}
|
|
|
+ and u.userIdentity in (1, 2, 3, 4)
|
|
|
UNION
|
|
|
- SELECT u.userID FROM USER u
|
|
|
- LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
|
|
|
- WHERE cu.mobile = #{mobile} AND cu.delFlag != 1
|
|
|
- AND u.userIdentity IN (1,2,3,4)
|
|
|
+ SELECT u.userID
|
|
|
+ FROM USER u
|
|
|
+ LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
|
|
|
+ WHERE cu.mobile = #{mobile}
|
|
|
+ AND cu.delFlag != 1
|
|
|
+ AND u.userIdentity IN (1, 2, 3, 4)
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
<select id="getOperationUserIdByMobile" resultType="java.lang.Integer">
|
|
|
- select userID from cm_mall_operation_user
|
|
|
- where mobile = #{mobile} and delFlag = '0'
|
|
|
+ select userID
|
|
|
+ from cm_mall_operation_user
|
|
|
+ where mobile = #{mobile}
|
|
|
+ and delFlag = '0'
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getClubStatusByUserId" resultType="java.lang.Integer">
|
|
@@ -54,29 +68,34 @@
|
|
|
where userID = #{userId}
|
|
|
</select>
|
|
|
<select id="getOperationIdByMobile" resultType="java.lang.Integer">
|
|
|
- select id from cm_mall_operation_user
|
|
|
- where mobile = #{mobile} and delFlag = '0'
|
|
|
+ select id
|
|
|
+ from cm_mall_operation_user
|
|
|
+ where mobile = #{mobile}
|
|
|
+ and delFlag = '0'
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getProvince" resultType="com.caimei365.user.model.vo.ProvinceVo">
|
|
|
select provinceID as provinceId, name, validFlag, deliveryFee, freeMinTotalPrice
|
|
|
- from province where provinceID = #{provinceId}
|
|
|
+ from province
|
|
|
+ where provinceID = #{provinceId}
|
|
|
</select>
|
|
|
<select id="getCity" resultType="com.caimei365.user.model.vo.CityVo">
|
|
|
select cityID as cityId, provinceID as provinceId, name, validFlag
|
|
|
- from city where cityID = #{cityId}
|
|
|
+ from city
|
|
|
+ where cityID = #{cityId}
|
|
|
</select>
|
|
|
<select id="getTown" resultType="com.caimei365.user.model.vo.TownVo">
|
|
|
select townID as townId, cityID as cityId, name, zip, telZip, validFlag
|
|
|
- from town where townID = #{townID}
|
|
|
+ from town
|
|
|
+ where townID = #{townID}
|
|
|
</select>
|
|
|
<select id="getUserByUserId" resultType="com.caimei365.user.model.vo.UserVo">
|
|
|
- select userID as userId,
|
|
|
- registerUserTypeID as registerUserTypeId,
|
|
|
- source,
|
|
|
- clubID as clubId,
|
|
|
- shopID as shopId,
|
|
|
- serviceProviderID as serviceProviderId,
|
|
|
+ select userID as userId,
|
|
|
+ registerUserTypeID as registerUserTypeId,
|
|
|
+ source,
|
|
|
+ clubID as clubId,
|
|
|
+ shopID as shopId,
|
|
|
+ serviceProviderID as serviceProviderId,
|
|
|
name,
|
|
|
userName,
|
|
|
email,
|
|
@@ -92,7 +111,7 @@
|
|
|
auditStatus,
|
|
|
agreeFlag,
|
|
|
registerTime,
|
|
|
- registerIP as registerIp,
|
|
|
+ registerIP as registerIp,
|
|
|
guideFlag,
|
|
|
validFlag,
|
|
|
userBeans,
|
|
@@ -102,10 +121,15 @@
|
|
|
where userID = #{userId}
|
|
|
</select>
|
|
|
<select id="getUserNameByUserId" resultType="java.lang.String">
|
|
|
- select userName from user where userID = #{userId}
|
|
|
+ select userName
|
|
|
+ from user
|
|
|
+ where userID = #{userId}
|
|
|
</select>
|
|
|
<select id="getAfterSalesPhone" resultType="java.lang.String">
|
|
|
- select contactNumber from cm_mall_organize where id = 0 and delFlag = '0'
|
|
|
+ select contactNumber
|
|
|
+ from cm_mall_organize
|
|
|
+ where id = 0
|
|
|
+ and delFlag = '0'
|
|
|
</select>
|
|
|
<select id="getSensitiveWords" resultType="java.lang.String">
|
|
|
select words
|
|
@@ -119,8 +143,14 @@
|
|
|
<select id="findLabelsByLableIds" resultType="java.lang.String">
|
|
|
select keyword
|
|
|
from cm_user_search_frequency
|
|
|
- where trueStatus=1
|
|
|
- and delStatus=1
|
|
|
- and id in (#{labelIds})
|
|
|
+ where trueStatus = 1
|
|
|
+ and delStatus = 1
|
|
|
+ and id in (#{labelIds})
|
|
|
+ </select>
|
|
|
+ <select id="findBankByUserId" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(id)
|
|
|
+ FROM cm_quickpay_info
|
|
|
+ WHERE userId = #{userId}
|
|
|
+ and delflag = 0
|
|
|
</select>
|
|
|
</mapper>
|