Commit 6e45121b authored by liwei's avatar liwei

修改了活动查询接口

parent cdb54dbd
......@@ -84,7 +84,8 @@
</select>
<select id="queryCmsActivityPaged" resultMap="BaseResultMap">
SELECT ca.business_id,
SELECT
ca.business_id,
ca.publish_date,
ca.create_by,
ca.create_date,
......@@ -106,47 +107,45 @@
ca.end_time,
ca.summary,
ca.max_application_count,
su.nick_name as nickName,
su.nick_name AS nickName,
oi.url
FROM cms_activity ca
LEFT JOIN
(SELECT
activity_id,
COUNT(*) AS application_count
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
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 ca.del_flag='0'
<if test="entity.flag!=null and entity.flag != '' ">
and ca.flag = #{entity.flag}
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
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>
ca.del_flag = '0'
AND ca.publish_status = '1'
<if test="entity.flag!=null and entity.flag != '' ">
and ca.flag = #{entity.flag}
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
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 != '' ">
and summary like concat('%',#{entity.summary},'%')
</if>
<if test="entity.title !=null and entity.title != '' ">
and ca.title like concat('%',#{entity.title},'%')
</if>
<if test="entity.title !=null and entity.title != '' ">
and ca.title like concat('%',#{entity.title},'%')
</if>
<if test="entity.applicationFee !=null and entity.applicationFee != '' ">
and ca.application_fee = #{entity.applicationFee}
</if>
<if test="entity.maxApplicationCount !=null and entity.maxApplicationCount != '' ">
and ca.max_application_count = #{entity.maxApplicationCount}
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and ca.picture_id = #{entity.pictureId}
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and ca.picture_id = #{entity.pictureId}
</if>
<if test="entity.isApplication !=null and entity.isApplication != '' ">
and ca.is_application = #{entity.isApplication}
</if>
......@@ -180,7 +179,8 @@
<if test="entity.publishStatus !=null ">
and ca.publish_status = #{entity.publishStatus}
</if>
ORDER BY ca.publish_date DESC
ORDER BY
ca.publish_date DESC
</select>
<update id="deleteCmsActivity" parameterType="java.lang.Integer">
update cms_activity
......
......@@ -184,6 +184,7 @@
left join oss_info oi on oi.business_id = m.avatar
where 1=1
and m.del_flag = '0'
and m.user_id != 1
<if test="entity.flag !=null and entity.flag != '' ">
and m.flag = #{entity.flag}
</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