调整界面
This commit is contained in:
		| @@ -85,6 +85,11 @@ public class SysServicesTopic { | ||||
|     String toName; | ||||
|     String name; | ||||
|  | ||||
|     String avatar; | ||||
|     String fromAvatar; | ||||
|     String toAvatar; | ||||
|  | ||||
|  | ||||
|     List<SysServicesTopic> comments; | ||||
|  | ||||
|     List<SysServicesTopic> replys; | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
|         SELECT * FROM ( | ||||
|         SELECT topic_id, id, `read`, create_time, update_time, 'customer' AS role FROM sys_services_topic_status WHERE role = #{role} AND uid = #{uid} | ||||
|         ) AS status | ||||
|         LEFT JOIN sys_services_topic USING(topic_id) | ||||
|         LEFT JOIN sys_services_topic USING(topic_id) WHERE del_flag = 0 | ||||
|         ORDER BY `read` ASC, update_time DESC | ||||
|     </select> | ||||
|  | ||||
| @@ -39,6 +39,7 @@ | ||||
|         <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/> | ||||
|         <result column="create_time" property="createTime"/> | ||||
|         <association property="name" column="{uid=uid,role=role}" select="selectUserInfo"/> | ||||
|         <association property="avatar" column="{uid=uid,role=role}" select="selectUserAvatar"/> | ||||
|         <association property="comments" column="topic_id" select="selectServicesTopicCommentByTopicId"/> | ||||
|     </resultMap> | ||||
|  | ||||
| @@ -53,7 +54,9 @@ | ||||
|         <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/> | ||||
|         <result column="create_time" property="createTime"/> | ||||
|         <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/> | ||||
|         <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/> | ||||
|         <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/> | ||||
| <!--        <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>--> | ||||
|         <association property="replys" column="id" | ||||
|                      select="selectServicesTopicCommentReplyByCommentId"/> | ||||
|     </resultMap> | ||||
| @@ -71,7 +74,9 @@ | ||||
|         <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/> | ||||
|         <result column="create_time" property="createTime"/> | ||||
|         <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/> | ||||
|         <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/> | ||||
|         <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/> | ||||
| <!--        <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>--> | ||||
|     </resultMap> | ||||
|  | ||||
|  | ||||
| @@ -103,6 +108,18 @@ | ||||
|         </choose> | ||||
|     </select> | ||||
|  | ||||
|     <!--    查询头像--> | ||||
|     <select id="selectUserAvatar" parameterType="java.util.Map" resultType="String"> | ||||
|         <choose> | ||||
|             <when test="_parameter.get('role') == 'customer'"> | ||||
|                 select avatar_url from sys_wx_user_info where cus_id = #{uid} | ||||
|             </when> | ||||
|             <otherwise> | ||||
|                 select IF(avatar != '', CONCAT("https://api.stdiet.top/prod-api", avatar), '') as avatar from sys_user where user_id = #{uid} | ||||
|             </otherwise> | ||||
|         </choose> | ||||
|     </select> | ||||
|  | ||||
|     <!--    插入问题--> | ||||
|     <insert id="insertSysServicesTopic" parameterType="SysServicesTopic" useGeneratedKeys="true" | ||||
|             keyProperty="id" keyColumn="id"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user