| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="platform.modules.sys.dao.ActivityFeedbackDao">
- <select id="findPage" parameterType="java.lang.Integer" resultType="platform.modules.sys.entity.ActivityFeedback">
- SELECT
- feedback.content content,
- zuser.nick_name name,
- feedback.feedback_time feedback_time
- FROM
- ac_activity_feedback feedback
- LEFT JOIN z_user zuser ON feedback.user_id = zuser.id
- WHERE
- feedback.activity_id = #{activityId}
- ORDER BY
- feedback.create_time DESC
- </select>
- <select id="findFeedbackList" resultType="platform.modules.sys.entity.ActivityFeedback">
- select
- af.id,
- af.user_id,
- af.user_type,
- af.content,
- af.feedback_time,
- af.feedback_type,
- ad.activity_title,
- af.create_name,
- af.create_time,
- af.is_view,
- af.approval_status
- from ac_activity_feedback af
- left join ac_activity_detail ad on ad .id = af.activity_id
- where
- af.del_flag = 0 <!-- AND af.feedback_type != 0 -->
- <if test="query.is_front!= null and query.is_front != ''">
- and af.approval_status = 1
- </if>
- <if test="query.activity_id!= null and query.activity_id != ''">
- and af.activity_id = #{query.activity_id}
- </if>
- <if test="query.feedback_type != null and query.feedback_type != ''">
- and af.feedback_type = #{query.feedback_type}
- </if>
- <if test="query.approval_status != null and query.approval_status != ''">
- and af.approval_status = #{query.approval_status}
- </if>
- <if test="query.activity_title != null and query.activity_title != ''">
- and ad.activity_title LIKE CONCAT('%',#{query.activity_title},'%')
- </if>
- ORDER BY af.create_time DESC
- </select>
- <select id="findFeedbackTypelist" resultType="platform.modules.sys.entity.ActivityFeedback">
- select COUNT( af.id ) as feedback_count, feedback_type from ac_activity_feedback WHERE del_flag = 0
- <if test="query.feedback_type != null and query.feedback_type != ''">
- and feedback_type = #{query.feedback_type}
- </if>
- group by feedback_type
- </select>
- <select id="findCountByFeedbackType" resultType="platform.modules.sys.entity.ActivityFeedback">
- select COUNT( id ) AS feedback_count from ac_activity_feedback WHERE del_flag = 0
- <if test="query.feedback_type != null and query.feedback_type != ''">
- and feedback_type = #{query.feedback_type}
- </if>
- <if test="query.approval_status != null and query.approval_status != ''">
- and approval_status = #{query.approval_status}
- </if>
- <if test="query.is_view != null and query.is_view != ''">
- and is_view = #{query.is_view}
- </if>
- </select>
- <select id="findAvgStar" resultType="java.lang.Double">
- SELECT
- IFNULL(AVG( feedback_type ), 0)
- FROM
- ac_activity_feedback
- WHERE
- del_flag = 0
- AND activity_id = #{activity_id}
- </select>
- <select id="findUserFeedback" resultType="platform.modules.sys.entity.ActivityFeedback">
- select * from ac_activity_feedback where activity_id = #{id} AND user_id = #{userId} AND feedback_type != 0
- </select>
- <select id="feedbackList" resultType="platform.modules.sys.entity.ActivityFeedback">
- SELECT
- *
- FROM
- ac_activity_feedback
- WHERE
- del_flag = 0
- AND activity_id = #{activity_id}
- <if test="is_public != null and is_public != ''">
- AND is_public = #{is_public}
- </if>
- <if test="is_view != null and is_view != ''">
- AND is_view = #{is_view}
- </if>
- <if test="minScore != null and minScore != ''">
- AND score <![CDATA[>]]> #{minScore}
- </if>
- <if test="maxScore != null and maxScore != ''">
- AND score <![CDATA[<=]]> #{maxScore}
- </if>
- ORDER BY is_top DESC
- </select>
- <select id="feedbackPage" resultType="platform.modules.sys.entity.ActivityFeedback">
- SELECT
- *
- FROM
- ac_activity_feedback
- WHERE
- del_flag = 0
- AND
- activity_id = #{activity_id}
- <if test="minScore != null and minScore != ''">
- AND score <![CDATA[>]]> #{minScore}
- </if>
- <if test="maxScore != null and maxScore != ''">
- AND score <![CDATA[<=]]> #{maxScore}
- </if>
- ORDER BY
- feedback_time DESC
- </select>
- </mapper>
|