SysSuggestionV2Mapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.SysSuggestionV2Mapper">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.SysSuggestionV2">
  5. <result column="id_" property="id" />
  6. <result column="suggestion_type_id_" property="suggestionTypeId" />
  7. <result column="mobile_no_" property="mobileNo" />
  8. <result column="type_" property="type" />
  9. <result column="title_" property="title" />
  10. <result column="content_" property="content" />
  11. <result column="attachment_urls_" property="attachmentUrls" />
  12. <result column="user_id_" property="userId" />
  13. <result column="client_type_" property="clientType" />
  14. <result column="user_agent_" property="userAgent" />
  15. <result column="create_time_" property="createTime" />
  16. <result column="handle_status_" property="handleStatus" />
  17. <result column="handle_time_" property="handleTime" />
  18. <result column="handle_by_" property="handleBy" />
  19. <result column="handle_attitude_" property="handleAttitude" />
  20. <result column="feedback_" property="feedback" />
  21. <result column="feedback_content_" property="feedbackContent" />
  22. </resultMap>
  23. <!-- 表字段 -->
  24. <sql id="baseColumns">
  25. t.id_ as id
  26. ,t.suggestion_type_id_ as suggestionTypeId
  27. , t.mobile_no_ as mobileNo
  28. , t.type_ as type
  29. , t.title_ as title
  30. , t.content_ as content
  31. , t.attachment_urls_ as attachmentUrls
  32. , t.user_id_ as userId
  33. , t.client_type_ as clientType
  34. , t.user_agent_ as userAgent
  35. , t.create_time_ as createTime
  36. , t.handle_status_ as handleStatus
  37. , t.handle_time_ as handleTime
  38. , t.handle_by_ as handleBy
  39. , t.handle_attitude_ as handleAttitude
  40. , t.feedback_ as feedback
  41. , t.feedback_content_ as feedbackContent
  42. </sql>
  43. <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper$SysSuggestion">
  44. SELECT
  45. <include refid="baseColumns" />,
  46. sst.name_ as suggestionTypeName
  47. FROM sys_suggestion t
  48. LEFT JOIN sys_suggestion_type sst on t.suggestion_type_id_ = sst.id_
  49. <if test="param.keyword!=null and param.keyword.trim()!=''">
  50. LEFT JOIN sys_user su2 ON su2.id_ = t.user_id_
  51. </if>
  52. <if test="param.handleName != null and param.handleName.trim() != ''">
  53. LEFT JOIN sys_user su ON su.id_ = t.handle_by_
  54. </if>
  55. <where>
  56. <if test="param.keyword!=null and param.keyword.trim()!=''">
  57. AND (
  58. su2.username_ LIKE CONCAT('%', #{param.keyword}, '%')
  59. or
  60. su2.phone_ LIKE CONCAT('%', #{param.keyword}, '%')
  61. )
  62. </if>
  63. <if test="param.type != null">
  64. AND t.type_ = #{param.type}
  65. </if>
  66. <if test="param.clientType != null">
  67. AND t.client_type_ = #{param.clientType}
  68. </if>
  69. <if test="param.startTime!=null">
  70. AND t.create_time_ >= #{param.startTime}
  71. </if>
  72. <if test="param.endTime!=null">
  73. AND #{param.endTime} >= t.create_time_
  74. </if>
  75. <if test="param.suggestionTypeId != null">
  76. AND t.suggestion_type_id_ = #{param.suggestionTypeId}
  77. </if>
  78. <if test="param.suggestionTypeName != null and param.suggestionTypeName.trim() != ''">
  79. AND sst.name_ = #{param.suggestionTypeName}
  80. </if>
  81. <if test="param.handleStatus != null">
  82. AND t.handle_status_ = #{param.handleStatus}
  83. </if>
  84. <if test="param.handleBy != null">
  85. AND t.handle_by_ = #{param.handleBy}
  86. </if>
  87. <if test="param.handleName != null and param.handleName.trim() != ''">
  88. AND su.username_ LIKE CONCAT('%', #{param.handleName}, '%')
  89. </if>
  90. <if test="param.handStartTime != null">
  91. AND t.handle_time_ >= #{param.handStartTime}
  92. </if>
  93. <if test="param.handEndTime != null">
  94. AND #{param.handEndTime} >= t.handle_time_
  95. </if>
  96. <if test="param.handleAttitude != null">
  97. AND t.handle_attitude_ = #{param.handleAttitude}
  98. </if>
  99. <if test="param.feedback != null">
  100. AND t.feedback_ = #{param.feedback}
  101. </if>
  102. <if test="param.userId != null">
  103. AND t.user_id_ = #{param.userId}
  104. </if>
  105. </where>
  106. ORDER BY t.id_ DESC
  107. </select>
  108. </mapper>