|
@@ -62,8 +62,8 @@
|
|
|
</update>
|
|
|
<update id="updateRelaByAuthId">
|
|
|
update cm_brand_auth
|
|
|
- set relationId = #{relationId},
|
|
|
- relationName = #{relationName}
|
|
|
+ set relationId = #{relationId},
|
|
|
+ relationName = #{relationName}
|
|
|
where id = #{authId}
|
|
|
</update>
|
|
|
<update id="updateAuthAuditStatus">
|
|
@@ -76,7 +76,9 @@
|
|
|
where id = #{authId}
|
|
|
</update>
|
|
|
<select id="getRelationInfo" resultType="com.caimei.model.po.CmBrandAuthPo">
|
|
|
- select relationId,relationName from cm_brand_auth where id=#{id}
|
|
|
+ select relationId, relationName
|
|
|
+ from cm_brand_auth
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
|
<update id="deleteAuthByAuthId">
|
|
|
update cm_brand_auth
|
|
@@ -145,9 +147,11 @@
|
|
|
where authId = #{authId}
|
|
|
</delete>
|
|
|
<select id="getClubUserIdByAuthId" resultType="java.lang.Integer">
|
|
|
- select cbcu1.id from cm_brand_club_user cbcu1 left join cm_brand_auth a
|
|
|
- on a.createBy = cbcu1.id
|
|
|
- where a.id=#{authId}
|
|
|
+ select cbcu1.id
|
|
|
+ from cm_brand_club_user cbcu1
|
|
|
+ left join cm_brand_auth a
|
|
|
+ on a.createBy = cbcu1.id
|
|
|
+ where a.id = #{authId}
|
|
|
</select>
|
|
|
<select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
|
|
|
select a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
|
|
@@ -243,7 +247,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getAuthListAll" resultType="com.caimei.model.vo.AuthVo">
|
|
|
- select DISTINCT a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
|
|
|
+ select DISTINCT a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus,
|
|
|
+ a.shopAuditStatus,
|
|
|
a.createTime,
|
|
|
if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name)
|
|
|
as auditBy,a.auditTime,a.invalidReason,
|
|
@@ -416,19 +421,22 @@
|
|
|
select provinceID
|
|
|
from province
|
|
|
where name like
|
|
|
- concat(#{provinceName}, '%') limit 1;
|
|
|
+ concat(#{provinceName}, '%')
|
|
|
+ limit 1;
|
|
|
</select>
|
|
|
<select id="getCityId" resultType="java.lang.Integer">
|
|
|
select cityID
|
|
|
from city
|
|
|
where name like
|
|
|
- concat(#{cityName}, '%') limit 1;
|
|
|
+ concat(#{cityName}, '%')
|
|
|
+ limit 1;
|
|
|
</select>
|
|
|
<select id="getTownId" resultType="java.lang.Integer">
|
|
|
select townID
|
|
|
from town
|
|
|
where name like
|
|
|
- concat(#{townName}, '%') limit 1;
|
|
|
+ concat(#{townName}, '%')
|
|
|
+ limit 1;
|
|
|
</select>
|
|
|
<select id="getLdmLatestClubId" resultType="java.lang.Integer">
|
|
|
select ldmClubId
|
|
@@ -444,19 +452,22 @@
|
|
|
select name
|
|
|
from nissan_base_region1
|
|
|
where code = #{regId1}
|
|
|
- and level = 0 limit 1
|
|
|
+ and level = 0
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getCityName" resultType="java.lang.String">
|
|
|
select name
|
|
|
from nissan_base_region1
|
|
|
where code = #{regId1}
|
|
|
- and level = 1 limit 1
|
|
|
+ and level = 1
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getTownName" resultType="java.lang.String">
|
|
|
select name
|
|
|
from nissan_base_region1
|
|
|
where code = #{regId1}
|
|
|
- and level = 2 limit 1
|
|
|
+ and level = 2
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getTownList" resultType="com.caimei.model.po.TownPo">
|
|
|
select townID as townId, cityID as cityId
|
|
@@ -586,7 +597,8 @@
|
|
|
<select id="getAdminUserId" resultType="java.lang.Integer">
|
|
|
select authUserId
|
|
|
from cm_brand_auth_user
|
|
|
- where userIdentity = 1 limit 1
|
|
|
+ where userIdentity = 1
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
|
|
|
select at.id as templateId, templateImage, qrPosition, qrSize
|
|
@@ -629,17 +641,16 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getClubBindAuth" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
- select au.id as authId,au.authParty
|
|
|
+ select au.id as authId, au.authParty
|
|
|
from cm_brand_auth au
|
|
|
- where au.id not in (
|
|
|
- select cu.authId
|
|
|
-
|
|
|
- from cm_brand_auth a
|
|
|
- left join cm_brand_club_user cu on cu.authId = a.id
|
|
|
- where cu.authUserId = #{authUserId}
|
|
|
- and cu.delFlag = 0
|
|
|
- and (a.id is null || a.delFlag = 0))
|
|
|
- and au.delFlag = 0 and au.authUserId = #{authUserId}
|
|
|
+ where au.id not in (select cu.authId
|
|
|
+ from cm_brand_auth a
|
|
|
+ left join cm_brand_club_user cu on cu.authId = a.id
|
|
|
+ where cu.authUserId = #{authUserId}
|
|
|
+ and cu.delFlag = 0
|
|
|
+ and (a.id is null || a.delFlag = 0))
|
|
|
+ and au.delFlag = 0
|
|
|
+ and au.authUserId = #{authUserId}
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -647,20 +658,22 @@
|
|
|
select DISTINCT r.authId as relationId
|
|
|
from cm_brand_product_relation r
|
|
|
LEFT JOIN cm_brand_auth_product a on r.productId = a.id
|
|
|
- where snCode =#{snCode}
|
|
|
+ where snCode = #{snCode}
|
|
|
</select>
|
|
|
<select id="getPrefix" resultType="java.lang.String">
|
|
|
- select ifnull(prefix,'app')
|
|
|
+ select ifnull(prefix, 'app')
|
|
|
from cm_brand_auth_user
|
|
|
where authUserId = #{authUserId}
|
|
|
</select>
|
|
|
<insert id="saveVideoInfo">
|
|
|
- insert into cm_challenge_round(userName,title,ossName,ossUrl,cover,releaseTime,authId,authUserId)
|
|
|
- values(#{userName},#{title},#{ossName},#{ossUrl},#{cover},#{releaseTime},#{authId},#{authUserId})
|
|
|
+ insert into cm_challenge_round(userName, title, ossName, ossUrl, cover, releaseTime, authId, authUserId)
|
|
|
+ values (#{userName}, #{title}, #{ossName}, #{ossUrl}, #{cover}, #{releaseTime}, #{authId}, #{authUserId})
|
|
|
</insert>
|
|
|
<insert id="saveVideo">
|
|
|
- insert into cm_ross_challenge_video(userName,title,ossName,ossUrl,cover,releaseTime,authId,linked,authUserId,clubUserId)
|
|
|
- values(#{userName},#{title},#{ossName},#{ossUrl},#{cover},#{releaseTime},#{authId},#{linked},#{authUserId},#{clubUserId})
|
|
|
+ insert into cm_ross_challenge_video(userName, title, ossName, ossUrl, cover, releaseTime, authId, linked,
|
|
|
+ authUserId, clubUserId)
|
|
|
+ values (#{userName}, #{title}, #{ossName}, #{ossUrl}, #{cover}, #{releaseTime}, #{authId}, #{linked},
|
|
|
+ #{authUserId}, #{clubUserId})
|
|
|
</insert>
|
|
|
<select id="getauthUserId" resultType="java.lang.String">
|
|
|
select authUserId
|
|
@@ -675,128 +688,149 @@
|
|
|
<select id="checkActivityTime" resultType="java.lang.Integer">
|
|
|
select id
|
|
|
from cm_challenge_activity
|
|
|
- where startTime <#{releaseTime} and endTime >#{releaseTime} and status=1
|
|
|
+ where startTime < #{releaseTime}
|
|
|
+ and endTime > #{releaseTime}
|
|
|
+ and status = 1
|
|
|
</select>
|
|
|
<select id="getPublishedVideoList" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select
|
|
|
+ cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
left join cm_brand_auth cba on cr.authId=cba.id
|
|
|
left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
|
|
|
- where cr.authUserId=#{authUserId}
|
|
|
+ where cr.authUserId=#{authUserId}
|
|
|
<if test="clubUserName != null and clubUserName != ''">
|
|
|
and (cr.userName like concat('%', #{clubUserName})
|
|
|
- or cba.authParty like concat('%', #{clubUserName},'%') )
|
|
|
+ or cba.authParty like concat('%', #{clubUserName},'%') )
|
|
|
</if>
|
|
|
- and cr.releaseTime >#{startTime} and cr.releaseTime<#{endTime}
|
|
|
+ and cr.releaseTime >#{startTime} and cr.releaseTime<#{endTime}
|
|
|
</select>
|
|
|
<select id="getPublishedVideoListNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select
|
|
|
+ cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
left join cm_brand_auth cba on cr.authId=cba.id
|
|
|
left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
|
|
|
where cr.authUserId=#{authUserId}
|
|
|
<if test="clubUserName != null and clubUserName != ''">
|
|
|
and (cr.userName like concat('%', #{clubUserName})
|
|
|
- or cba.authParty like concat('%', #{clubUserName},'%') )
|
|
|
+ or cba.authParty like concat('%', #{clubUserName},'%') )
|
|
|
</if>
|
|
|
- and (cr.releaseTime <#{startTime} or cr.releaseTime >#{endTime})
|
|
|
+ and (cr.releaseTime <#{startTime} or cr.releaseTime >#{endTime})
|
|
|
</select>
|
|
|
<select id="getPublishedVideo" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select
|
|
|
+ cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
left join cm_brand_auth cba on cr.authId=cba.id
|
|
|
left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
|
|
|
where cr.authUserId=#{authUserId}
|
|
|
- and cr.releaseTime >#{startTime} and cr.releaseTime<#{endTime}
|
|
|
+ and cr.releaseTime >#{startTime} and cr.releaseTime<#{endTime}
|
|
|
<if test="mobile != null and mobile != ''">
|
|
|
and cr.userName like concat('%', #{mobile})
|
|
|
</if>
|
|
|
<if test="authParty != null and authParty != ''">
|
|
|
- and cba.authParty like concat('%', #{authParty},'%')
|
|
|
+ and cba.authParty like concat('%', #{authParty},'%')
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
and cr.status = #{status}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getPublishedVideoNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select
|
|
|
+ cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
left join cm_brand_auth cba on cr.authId=cba.id
|
|
|
left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
|
|
|
where cr.authUserId=#{authUserId}
|
|
|
- and (cr.releaseTime <#{startTime} or cr.releaseTime >#{endTime})
|
|
|
+ and (cr.releaseTime <#{startTime} or cr.releaseTime >#{endTime})
|
|
|
<if test="mobile != null and mobile != ''">
|
|
|
and cr.userName like concat('%', #{mobile})
|
|
|
</if>
|
|
|
<if test="authParty != null and authParty != ''">
|
|
|
- and cba.authParty like concat('%', #{authParty},'%')
|
|
|
+ and cba.authParty like concat('%', #{authParty},'%')
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
and cr.status = #{status}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="checkActivityId" resultType="com.caimei.model.vo.ChallengeActivityVo">
|
|
|
- select id,authUserId
|
|
|
+ select id, authUserId
|
|
|
from cm_challenge_activity
|
|
|
</select>
|
|
|
<insert id="saveActivityInfo">
|
|
|
- insert into cm_challenge_activity(startTime,endTime,status,authUserId)
|
|
|
- values(#{startTime},#{endTime},#{status},#{authUserId})
|
|
|
+ insert into cm_challenge_activity(startTime, endTime, status, authUserId)
|
|
|
+ values (#{startTime}, #{endTime}, #{status}, #{authUserId})
|
|
|
</insert>
|
|
|
<update id="upActivityInfo">
|
|
|
- update cm_challenge_activity set
|
|
|
- startTime=#{startTime},
|
|
|
+ update cm_challenge_activity
|
|
|
+ set startTime=#{startTime},
|
|
|
endTime=#{endTime},
|
|
|
- status = #{status}
|
|
|
- where authUserId=#{authUserId}
|
|
|
+ status = #{status}
|
|
|
+ where authUserId = #{authUserId}
|
|
|
</update>
|
|
|
<select id="getActivityTime" resultType="com.caimei.model.vo.ChallengeActivityVo">
|
|
|
- select id,startTime,endTime,status,authUserId
|
|
|
+ select id, startTime, endTime, status, authUserId
|
|
|
from cm_challenge_activity
|
|
|
- where authUserId=#{authUserId}
|
|
|
+ where authUserId = #{authUserId}
|
|
|
</select>
|
|
|
<update id="savaShareIdByAuthId">
|
|
|
- update cm_challenge_round set
|
|
|
- shareId=#{shareId}
|
|
|
- where authId=#{authId}
|
|
|
+ update cm_challenge_round
|
|
|
+ set shareId=#{shareId}
|
|
|
+ where authId = #{authId}
|
|
|
</update>
|
|
|
<select id="getShareId" resultType="java.lang.String">
|
|
|
select shareId
|
|
|
from cm_challenge_round
|
|
|
- where shareId=#{shareId}
|
|
|
+ where shareId = #{shareId}
|
|
|
</select>
|
|
|
<update id="savaItemIdByShareId">
|
|
|
- update cm_challenge_round set
|
|
|
- itemId=#{itemId},
|
|
|
+ update cm_challenge_round
|
|
|
+ set itemId=#{itemId},
|
|
|
status=1
|
|
|
- where shareId=#{shareId}
|
|
|
+ where shareId = #{shareId}
|
|
|
</update>
|
|
|
<select id="getAuthUserName" resultType="java.lang.String">
|
|
|
select name
|
|
|
from cm_brand_auth cba
|
|
|
- left join cm_brand_auth_user cu on cu.authUserId=cba.authUserId
|
|
|
- where cba.id=#{authId}
|
|
|
+ left join cm_brand_auth_user cu on cu.authUserId = cba.authUserId
|
|
|
+ where cba.id = #{authId}
|
|
|
</select>
|
|
|
<select id="getMobileByAuthId" resultType="java.lang.String">
|
|
|
select userName
|
|
|
from cm_challenge_round cr
|
|
|
- where cr.authId=#{authId}
|
|
|
+ where cr.authId = #{authId}
|
|
|
</select>
|
|
|
<update id="savaDyCommand">
|
|
|
- update cm_challenge_round set
|
|
|
- dyCommand=#{content}
|
|
|
- where authId=#{authId}
|
|
|
+ update cm_challenge_round
|
|
|
+ set dyCommand=#{content}
|
|
|
+ where authId = #{authId}
|
|
|
</update>
|
|
|
<select id="getAuthPartylist" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
- from cm_challenge_round cr left join cm_brand_auth cba
|
|
|
- on cr.authId=cba.id
|
|
|
- where cr.authUserId=#{authUserId}
|
|
|
+ select cr.id,
|
|
|
+ cr.userName,
|
|
|
+ cr.itemId,
|
|
|
+ cr.title,
|
|
|
+ cr.ossName,
|
|
|
+ cr.ossUrl,
|
|
|
+ cr.cover,
|
|
|
+ cr.releaseTime,
|
|
|
+ cr.status,
|
|
|
+ cr.shareId,
|
|
|
+ cr.authId,
|
|
|
+ cba.authParty,
|
|
|
+ cr.dyCommand,
|
|
|
+ cr.diggCount,
|
|
|
+ cr.playCount
|
|
|
+ from cm_challenge_round cr
|
|
|
+ left join cm_brand_auth cba
|
|
|
+ on cr.authId = cba.id
|
|
|
+ where cr.authUserId = #{authUserId}
|
|
|
</select>
|
|
|
<select id="getOssNameId" resultType="java.lang.String">
|
|
|
select ossName
|
|
|
from cm_challenge_round cr
|
|
|
- where cr.id=#{videoID}
|
|
|
+ where cr.id = #{videoID}
|
|
|
</select>
|
|
|
<delete id="deleteVideoById">
|
|
|
delete
|
|
@@ -804,52 +838,96 @@
|
|
|
where id = #{videoID}
|
|
|
</delete>
|
|
|
<select id="getChallengeRoundInfo" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select cr.id,
|
|
|
+ cr.userName,
|
|
|
+ cr.itemId,
|
|
|
+ cr.title,
|
|
|
+ cr.ossName,
|
|
|
+ cr.ossUrl,
|
|
|
+ cr.cover,
|
|
|
+ cr.releaseTime,
|
|
|
+ cr.status,
|
|
|
+ cr.shareId,
|
|
|
+ cr.authId,
|
|
|
+ cr.dyCommand,
|
|
|
+ cr.diggCount,
|
|
|
+ cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
- where cr.id=#{videoID}
|
|
|
+ where cr.id = #{videoID}
|
|
|
</select>
|
|
|
<select id="getChallengeVideoInfo" resultType="com.caimei.model.vo.RossChallengeVideo">
|
|
|
select cr.*
|
|
|
from cm_ross_challenge_video cr
|
|
|
- where cr.id=#{videoID}
|
|
|
+ where cr.id = #{videoID}
|
|
|
</select>
|
|
|
<update id="upStatusById">
|
|
|
- update cm_challenge_activity set
|
|
|
- status = 0
|
|
|
- where id=#{id}
|
|
|
+ update cm_challenge_activity
|
|
|
+ set status = 0
|
|
|
+ where id = #{id}
|
|
|
</update>
|
|
|
<select id="getReleaseTime" resultType="java.lang.String">
|
|
|
select releaseTime
|
|
|
from cm_challenge_round cr
|
|
|
- where cr.userName=#{userName}
|
|
|
+ where cr.userName = #{userName}
|
|
|
</select>
|
|
|
<select id="getRoundlist" resultType="com.caimei.model.vo.ChallengeRoundVo">
|
|
|
- select cr.id,cr.userName,cr.authUserId,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cr.dyCommand,cr.diggCount,cr.playCount
|
|
|
+ select cr.id,
|
|
|
+ cr.userName,
|
|
|
+ cr.authUserId,
|
|
|
+ cr.itemId,
|
|
|
+ cr.title,
|
|
|
+ cr.ossName,
|
|
|
+ cr.ossUrl,
|
|
|
+ cr.cover,
|
|
|
+ cr.releaseTime,
|
|
|
+ cr.status,
|
|
|
+ cr.shareId,
|
|
|
+ cr.authId,
|
|
|
+ cr.dyCommand,
|
|
|
+ cr.diggCount,
|
|
|
+ cr.playCount
|
|
|
from cm_challenge_round cr
|
|
|
</select>
|
|
|
<update id="upVidoInfoById">
|
|
|
- update cm_challenge_round set
|
|
|
- diggCount=#{diggCount},
|
|
|
+ update cm_challenge_round
|
|
|
+ set diggCount=#{diggCount},
|
|
|
playCount=#{playCount}
|
|
|
- where id=#{videoId}
|
|
|
+ where id = #{videoId}
|
|
|
</update>
|
|
|
<insert id="saveRossInfo" parameterType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- insert into cm_ross_challenge_round(authUserId,authId,userName,contestStatus,contestTime,licenseOssUrl,licenseOssName,authenticationStatus,clubUserId)
|
|
|
- values(#{authUserId},#{authId},#{userName},#{contestStatus},#{contestTime},#{licenseOssUrl},#{licenseOssName},#{authenticationStatus},#{clubUserId})
|
|
|
+ insert into cm_ross_challenge_round(authUserId, authId, userName, contestStatus, contestTime, licenseOssUrl,
|
|
|
+ licenseOssName, authenticationStatus, clubUserId)
|
|
|
+ values (#{authUserId}, #{authId}, #{userName}, #{contestStatus}, #{contestTime}, #{licenseOssUrl},
|
|
|
+ #{licenseOssName}, #{authenticationStatus}, #{clubUserId})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertQrCode" parameterType="com.caimei.model.po.AuthQrcodePo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO cm_brand_auth_qrcode(authUserId, productTypeId, addtime)
|
|
|
+ VALUES (#{authUserId}, #{productTypeId}, now())
|
|
|
</insert>
|
|
|
<select id="getClubUserId" resultType="java.lang.Integer">
|
|
|
- select id from cm_brand_club_user where mobile=#{mobile}
|
|
|
+ select id
|
|
|
+ from cm_brand_club_user
|
|
|
+ where mobile = #{mobile}
|
|
|
order by addTime desc
|
|
|
</select>
|
|
|
<select id="getInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- select * from cm_ross_challenge_round where userName=#{userName} and contestStatus=1
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where userName = #{userName}
|
|
|
+ and contestStatus = 1
|
|
|
</select>
|
|
|
<select id="getcontestedInfo" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- select * from cm_ross_challenge_round where contestStatus=1 and authUserId=#{authUserId}
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where contestStatus = 1
|
|
|
+ and authUserId = #{authUserId}
|
|
|
</select>
|
|
|
<select id="getcontestedInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- select * from cm_ross_challenge_round where userName=#{mobile}
|
|
|
- and contestTime > #{startTime} and contestTime < #{endTime}
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where userName = #{mobile}
|
|
|
+ and contestTime > #{startTime}
|
|
|
+ and contestTime < #{endTime}
|
|
|
</select>
|
|
|
<select id="getVideoAll" resultType="com.caimei.model.vo.RossChallengeVideo">
|
|
|
select cr.*,cba.authParty from cm_ross_challenge_video cr
|
|
@@ -858,35 +936,52 @@
|
|
|
and cr.releaseTime > #{StartTime} and cr.releaseTime < #{endTime}
|
|
|
<if test="mobileOrAuthpart != null and mobileOrAuthpart != ''">
|
|
|
and (cr.userName like concat('%', #{mobileOrAuthpart})
|
|
|
- or cba.authParty like concat('%', #{mobileOrAuthpart},'%') )
|
|
|
+ or cba.authParty like concat('%', #{mobileOrAuthpart},'%') )
|
|
|
</if>
|
|
|
order by cr.diggCount desc,releaseTime
|
|
|
</select>
|
|
|
<select id="getVideoByUsername" resultType="com.caimei.model.vo.RossChallengeVideo">
|
|
|
- select * from cm_ross_challenge_video
|
|
|
- where
|
|
|
- userName = #{mobile}
|
|
|
- and releaseTime > #{StartTime} and releaseTime < #{endTime}
|
|
|
- order by diggCount desc,releaseTime
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_video
|
|
|
+ where userName = #{mobile}
|
|
|
+ and releaseTime > #{StartTime}
|
|
|
+ and releaseTime < #{endTime}
|
|
|
+ order by diggCount desc, releaseTime
|
|
|
</select>
|
|
|
<select id="checkVideoByUsername" resultType="com.caimei.model.vo.RossChallengeVideo">
|
|
|
- select * from cm_ross_challenge_video
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_video
|
|
|
where userName = #{mobile}
|
|
|
- and releaseTime > #{startTime} and releaseTime < #{endTime}
|
|
|
+ and releaseTime > #{startTime}
|
|
|
+ and releaseTime < #{endTime}
|
|
|
</select>
|
|
|
<update id="upVideoDiggCount">
|
|
|
update cm_ross_challenge_video
|
|
|
- <set>
|
|
|
- clubUserIds=#{clubUserIds}
|
|
|
+ <set>
|
|
|
+ clubUserIds=#{clubUserIds}
|
|
|
<if test="null != diggFlag and diggFlag==1">
|
|
|
,diggCount=diggCount+1
|
|
|
</if>
|
|
|
<if test="null != diggFlag and diggFlag==0">
|
|
|
,diggCount=diggCount-1
|
|
|
</if>
|
|
|
- </set>
|
|
|
+ </set>
|
|
|
where id=#{videoId}
|
|
|
</update>
|
|
|
+ <update id="updateQrCodes">
|
|
|
+ UPDATE cm_brand_auth_qrcode
|
|
|
+ SET qrCodeId = concat('HC', id)
|
|
|
+ WHERE id in
|
|
|
+ <foreach item="code" collection="qrcodePos" open="(" separator="," close=")">
|
|
|
+ #{code.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <update id="concatQrcode">
|
|
|
+ update cm_brand_auth_qrcode
|
|
|
+ set authId = #{authId},
|
|
|
+ unionStatus = 1
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
<select id="getAuthInfo" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
select cr.*,cba.authParty from cm_ross_challenge_round cr
|
|
|
left join cm_brand_auth cba on cr.authId=cba.id
|
|
@@ -895,44 +990,95 @@
|
|
|
and cr.contestTime > #{StartTime} and cr.contestTime < #{endTime}
|
|
|
</if>
|
|
|
<if test="null!=mobile and mobile !=''">
|
|
|
- and cr.userName like concat('%', #{mobile})
|
|
|
+ and cr.userName like concat('%', #{mobile})
|
|
|
</if>
|
|
|
<if test="null!=authenticationStatus">
|
|
|
- and cr.authenticationStatus=#{authenticationStatus}
|
|
|
+ and cr.authenticationStatus=#{authenticationStatus}
|
|
|
</if>
|
|
|
order by contestTime desc
|
|
|
</select>
|
|
|
<delete id="delAuthInfoById">
|
|
|
- delete from cm_ross_challenge_round where id=#{id}
|
|
|
+ delete
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
<delete id="delVideoInfoById">
|
|
|
- delete from cm_ross_challenge_video where id=#{id}
|
|
|
+ delete
|
|
|
+ from cm_ross_challenge_video
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
<delete id="delVideoInfoByUserName">
|
|
|
- delete from cm_ross_challenge_video where userName=#{mobile}
|
|
|
+ delete
|
|
|
+ from cm_ross_challenge_video
|
|
|
+ where userName = #{mobile}
|
|
|
</delete>
|
|
|
<select id="getRoundById" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- select * from cm_ross_challenge_round where id=#{id}
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
|
<select id="getRoundByAuthUserID" resultType="com.caimei.model.vo.RossChallengeRoundVo">
|
|
|
- select * from cm_ross_challenge_round where authUserId=#{authUserId} and contestStatus=1
|
|
|
+ select *
|
|
|
+ from cm_ross_challenge_round
|
|
|
+ where authUserId = #{authUserId}
|
|
|
+ and contestStatus = 1
|
|
|
</select>
|
|
|
<select id="getAuthparty" resultType="java.lang.String">
|
|
|
- select name from cm_brand_auth_user where authUserId=#{authUserId}
|
|
|
+ select name
|
|
|
+ from cm_brand_auth_user
|
|
|
+ where authUserId = #{authUserId}
|
|
|
</select>
|
|
|
<select id="getclubuserInfo" resultType="com.caimei.model.vo.ClubUserVo">
|
|
|
select cu.name,cu.mobile,cu.addTime,
|
|
|
- (case
|
|
|
- when cu.name is null then '未认证'
|
|
|
- when cu.name is not null then '已认证' end
|
|
|
- ) as authenticationStatus,
|
|
|
- cu.status
|
|
|
+ (case
|
|
|
+ when cu.name is null then '未认证'
|
|
|
+ when cu.name is not null then '已认证' end
|
|
|
+ ) as authenticationStatus,
|
|
|
+ cu.status
|
|
|
from cm_brand_club_user cu
|
|
|
LEFT JOIN cm_brand_auth a ON cu.authId = a.id
|
|
|
where a.authUserId=#{authUserId}
|
|
|
<if test="clubUserIds != null and clubUserIds!=''">
|
|
|
- and find_in_set(cu.id,#{clubUserIds})
|
|
|
+ and find_in_set(cu.id,#{clubUserIds})
|
|
|
</if>
|
|
|
order by cu.addTime desc
|
|
|
</select>
|
|
|
+ <select id="findQrCodes" resultType="com.caimei.model.po.AuthQrcodePo">
|
|
|
+ select cba.id,cba.authId,cba.authUserId,cba.qrCodeId,cba.addtime,cba.unionStatus,cbp.name as productName,cbu.authParty
|
|
|
+ from cm_brand_auth_qrcode cba
|
|
|
+ left join cm_brand_product_type cbp on cba.productTypeId = cbp.id
|
|
|
+ left join cm_brand_auth cbu on cbu.id = cba.authId
|
|
|
+ where cba.authUserId = #{authUserId} and cba.delFlag = 0
|
|
|
+ <if test="unionStatus != null and unionStatus!=''">
|
|
|
+ and cba.unionStatus = #{unionStatus}
|
|
|
+ </if>
|
|
|
+ <if test="productTypeId != null and productTypeId!=''">
|
|
|
+ and cba.productTypeId = #{productTypeId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="getConcatList" resultType="com.caimei.model.vo.AuthVo">
|
|
|
+ select a.id as authId,
|
|
|
+ a.authUserId,
|
|
|
+ a.authParty,
|
|
|
+ a.status,
|
|
|
+ a.auditStatus,
|
|
|
+ a.shopAuditStatus,
|
|
|
+ a.createTime,
|
|
|
+ a.authCode
|
|
|
+ from cm_brand_auth a
|
|
|
+ LEFT JOIN cm_brand_auth_qrcode cbq ON a.id = cbq.authId
|
|
|
+ where a.authUserId = #{authUserId}
|
|
|
+ and a.delFlag = 0
|
|
|
+ and a.shopAuditStatus = 1
|
|
|
+ AND cbq.authId IS NULL
|
|
|
+ and exists(select 1
|
|
|
+ from cm_brand_auth_product cp
|
|
|
+ left join cm_brand_product_relation cbr on cp.id = cbr.productId
|
|
|
+ where cp.productTypeId = #{productTypeId}
|
|
|
+ and cbr.authId = a.id)
|
|
|
+ <if test="authParty != null and authParty != ''">
|
|
|
+ and a.authParty like concat('%', #{authParty},'%')
|
|
|
+ </if>
|
|
|
+ order by a.createTime desc, a.id desc
|
|
|
+ </select>
|
|
|
</mapper>
|