<?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="com.ruoyi.system.mapper.TConsultationMessageMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TConsultationMessage">
|
<id column="id" property="id" />
|
<result column="consultation_id" property="consultationId" />
|
<result column="consultation_content" property="consultationContent" />
|
<result column="user_id" property="userId" />
|
<result column="create_by" property="createBy" />
|
<result column="create_time" property="createTime" />
|
<result column="is_delete" property="isDelete" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, consultation_id, consultation_content, user_id, create_by, create_time, is_delete
|
</sql>
|
<select id="pageQuery" resultType="com.ruoyi.system.domain.TConsultationMessage">
|
select tcm.*,tu.avatar from t_consultation_message tcm
|
left join t_app_user tu on tcm.user_id = tu.id
|
left join t_consultation tc on tcm.consultation_id = tc.id
|
where tcm.is_delete = 0
|
<if test="messageQuery.name != null and messageQuery.name != ''">
|
and tc.classification_name like concat('%',#{messageQuery.name},'%')
|
</if>
|
<if test="messageQuery.userName != null and messageQuery.userName != ''">
|
and tu.name like concat('%',#{messageQuery.userName},'%')
|
</if>
|
order by tcm.create_time desc
|
|
</select>
|
|
</mapper>
|