TUEventOthersMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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="com.business.slfh.manager.othersmanager.mapper.TUEventOthersMapper">
  6. <resultMap type="TUEventOthers" id="TUEventOthersResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="remark" column="remark" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="name" column="name" />
  16. <result property="reportType" column="report_type" />
  17. <result property="reportContent" column="report_content" />
  18. <result property="reportTime" column="report_time" />
  19. <result property="reportor" column="reportor" />
  20. <result property="longitude" column="longitude" />
  21. <result property="latitude" column="latitude" />
  22. <result property="eventStatus" column="event_status" />
  23. <result property="eventLevel" column="event_level" />
  24. <result property="deptId" column="dept_id" />
  25. <result property="userId" column="user_id" />
  26. <result property="cameraId" column="camera_id" />
  27. <result property="needhelp" column="needhelp" />
  28. <result property="reserveplanType" column="reserveplan_type"></result>
  29. <result property="deptName" column="dept_name" />
  30. <result property="createUserId" column="create_user_id" />
  31. </resultMap>
  32. <sql id="selectTUEventOthersVo">
  33. select
  34. (select dept_name from sys_dept where dept_id=t.dept_id) dept_name,
  35. t.create_user_id, t.dept_id, t.user_id, t.camera_id, t.needhelp, t.id, t.status, t.remark, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.name, t.report_type, t.report_content, t.report_time, t.reportor, t.longitude, t.latitude, t.event_status, t.event_level, t.dept_id, t.reserveplan_type from t_u_event_others t
  36. </sql>
  37. <select id="selectTUEventOthersList" parameterType="TUEventOthers" resultMap="TUEventOthersResult">
  38. <include refid="selectTUEventOthersVo"/>
  39. <where>
  40. 1=1
  41. <if test="status != null and status != ''"> and status = #{status}</if>
  42. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  43. <if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
  44. <if test="reportContent != null and reportContent != ''"> and report_content like concat('%', #{reportContent}, '%')</if>
  45. <if test="params.beginReportTime != null and params.beginReportTime != ''"><!-- 开始时间检索 -->
  46. AND date_format(report_time,'%y%m%d') &gt;= date_format(#{params.beginReportTime},'%y%m%d')
  47. </if>
  48. <if test="params.endReportTime != null and params.endReportTime != ''"><!-- 结束时间检索 -->
  49. AND date_format(report_time,'%y%m%d') &lt;= date_format(#{params.endReportTime},'%y%m%d')
  50. </if>
  51. <!--<if test="reportTime != null "> and report_time = #{reportTime}</if>-->
  52. <if test="reportor != null and reportor != ''"> and reportor like concat('%', #{reportor}, '%')</if>
  53. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  54. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  55. <if test="eventStatus != null and eventStatus != ''"> and event_status = #{eventStatus}</if>
  56. <if test="eventLevel != null and eventLevel != ''"> and event_level = #{eventLevel}</if>
  57. <if test="deptId != null "> and dept_id = #{deptId}</if>
  58. <if test="userId != null "> and user_id = #{userId}</if>
  59. <if test="cameraId != null "> and camera_id = #{cameraId}</if>
  60. <if test="needhelp != null "> and needhelp = #{needhelp}</if>
  61. <if test="reserveplanType != null and reserveplanType != ''"> and reserveplan_type = #{reserveplanType}</if>
  62. <if test="deptIds != null "> and dept_id in (${deptIds})</if>
  63. <if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId}</if>
  64. </where>
  65. <!-- 数据范围过滤 -->
  66. ${params.dataScope}
  67. order by report_time desc
  68. </select>
  69. <select id="selectTUEventOthersById" parameterType="String" resultMap="TUEventOthersResult">
  70. <include refid="selectTUEventOthersVo"/>
  71. where id = #{id}
  72. </select>
  73. <insert id="insertTUEventOthers" parameterType="TUEventOthers">
  74. insert into t_u_event_others
  75. <trim prefix="(" suffix=")" suffixOverrides=",">
  76. <if test="id != null and id != ''">id,</if>
  77. <if test="status != null">status,</if>
  78. <if test="remark != null">remark,</if>
  79. <if test="delFlag != null">del_flag,</if>
  80. <if test="createBy != null">create_by,</if>
  81. <if test="createTime != null">create_time,</if>
  82. <if test="updateBy != null">update_by,</if>
  83. <if test="updateTime != null">update_time,</if>
  84. <if test="name != null">name,</if>
  85. <if test="reportType != null">report_type,</if>
  86. <if test="reportContent != null">report_content,</if>
  87. <if test="reportTime != null">report_time,</if>
  88. <if test="reportor != null">reportor,</if>
  89. <if test="longitude != null">longitude,</if>
  90. <if test="latitude != null">latitude,</if>
  91. <if test="eventStatus != null">event_status,</if>
  92. <if test="eventLevel != null">event_level,</if>
  93. <if test="deptId != null">dept_id,</if>
  94. <if test="userId != null">user_id,</if>
  95. <if test="cameraId != null">camera_id,</if>
  96. <if test="needhelp != null">needhelp,</if>
  97. <if test="reserveplanType != null">reserveplan_type,</if>
  98. <if test="createUserId != null">create_user_id,</if>
  99. </trim>
  100. <trim prefix="values (" suffix=")" suffixOverrides=",">
  101. <if test="id != null and id != ''">#{id},</if>
  102. <if test="status != null">#{status},</if>
  103. <if test="remark != null">#{remark},</if>
  104. <if test="delFlag != null">#{delFlag},</if>
  105. <if test="createBy != null">#{createBy},</if>
  106. <if test="createTime != null">#{createTime},</if>
  107. <if test="updateBy != null">#{updateBy},</if>
  108. <if test="updateTime != null">#{updateTime},</if>
  109. <if test="name != null">#{name},</if>
  110. <if test="reportType != null">#{reportType},</if>
  111. <if test="reportContent != null">#{reportContent},</if>
  112. <if test="reportTime != null">#{reportTime},</if>
  113. <if test="reportor != null">#{reportor},</if>
  114. <if test="longitude != null">#{longitude},</if>
  115. <if test="latitude != null">#{latitude},</if>
  116. <if test="eventStatus != null">#{eventStatus},</if>
  117. <if test="eventLevel != null">#{eventLevel},</if>
  118. <if test="deptId != null">#{deptId},</if>
  119. <if test="userId != null">#{userId},</if>
  120. <if test="cameraId != null">#{cameraId},</if>
  121. <if test="needhelp != null">#{needhelp},</if>
  122. <if test="reserveplanType != null">#{reserveplanType},</if>
  123. <if test="createUserId != null">#{createUserId},</if>
  124. </trim>
  125. </insert>
  126. <update id="updateTUEventOthers" parameterType="TUEventOthers">
  127. update t_u_event_others
  128. <trim prefix="SET" suffixOverrides=",">
  129. <if test="status != null">status = #{status},</if>
  130. <if test="remark != null">remark = #{remark},</if>
  131. <if test="delFlag != null">del_flag = #{delFlag},</if>
  132. <if test="createBy != null">create_by = #{createBy},</if>
  133. <if test="createTime != null">create_time = #{createTime},</if>
  134. <if test="updateBy != null">update_by = #{updateBy},</if>
  135. <if test="updateTime != null">update_time = #{updateTime},</if>
  136. <if test="name != null">name = #{name},</if>
  137. <if test="reportType != null">report_type = #{reportType},</if>
  138. <if test="reportContent != null">report_content = #{reportContent},</if>
  139. <if test="reportTime != null">report_time = #{reportTime},</if>
  140. <if test="reportor != null">reportor = #{reportor},</if>
  141. <if test="longitude != null">longitude = #{longitude},</if>
  142. <if test="latitude != null">latitude = #{latitude},</if>
  143. <if test="eventStatus != null">event_status = #{eventStatus},</if>
  144. <if test="eventLevel != null">event_level = #{eventLevel},</if>
  145. <if test="deptId != null">dept_id = #{deptId},</if>
  146. <if test="userId != null">user_id = #{userId},</if>
  147. <if test="cameraId != null">camera_id = #{cameraId},</if>
  148. <if test="needhelp != null">needhelp = #{needhelp},</if>
  149. <if test="reserveplanType != null">reserveplan_type=#{reserveplanType},</if>
  150. <if test="createUserId != null">create_user_id = #{createUserId},</if>
  151. </trim>
  152. where id = #{id}
  153. </update>
  154. <delete id="deleteTUEventOthersById" parameterType="String">
  155. delete from t_u_event_others where id = #{id}
  156. </delete>
  157. <delete id="deleteTUEventOthersByIds" parameterType="String">
  158. delete from t_u_event_others where id in
  159. <foreach item="id" collection="array" open="(" separator="," close=")">
  160. #{id}
  161. </foreach>
  162. </delete>
  163. </mapper>