|
@@ -411,8 +411,8 @@
|
|
|
</insert>
|
|
|
|
|
|
<insert id="addTask">
|
|
|
- insert into cm_provider_task(archiveId, shopId, title, topPic, addTime, startTime, endTime)
|
|
|
- values (#{archiveId}, #{shopId}, #{title}, #{topPic}, now(), #{startTime}, #{endTime});
|
|
|
+ insert into cm_provider_task(shopId,productId, title, topPic, reward, content, addTime, startTime, endTime)
|
|
|
+ values (#{shopId}, #{productId},#{title}, #{topPic}, #{reward}, #{content}, now(), #{startTime}, #{endTime});
|
|
|
</insert>
|
|
|
|
|
|
<insert id="assignTask">
|
|
@@ -438,16 +438,20 @@
|
|
|
|
|
|
<select id="taskList" resultType="com.caimei365.manager.entity.caimei.providers.ProviderTask">
|
|
|
select spt.id,
|
|
|
- spt.archiveId,
|
|
|
spt.shopId,
|
|
|
+ spt.productId,
|
|
|
spt.title,
|
|
|
spt.addTime,
|
|
|
spt.startTime,
|
|
|
spt.endTime,
|
|
|
- s.name as shopName,
|
|
|
- (CASE WHEN startTime > NOW() THEN '1'
|
|
|
- WHEN NOW() BETWEEN startTime AND endTime THEN '2'
|
|
|
- WHEN NOW() > endTime THEN '3' END )AS status
|
|
|
+ spt.reward,
|
|
|
+ spt.content,
|
|
|
+ s.name as shopName,
|
|
|
+ spt.topPic,
|
|
|
+ (CASE
|
|
|
+ WHEN startTime > NOW() THEN '1'
|
|
|
+ WHEN NOW() BETWEEN startTime AND endTime THEN '2'
|
|
|
+ WHEN NOW() > endTime THEN '3' END) AS status
|
|
|
from cm_provider_task spt
|
|
|
left join shop s on spt.shopId = s.shopId
|
|
|
order by addTime desc
|
|
@@ -473,6 +477,45 @@
|
|
|
<if test="name != null and name != ''">and sp.name like concat('%', #{name}, '%')</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getTaskDetail" resultType="com.caimei365.manager.entity.caimei.providers.ProviderTask">
|
|
|
+ select id,
|
|
|
+ shopId,
|
|
|
+ productId,
|
|
|
+ title,
|
|
|
+ topPic,
|
|
|
+ content,
|
|
|
+ reward,
|
|
|
+ addTime,
|
|
|
+ startTime,
|
|
|
+ endTime
|
|
|
+ from cm_provider_task
|
|
|
+ where id = #{taskId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTaskProducts" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
|
+ SELECT
|
|
|
+ p.productId,
|
|
|
+ p.name as productName,
|
|
|
+ p.mainImage,
|
|
|
+ s.shopId,
|
|
|
+ s.name AS shopName
|
|
|
+ FROM product p
|
|
|
+ LEFT JOIN cm_organize_product_info copi ON copi.productId = p.productId
|
|
|
+ LEFT JOIN shop s ON s.shopId = p.shopId
|
|
|
+ <where>
|
|
|
+ copi.organizeId = 0 AND copi.validFlag = 2
|
|
|
+ <if test="productId != null">
|
|
|
+ and p.productId = #{productId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and p.name like concat('%', #{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
+ and s.name like concat('%', #{shopName},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<update id="updateCmProviders" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
update serviceprovider
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
@@ -520,10 +563,12 @@
|
|
|
<update id="updateTask">
|
|
|
update cm_provider_task
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="archiveId != null and archiveId != ''">archiveId = #{archiveId},</if>
|
|
|
<if test="shopId != null and shopId != ''">shopId = #{shopId},</if>
|
|
|
+ <if test="productId != null and productId != ''">productId = #{productId},</if>
|
|
|
<if test="title != null and title != ''">title = #{title},</if>
|
|
|
<if test="topPic != null and topPic != ''">topPic = #{topPic},</if>
|
|
|
+ <if test="reward != null and reward != ''">reward = #{reward},</if>
|
|
|
+ <if test="content != null and content != ''">content = #{content},</if>
|
|
|
<if test="startTime != null">startTime = STR_TO_DATE(#{startTime}, '%Y-%m-%d%H:%i:%s'),</if>
|
|
|
<if test="endTime != null">endTime = STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s'),</if>
|
|
|
</trim>
|