SysSuggestionMapper.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.yonge.cooleshow.biz.dal.mapper.SysSuggestionMapper">
  4. <!-- 表字段 -->
  5. <sql id="baseColumns">
  6. t.id_ AS id
  7. , t.mobile_no_ AS mobileNo
  8. , t.title_ AS title
  9. , t.content_ AS content
  10. , t.url_ AS url
  11. , t.user_id_ AS userId
  12. , t.create_time_ AS createTime
  13. , t.client_id_ AS clientId
  14. , t.type_ AS type
  15. , t.client_type_ AS clientType
  16. , t.suggestion_type_id_ AS suggestionTypeId
  17. , t.user_agent_ AS userAgent
  18. , t.handle_status_ AS handleStatus
  19. , t.handle_time_ AS handleTime
  20. , t.handle_by_ AS handleBy
  21. , t.feedback_ AS feedback
  22. , t.feedback_content_ AS feedbackContent
  23. </sql>
  24. <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper$SysSuggestion">
  25. SELECT
  26. <include refid="baseColumns" />
  27. ,CASE WHEN (t.client_type_='STUDENT' or t.client_type_ = 'TENANT_STUDENT') THEN su.username_ ELSE su.real_name_ END nickname
  28. ,sst.name_ as suggestionTypeName
  29. FROM sys_suggestion t
  30. LEFT JOIN sys_user su ON su.id_ = t.user_id_
  31. LEFT JOIN sys_suggestion_type sst on t.suggestion_type_id_ = sst.id_
  32. <where>
  33. su.del_flag_ = 0
  34. <if test="param.keyword!=null and param.keyword.trim()!=''">
  35. AND (
  36. su.real_name_ LIKE CONCAT('%', #{param.keyword}, '%')
  37. OR su.username_ LIKE CONCAT('%', #{search}, '%')
  38. <!-- OR t.user_id_=#{search} OR su.phone_=#{search}-->
  39. )
  40. </if>
  41. <if test="param.type != null">
  42. AND t.type_ = #{param.type}
  43. </if>
  44. <if test="param.clientType != null">
  45. AND t.client_type_ = #{param.clientType}
  46. </if>
  47. <if test="param.startTime!=null">
  48. AND t.create_time_ >= #{param.startTime}
  49. </if>
  50. <if test="param.endTime!=null">
  51. AND #{param.endTime} >= t.create_time_
  52. </if>
  53. <if test="param.suggestionTypeId != null">
  54. AND t.suggestion_type_id_ = #{param.suggestionTypeId}
  55. </if>
  56. <if test="param.suggestionTypeName != null and param.suggestionTypeName.trim() != ''">
  57. AND sst.name_ = #{param.suggestionTypeName}
  58. </if>
  59. <if test="param.handleStatus != null">
  60. AND t.handle_status_ = #{param.handleStatus}
  61. </if>
  62. <if test="param.handleBy != null">
  63. AND t.handle_by_ = #{param.handleBy}
  64. </if>
  65. <if test="param.handStartTime != null">
  66. AND t.handle_time_ >= #{param.handStartTime}
  67. </if>
  68. <if test="param.handEndTime != null">
  69. AND #{param.handEndTime} >= t.handle_time_
  70. </if>
  71. <if test="param.feedback != null">
  72. AND t.feedback_ = #{param.feedback}
  73. </if>
  74. </where>
  75. ORDER BY t.id_ DESC
  76. </select>
  77. </mapper>