| | |
| | | |
| | | |
| | | <select id="selectUserTopicsPage" resultMap="userTopicsResultMap"> |
| | | SELECT distinct |
| | | SELECT |
| | | jut.article_id, |
| | | jut.delete_flag, |
| | | jut.signature_path, |
| | | jut.create_time, |
| | | jut.household_id, |
| | | bu.avatar, |
| | | bu.`name`, |
| | | bu.phone, |
| | | jh.name, |
| | | jh.phone_number phone, |
| | | jda.address_name, |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | jda.aoi_name |
| | | <if test="userTopics.articleId != null ">, |
| | | group_concat(jt.option_content) optionContent </if> |
| | | FROM |
| | | jczz_user_topics as jut |
| | | LEFT JOIN blade_user bu ON jut.user_id = bu.id AND bu.is_deleted = 0 |
| | | LEFT JOIN jczz_household jh ON jh.house_code = jut.house_code |
| | | AND jh.is_deleted = 0 and jut.user_id =jh.associated_user_id |
| | | LEFT JOIN jczz_household jh ON jh.id = jut.household_id and jh.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_topics jt on jt.id = jut.topics_id |
| | | LEFT JOIN blade_user bu ON jh.associated_user_id = bu.id AND bu.is_deleted = 0 |
| | | <where> |
| | | <if test="userTopics.id != null ">and jut.id = #{userTopics.id}</if> |
| | | <if test="userTopics.name != null and userTopics.name != ''"> |
| | |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="userTopics.userId != null ">and jut.user_id = #{userTopics.userId}</if> |
| | | <if test="userTopics.householdId != null ">and jut.household_id = #{userTopics.householdId}</if> |
| | | <if test="userTopics.topicsId != null ">and jut.topics_id = #{userTopics.topicsId}</if> |
| | | <if test="userTopics.createTime != null ">and jut.create_time = #{userTopics.createTime}</if> |
| | | <if test="userTopics.updateTime != null ">and jut.update_time = #{userTopics.updateTime}</if> |
| | | <if test="userTopics.deleteFlag != null ">and jut.delete_flag = #{userTopics.deleteFlag}</if> |
| | | <if test="userTopics.articleId != null ">and jut.article_id = #{userTopics.articleId} |
| | | <if test="userTopics.articleId != null "> |
| | | and jut.article_id = #{userTopics.articleId} |
| | | and jut.delete_flag = 0 |
| | | GROUP BY jut.article_id, jut.signature_path,jut.create_time,jut.delete_flag, |
| | | GROUP BY jut.article_id, jut.signature_path,jut.create_time,jut.household_id,jut.delete_flag, |
| | | bu.avatar, |
| | | bu.`name`, |
| | | bu.phone, |
| | | jh.name, |
| | | jh.phone_number, |
| | | jda.address_name, |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | jda.aoi_name |
| | | </if> |
| | | </where> |
| | | </select> |