Commit 6e45121b authored by liwei's avatar liwei

修改了活动查询接口

parent cdb54dbd
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
</select> </select>
<select id="queryCmsActivityPaged" resultMap="BaseResultMap"> <select id="queryCmsActivityPaged" resultMap="BaseResultMap">
SELECT ca.business_id, SELECT
ca.business_id,
ca.publish_date, ca.publish_date,
ca.create_by, ca.create_by,
ca.create_date, ca.create_date,
...@@ -106,47 +107,45 @@ ...@@ -106,47 +107,45 @@
ca.end_time, ca.end_time,
ca.summary, ca.summary,
ca.max_application_count, ca.max_application_count,
su.nick_name as nickName, su.nick_name AS nickName,
oi.url oi.url
FROM cms_activity ca
LEFT JOIN
(SELECT
activity_id,
COUNT(*) AS application_count
FROM FROM
cms_application cms_activity ca
LEFT JOIN (
SELECT activity_id, COUNT(*) AS application_count
FROM cms_application
WHERE status = '1'
GROUP BY activity_id
) AS applicationList ON ca.business_id = applicationList.activity_id
LEFT JOIN oss_info oi ON ca.picture_id = oi.business_id
LEFT JOIN sys_user su ON su.business_id = ca.create_by
WHERE WHERE
status = '1' ca.del_flag = '0'
GROUP BY AND ca.publish_status = '1'
activity_id) AS applicationList <if test="entity.flag!=null and entity.flag != '' ">
ON ca.business_id = applicationList.activity_id and ca.flag = #{entity.flag}
LEFT JOIN oss_info oi on ca.picture_id = oi.business_id </if>
LEFT JOIN sys_user su on su.business_id = ca.create_by <if test="entity.createBy !=null and entity.createBy != '' ">
where ca.del_flag='0' and ca.create_by like concat('%',#{entity.createBy},'%')
<if test="entity.flag!=null and entity.flag != '' "> </if>
and ca.flag = #{entity.flag} <if test="entity.updateBy !=null and entity.updateBy != '' ">
</if> and ca.update_by like concat('%',#{entity.updateBy},'%')
<if test="entity.createBy !=null and entity.createBy != '' "> </if>
and ca.create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and ca.update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.summary !=null and entity.summary != '' "> <if test="entity.summary !=null and entity.summary != '' ">
and summary like concat('%',#{entity.summary},'%') and summary like concat('%',#{entity.summary},'%')
</if> </if>
<if test="entity.title !=null and entity.title != '' "> <if test="entity.title !=null and entity.title != '' ">
and ca.title like concat('%',#{entity.title},'%') and ca.title like concat('%',#{entity.title},'%')
</if> </if>
<if test="entity.applicationFee !=null and entity.applicationFee != '' "> <if test="entity.applicationFee !=null and entity.applicationFee != '' ">
and ca.application_fee = #{entity.applicationFee} and ca.application_fee = #{entity.applicationFee}
</if> </if>
<if test="entity.maxApplicationCount !=null and entity.maxApplicationCount != '' "> <if test="entity.maxApplicationCount !=null and entity.maxApplicationCount != '' ">
and ca.max_application_count = #{entity.maxApplicationCount} and ca.max_application_count = #{entity.maxApplicationCount}
</if> </if>
<if test="entity.pictureId !=null and entity.pictureId != '' "> <if test="entity.pictureId !=null and entity.pictureId != '' ">
and ca.picture_id = #{entity.pictureId} and ca.picture_id = #{entity.pictureId}
</if> </if>
<if test="entity.isApplication !=null and entity.isApplication != '' "> <if test="entity.isApplication !=null and entity.isApplication != '' ">
and ca.is_application = #{entity.isApplication} and ca.is_application = #{entity.isApplication}
</if> </if>
...@@ -180,7 +179,8 @@ ...@@ -180,7 +179,8 @@
<if test="entity.publishStatus !=null "> <if test="entity.publishStatus !=null ">
and ca.publish_status = #{entity.publishStatus} and ca.publish_status = #{entity.publishStatus}
</if> </if>
ORDER BY ca.publish_date DESC ORDER BY
ca.publish_date DESC
</select> </select>
<update id="deleteCmsActivity" parameterType="java.lang.Integer"> <update id="deleteCmsActivity" parameterType="java.lang.Integer">
update cms_activity update cms_activity
......
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
left join oss_info oi on oi.business_id = m.avatar left join oss_info oi on oi.business_id = m.avatar
where 1=1 where 1=1
and m.del_flag = '0' and m.del_flag = '0'
and m.user_id != 1
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.flag !=null and entity.flag != '' ">
and m.flag = #{entity.flag} and m.flag = #{entity.flag}
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment