调整界面

This commit is contained in:
huangdeliang
2021-06-05 15:05:32 +08:00
parent 422431c77d
commit ea422f63f9
6 changed files with 173 additions and 111 deletions

View File

@ -85,6 +85,11 @@ public class SysServicesTopic {
String toName;
String name;
String avatar;
String fromAvatar;
String toAvatar;
List<SysServicesTopic> comments;
List<SysServicesTopic> replys;

View File

@ -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">