|
@@ -129,7 +129,7 @@
|
|
|
<sql id="queryDetailPageSql">
|
|
|
<where>
|
|
|
<if test="search != null and search != ''">
|
|
|
- qu.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ qu.user_id_ = #{search} OR ria.username_ LIKE CONCAT('%',#{search},'%') OR ria.mobile_no_ LIKE CONCAT('%',#{search},'%')
|
|
|
</if>
|
|
|
<if test="activeId != null">
|
|
|
AND qu.active_id_ = #{activeId}
|
|
@@ -158,12 +158,11 @@
|
|
|
</sql>
|
|
|
<select id="queryDetailPage" resultMap="QuestionnaireUserResultDto">
|
|
|
SELECT qu1.*,qur.username_,qur.phone_,qq.content_,GROUP_CONCAT(qqi.answer_value_ ORDER BY qqi.sort_) answer_value_
|
|
|
- FROM (SELECT su.id_,CASE WHEN su.username_ IS NULL THEN ria.user_name_ ELSE su.username_ END username_,su.phone_ FROM questionnaire_user_result qu
|
|
|
- LEFT JOIN sys_user su ON su.id_ = qu.user_id_
|
|
|
- LEFT JOIN replacement_instrument_activity ria ON ria.replacement_instrument_cooperation_id_ = qu.active_id_
|
|
|
+ FROM (SELECT ria.user_id_ id_,ria.user_name_,ria.mobile_no_ phone_ FROM questionnaire_user_result qu
|
|
|
+ LEFT JOIN replacement_instrument_activity ria ON ria.replacement_instrument_cooperation_id_ = qu.active_id_ AND ria.user_id_ = qu.user_id_
|
|
|
AND ria.user_id_ = qu.user_id_
|
|
|
<include refid="queryDetailPageSql"/>
|
|
|
- GROUP BY su.id_
|
|
|
+ GROUP BY ria.user_id_
|
|
|
<include refid="global.limit"/>) qur
|
|
|
LEFT JOIN questionnaire_user_result qu1 ON qur.id_ = qu1.user_id_
|
|
|
LEFT JOIN questionnaire_question qq ON qq.id_ = qu1.questionnaire_question_id_
|