| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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.yonge.cooleshow.biz.dal.mapper.SysSuggestionMapper">
- <!-- 表字段 -->
- <sql id="baseColumns">
- t.id_ AS id
- , t.mobile_no_ AS mobileNo
- , t.title_ AS title
- , t.content_ AS content
- , t.url_ AS url
- , t.user_id_ AS userId
- , t.create_time_ AS createTime
- , t.client_id_ AS clientId
- , t.type_ AS type
- , t.client_type_ AS clientType
- , t.suggestion_type_id_ AS suggestionTypeId
- , t.user_agent_ AS userAgent
- , t.handle_status_ AS handleStatus
- , t.handle_time_ AS handleTime
- , t.handle_by_ AS handleBy
- , t.feedback_ AS feedback
- , t.feedback_content_ AS feedbackContent
- </sql>
- <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper$SysSuggestion">
- SELECT
- <include refid="baseColumns" />
- ,CASE WHEN (t.client_type_='STUDENT' or t.client_type_ = 'TENANT_STUDENT') THEN su.username_ ELSE su.real_name_ END nickname
- ,sst.name_ as suggestionTypeName
- FROM sys_suggestion t
- LEFT JOIN sys_user su ON su.id_ = t.user_id_
- LEFT JOIN sys_suggestion_type sst on t.suggestion_type_id_ = sst.id_
- <where>
- su.del_flag_ = 0
- <if test="param.keyword!=null and param.keyword.trim()!=''">
- AND (
- su.real_name_ LIKE CONCAT('%', #{param.keyword}, '%')
- OR su.username_ LIKE CONCAT('%', #{search}, '%')
- <!-- OR t.user_id_=#{search} OR su.phone_=#{search}-->
- )
- </if>
- <if test="param.type != null">
- AND t.type_ = #{param.type}
- </if>
- <if test="param.clientType != null">
- AND t.client_type_ = #{param.clientType}
- </if>
- <if test="param.startTime!=null">
- AND t.create_time_ >= #{param.startTime}
- </if>
- <if test="param.endTime!=null">
- AND #{param.endTime} >= t.create_time_
- </if>
- <if test="param.suggestionTypeId != null">
- AND t.suggestion_type_id_ = #{param.suggestionTypeId}
- </if>
- <if test="param.suggestionTypeName != null and param.suggestionTypeName.trim() != ''">
- AND sst.name_ = #{param.suggestionTypeName}
- </if>
- <if test="param.handleStatus != null">
- AND t.handle_status_ = #{param.handleStatus}
- </if>
- <if test="param.handleBy != null">
- AND t.handle_by_ = #{param.handleBy}
- </if>
- <if test="param.handStartTime != null">
- AND t.handle_time_ >= #{param.handStartTime}
- </if>
- <if test="param.handEndTime != null">
- AND #{param.handEndTime} >= t.handle_time_
- </if>
- <if test="param.feedback != null">
- AND t.feedback_ = #{param.feedback}
- </if>
- </where>
- ORDER BY t.id_ DESC
- </select>
- </mapper>
|