BbsAuthRecordMapper.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.bbs.dao.BbsAuthRecordDao">
  4. <select id="selectPage" resultType="com.yonge.cooleshow.bbs.vo.BbsAuthRecordVo">
  5. SELECT
  6. a.id_ AS articleId,
  7. a.title_ AS title,
  8. a.user_id_ AS userId,
  9. u.username_ AS userName,
  10. u.real_name_ AS realName,
  11. u.phone_ AS phone,
  12. a.label_id_ AS labelId,
  13. l.label_name_ AS labelName,
  14. a.status_ AS `status`,
  15. a.reply_flag_ AS replyFlag,
  16. a.created_time_ AS articleCreatedTime,
  17. r.audit_state_ AS auditState,
  18. r.reason_ AS reason,
  19. r.create_time_ AS createdTime,
  20. r.update_time_ AS updatedTime
  21. FROM bbs_article a
  22. LEFT JOIN sys_user u ON a.user_id_ = u.id_
  23. LEFT JOIN bbs_auth_record r ON a.id_=r.article_id_
  24. LEFT JOIN bbs_config_label l ON a.label_id_ = l.id_
  25. WHERE a.status_ IN ('DOING','PASS','REJECT')
  26. <where>
  27. <if test="null != param.search and '' != param.search">
  28. AND (
  29. u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
  30. u.phone_ LIKE CONCAT('%', #{param.search}, '%') OR
  31. a.title_ LIKE CONCAT('%', #{param.search}, '%')
  32. )
  33. </if>
  34. <if test="param.auditState !=null and param.auditState !=''">
  35. AND a.label_id_ = #{param.labelId}
  36. </if>
  37. <if test="param.auditState !=null and param.auditState !=''">
  38. AND r.audit_state_ = #{param.auditState}
  39. </if>
  40. <if test="param.startTime !=null">
  41. <![CDATA[AND a.create_time_ >= #{param.startTime} ]]>
  42. </if>
  43. <if test="param.endTime !=null">
  44. <![CDATA[AND a.create_time_ <= #{param.endTime} ]]>
  45. </if>
  46. </where>
  47. </select>
  48. </mapper>