ReportUserQuestionAnswerValueServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="reportUserQuestionAnswerValueServiceDaoImpl">
  6. <!-- 查询欠费统计信息 add by wuxw 2018-07-03 -->
  7. <select id="getUserQuestionAnswerValueInfo" parameterType="Map" resultType="Map">
  8. select uu.`name` userName,qa.qa_name qaName,uat.qa_title qaTitle,qatv.qa_value qaValue,t.value_content valueContent,
  9. t.create_time createTime,qa.qa_type qaType,td.`name` qaTypeName
  10. from user_question_answer_value t
  11. left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0'
  12. left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0'
  13. left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0'
  14. left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0'
  15. left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
  16. where 1=1
  17. <if test="score !=null and score != ''">
  18. and t.score= #{score}
  19. </if>
  20. <if test="valueId !=null and valueId != ''">
  21. and t.value_id= #{valueId}
  22. </if>
  23. <if test="titleId !=null and titleId != ''">
  24. and t.title_id= #{titleId}
  25. </if>
  26. <if test="answerType !=null and answerType != ''">
  27. and t.answer_type= #{answerType}
  28. </if>
  29. <if test="objId !=null and objId != ''">
  30. and t.obj_id= #{objId}
  31. </if>
  32. <if test="userQaId !=null and userQaId != ''">
  33. and t.user_qa_id= #{userQaId}
  34. </if>
  35. <if test="valueContent !=null and valueContent != ''">
  36. and t.value_content= #{valueContent}
  37. </if>
  38. <if test="personId !=null and personId != ''">
  39. and t.person_id= #{personId}
  40. </if>
  41. <if test="statusCd !=null and statusCd != ''">
  42. and t.status_cd= #{statusCd}
  43. </if>
  44. <if test="objType !=null and objType != ''">
  45. and t.obj_type= #{objType}
  46. </if>
  47. <if test="userTitleId !=null and userTitleId != ''">
  48. and t.user_title_id= #{userTitleId}
  49. </if>
  50. <if test="qaId !=null and qaId != ''">
  51. and t.qa_id= #{qaId}
  52. </if>
  53. order by t.create_time desc
  54. <if test="page != -1 and page != null ">
  55. limit #{page}, #{row}
  56. </if>
  57. </select>
  58. <!-- 查询欠费统计数量 add by wuxw 2018-07-03 -->
  59. <select id="queryUserQuestionAnswerValuesCount" parameterType="Map" resultType="Map">
  60. select count(1) count
  61. from user_question_answer_value t
  62. left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0'
  63. left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0'
  64. left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0'
  65. left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0'
  66. left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
  67. where 1=1
  68. <if test="score !=null and score != ''">
  69. and t.score= #{score}
  70. </if>
  71. <if test="valueId !=null and valueId != ''">
  72. and t.value_id= #{valueId}
  73. </if>
  74. <if test="titleId !=null and titleId != ''">
  75. and t.title_id= #{titleId}
  76. </if>
  77. <if test="answerType !=null and answerType != ''">
  78. and t.answer_type= #{answerType}
  79. </if>
  80. <if test="objId !=null and objId != ''">
  81. and t.obj_id= #{objId}
  82. </if>
  83. <if test="userQaId !=null and userQaId != ''">
  84. and t.user_qa_id= #{userQaId}
  85. </if>
  86. <if test="valueContent !=null and valueContent != ''">
  87. and t.value_content= #{valueContent}
  88. </if>
  89. <if test="personId !=null and personId != ''">
  90. and t.person_id= #{personId}
  91. </if>
  92. <if test="statusCd !=null and statusCd != ''">
  93. and t.status_cd= #{statusCd}
  94. </if>
  95. <if test="objType !=null and objType != ''">
  96. and t.obj_type= #{objType}
  97. </if>
  98. <if test="userTitleId !=null and userTitleId != ''">
  99. and t.user_title_id= #{userTitleId}
  100. </if>
  101. <if test="qaId !=null and qaId != ''">
  102. and t.qa_id= #{qaId}
  103. </if>
  104. </select>
  105. </mapper>