ReportInfoAnswerValueServiceDaoImplMapper.xml 5.2 KB

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