ReportInfoAnswerValueServiceDaoImplMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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="reportInfoAnswerValueServiceDaoImpl">
  6. <!-- 保存批量操作日志详情信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReportInfoAnswerValueInfo" parameterType="Map">
  8. insert into report_info_answer_value(
  9. value_id,user_an_id,title_id,an_value_id,value_content,community_id,setting_id
  10. ) values (
  11. #{valueId},#{userAnId},#{titleId},#{anValueId},#{valueContent},#{communityId},#{settingId}
  12. )
  13. </insert>
  14. <!-- 查询批量操作日志详情信息 add by wuxw 2018-07-03 -->
  15. <select id="getReportInfoAnswerValueInfo" parameterType="Map" resultType="Map">
  16. select ra.person_name userName,st.name repName,tt.title repTitle,tv.qa_value repValue,av.value_content valueContent,
  17. av.create_time createTime,st.report_type reType,td.`name` repTypeName from
  18. report_info_answer_value av
  19. LEFT JOIN report_info_answer ra on av.user_an_id = ra.user_an_id and ra.status_cd=0
  20. LEFT JOIN report_info_setting_title_value tv on av.value_id = tv.value_id and tv.status_cd=0
  21. LEFT JOIN report_info_setting_title tt on av.title_id = av.title_id and tt.status_cd=0
  22. LEFT JOIN report_info_setting st on av.setting_id = st.setting_id and st.status_cd=0
  23. LEFT JOIN t_dict td on st.report_type = td.status_cd and td.table_name = 'report_info_setting' and td.table_columns = 'report_type'
  24. where 1=1
  25. <if test="valueId !=null and valueId != ''">
  26. and av.value_id= #{valueId}
  27. </if>
  28. <if test="userName !=null and userName != ''">
  29. and ra.person_name= #{userName}
  30. </if>
  31. <if test="repName !=null and repName != ''">
  32. and st.name= #{repName}
  33. </if>
  34. <if test="repTitle !=null and repTitle != ''">
  35. and tt.title like concat('%',#{repTitle},'%')
  36. </if>
  37. <if test="valueContent !=null and valueContent != ''">
  38. and av.value_content like concat('%',#{valueContent},'%')
  39. </if>
  40. <if test="createTime !=null and createTime != ''">
  41. and av.create_time= #{createTime}
  42. </if>
  43. <if test="userAnId !=null and userAnId != ''">
  44. and av.user_an_id= #{userAnId}
  45. </if>
  46. <if test="titleId !=null and titleId != ''">
  47. and av.title_id= #{titleId}
  48. </if>
  49. <if test="anValueId !=null and anValueId != ''">
  50. and av.an_value_id= #{anValueId}
  51. </if>
  52. <if test="valueContent !=null and valueContent != ''">
  53. and av.value_content= #{valueContent}
  54. </if>
  55. <if test="statusCd !=null and statusCd != ''">
  56. and av.status_cd= #{statusCd}
  57. </if>
  58. <if test="communityId !=null and communityId != ''">
  59. and av.community_id= #{communityId}
  60. </if>
  61. <if test="settingId !=null and settingId != ''">
  62. and av.setting_id= #{settingId}
  63. </if>
  64. order by ra.person_name,tt.title,av.create_time desc
  65. <if test="page != -1 and page != null ">
  66. limit #{page}, #{row}
  67. </if>
  68. </select>
  69. <!-- 修改批量操作日志详情信息 add by wuxw 2018-07-03 -->
  70. <update id="updateReportInfoAnswerValueInfo" parameterType="Map">
  71. update report_info_answer_value t set t.status_cd = #{statusCd}
  72. <if test="newBId != null and newBId != ''">
  73. ,t.b_id = #{newBId}
  74. </if>
  75. <if test="valueId !=null and valueId != ''">
  76. , t.value_id= #{valueId}
  77. </if>
  78. <if test="createTime !=null and createTime != ''">
  79. , t.create_time= #{createTime}
  80. </if>
  81. <if test="userAnId !=null and userAnId != ''">
  82. , t.user_an_id= #{userAnId}
  83. </if>
  84. <if test="titleId !=null and titleId != ''">
  85. , t.title_id= #{titleId}
  86. </if>
  87. <if test="valueContent !=null and valueContent != ''">
  88. , t.value_content= #{valueContent}
  89. </if>
  90. <if test="communityId !=null and communityId != ''">
  91. , t.community_id= #{communityId}
  92. </if>
  93. <if test="settingId !=null and settingId != ''">
  94. , t.setting_id= #{settingId}
  95. </if>
  96. where 1=1 <if test="anValueId !=null and anValueId != ''">
  97. and t.an_value_id= #{anValueId}
  98. </if>
  99. </update>
  100. <!-- 查询批量操作日志详情数量 add by wuxw 2018-07-03 -->
  101. <select id="queryReportInfoAnswerValuesCount" parameterType="Map" resultType="Map">
  102. select count(1) count from
  103. report_info_answer_value av
  104. LEFT JOIN report_info_answer ra on av.user_an_id = ra.user_an_id and ra.status_cd=0
  105. LEFT JOIN report_info_setting_title_value tv on av.value_id = tv.value_id and tv.status_cd=0
  106. LEFT JOIN report_info_setting_title tt on av.title_id = av.title_id and tt.status_cd=0
  107. LEFT JOIN report_info_setting st on av.setting_id = st.setting_id and st.status_cd=0
  108. LEFT JOIN t_dict td on st.report_type = td.status_cd and td.table_name = 'report_info_setting' and td.table_columns = 'report_type'
  109. where 1=1
  110. <if test="valueId !=null and valueId != ''">
  111. and av.value_id= #{valueId}
  112. </if>
  113. <if test="createTime !=null and createTime != ''">
  114. and av.create_time= #{createTime}
  115. </if>
  116. <if test="userAnId !=null and userAnId != ''">
  117. and av.user_an_id= #{userAnId}
  118. </if>
  119. <if test="titleId !=null and titleId != ''">
  120. and av.title_id= #{titleId}
  121. </if>
  122. <if test="anValueId !=null and anValueId != ''">
  123. and av.an_value_id= #{anValueId}
  124. </if>
  125. <if test="valueContent !=null and valueContent != ''">
  126. and av.value_content= #{valueContent}
  127. </if>
  128. <if test="statusCd !=null and statusCd != ''">
  129. and av.status_cd= #{statusCd}
  130. </if>
  131. <if test="communityId !=null and communityId != ''">
  132. and av.community_id= #{communityId}
  133. </if>
  134. <if test="settingId !=null and settingId != ''">
  135. and av.setting_id= #{settingId}
  136. </if>
  137. </select>
  138. </mapper>