BisInspRsvrCameraDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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="cn.com.goldenwater.dcproj.dao.BisInspRsvrCameraDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRsvrCamera" id="bisInspRsvrCameraResultMap">
  5. <result property="rsCode" column="RS_CODE"/>
  6. <result property="rsName" column="RS_NAME"/>
  7. <result property="admDiv" column="ADM_DIV"/>
  8. <result property="regCode" column="REG_CODE"/>
  9. <result property="indexCode" column="INDEX_CODE"/>
  10. <result property="externalIndexCode" column="EXTERNAL_INDEX_CODE"/>
  11. <result property="regionIndexCode" column="REGION_INDEX_CODE"/>
  12. <result property="indexName" column="INDEX_NAME"/>
  13. <result property="deviceIndexCode" column="DEVICE_INDEX_CODE"/>
  14. <result property="loggitude" column="LOGGITUDE"/>
  15. <result property="latitude" column="LATITUDE"/>
  16. <result property="cameraType" column="CAMERA_TYPE"/>
  17. <result property="channum" column="CHANNUM"/>
  18. <result property="channelType" column="CHANNEL_TYPE"/>
  19. <result property="deviceResourceType" column="DEVICE_RESOURCE_TYPE"/>
  20. <result property="transType" column="TRANS_TYPE"/>
  21. <result property="capabilitySet" column="CAPABILITY_SET"/>
  22. <result property="dataVersion" column="DATA_VERSION"/>
  23. <result property="createTime" column="CREATE_TIME"/>
  24. <result property="updateTime" column="UPDATE_TIME"/>
  25. <result property="intm" column="INTM"/>
  26. <result property="uptm" column="UPTM"/>
  27. </resultMap>
  28. <sql id="table_columns">
  29. RS_CODE,
  30. RS_NAME,
  31. ADM_DIV,
  32. REG_CODE,
  33. INDEX_CODE,
  34. EXTERNAL_INDEX_CODE,
  35. REGION_INDEX_CODE,
  36. INDEX_NAME,
  37. DEVICE_INDEX_CODE,
  38. LOGGITUDE,
  39. LATITUDE,
  40. CAMERA_TYPE,
  41. CHANNUM,
  42. CHANNEL_TYPE,
  43. DEVICE_RESOURCE_TYPE,
  44. TRANS_TYPE,
  45. CAPABILITY_SET,
  46. DATA_VERSION,
  47. CREATE_TIME,
  48. UPDATE_TIME,
  49. INTM,
  50. UPTM
  51. </sql>
  52. <sql id="entity_properties">
  53. #{rsCode},
  54. #{rsName},
  55. #{admDiv},
  56. #{regCode},
  57. #{indexCode},
  58. #{externalIndexCode},
  59. #{regionIndexCode},
  60. #{indexName},
  61. #{deviceIndexCode},
  62. #{loggitude},
  63. #{latitude},
  64. #{cameraType},
  65. #{channum},
  66. #{channelType},
  67. #{deviceResourceType},
  68. #{transType},
  69. #{capabilitySet},
  70. #{dataVersion},
  71. #{createTime},
  72. #{updateTime},
  73. #{intm},
  74. #{uptm}
  75. </sql>
  76. <!-- 实体类属性 列表 entity_properties_item for循环使用 -->
  77. <sql id="entity_properties_item">
  78. #{item.rsCode} AS RS_CODE,
  79. #{item.rsName} AS RS_NAME,
  80. #{item.admDiv} AS ADM_DIV,
  81. #{item.regCode} AS REG_CODE,
  82. #{item.indexCode} AS INDEX_CODE,
  83. #{item.externalIndexCode} AS EXTERNAL_INDEX_CODE,
  84. #{item.regionIndexCode} AS REGION_INDEX_CODE,
  85. #{item.indexName} AS INDEX_NAME,
  86. #{item.deviceIndexCode} AS DEVICE_INDEX_CODE,
  87. #{item.loggitude} AS LOGGITUDE,
  88. #{item.latitude} AS LATITUDE,
  89. #{item.cameraType} AS CAMERA_TYPE,
  90. #{item.channum} AS CHANNUM,
  91. #{item.channelType} AS CHANNEL_TYPE,
  92. #{item.deviceResourceType} AS DEVICE_RESOURCE_TYPE,
  93. #{item.transType} AS TRANS_TYPE,
  94. #{item.capabilitySet} AS CAPABILITY_SET,
  95. #{item.dataVersion} AS DATA_VERSION,
  96. #{item.createTime} AS CREATE_TIME,
  97. #{item.updateTime} AS UPDATE_TIME,
  98. #{item.intm} AS INTM,
  99. #{item.uptm} AS UPTM
  100. </sql>
  101. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  102. <sql id="page_where">
  103. <trim prefix="where" prefixOverrides="and | or ">
  104. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  105. <if test="rsName != null and rsName != ''">and RS_NAME like concat('%',#{rsName},'%') </if>
  106. <if test="admDiv != null and admDiv != ''">and ADM_DIV like concat('%',#{admDiv}) </if>
  107. <if test="regCode != null and regCode != ''">and REG_CODE like concat('%', #{regCode},'%') </if>
  108. <if test="indexCode != null and indexCode != ''">and INDEX_CODE = #{indexCode}</if>
  109. <if test="externalIndexCode != null and externalIndexCode != ''">and EXTERNAL_INDEX_CODE = #{externalIndexCode}</if>
  110. <if test="regionIndexCode != null and regionIndexCode != ''">and REGION_INDEX_CODE = #{regionIndexCode}</if>
  111. <if test="indexName != null and indexName != ''">and INDEX_NAME = #{indexName}</if>
  112. <if test="deviceIndexCode != null and deviceIndexCode != ''">and DEVICE_INDEX_CODE = #{deviceIndexCode}</if>
  113. <if test="loggitude != null and loggitude != ''">and LOGGITUDE = #{loggitude}</if>
  114. <if test="latitude != null and latitude != ''">and LATITUDE = #{latitude}</if>
  115. <if test="cameraType != null and cameraType != ''">and CAMERA_TYPE = #{cameraType}</if>
  116. <if test="channum != null and channum != ''">and CHANNUM = #{channum}</if>
  117. <if test="channelType != null and channelType != ''">and CHANNEL_TYPE = #{channelType}</if>
  118. <if test="deviceResourceType != null and deviceResourceType != ''">and DEVICE_RESOURCE_TYPE = #{deviceResourceType}</if>
  119. <if test="transType != null and transType != ''">and TRANS_TYPE = #{transType}</if>
  120. <if test="capabilitySet != null and capabilitySet != ''">and CAPABILITY_SET = #{capabilitySet}</if>
  121. <if test="dataVersion != null and dataVersion != ''">and DATA_VERSION = #{dataVersion}</if>
  122. <if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
  123. <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = #{updateTime}</if>
  124. <if test="intm != null">and INTM = #{intm}</if>
  125. <if test="uptm != null">and UPTM = #{uptm}</if>
  126. </trim>
  127. </sql>
  128. <select id="get" resultMap="bisInspRsvrCameraResultMap" >
  129. select <include refid="table_columns" /> from BIS_INSP_RSVR_CAMERA where RS_CODE = #{rsCode} and INDEX_CODE = #{indexCode}
  130. </select>
  131. <select id="getByRsCode" resultMap="bisInspRsvrCameraResultMap" parameterType="String">
  132. select <include refid="table_columns" /> from BIS_INSP_RSVR_CAMERA where RS_CODE = #{rsCode}
  133. </select>
  134. <select id="getBy" resultMap="bisInspRsvrCameraResultMap" parameterType="cn.com.goldenwater.dcproj.param.BisInspRsvrCameraParam">
  135. select <include refid="table_columns" /> from BIS_INSP_RSVR_CAMERA <include refid="page_where" />
  136. </select>
  137. <select id="findAll" resultMap="bisInspRsvrCameraResultMap">
  138. select <include refid="table_columns" /> from BIS_INSP_RSVR_CAMERA
  139. </select>
  140. <select id="findList" resultMap="bisInspRsvrCameraResultMap" parameterType="cn.com.goldenwater.dcproj.param.BisInspRsvrCameraParam">
  141. select <include refid="table_columns" /> from BIS_INSP_RSVR_CAMERA <include refid="page_where" />
  142. </select>
  143. <select id="selectCount" resultType="int" >
  144. select count(ID) from BIS_INSP_RSVR_CAMERA <include refid="page_where" />
  145. </select>
  146. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrCamera">
  147. insert into BIS_INSP_RSVR_CAMERA( <include refid="table_columns" /> )
  148. values ( <include refid="entity_properties" /> )
  149. </insert>
  150. <delete id="delete" parameterType="java.lang.String">
  151. delete from BIS_INSP_RSVR_CAMERA where RS_CODE = #{rsCode}
  152. </delete>
  153. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.param.BisInspRsvrCameraParam">
  154. delete from BIS_INSP_RSVR_CAMERA <include refid="page_where" />
  155. </delete>
  156. <update id="deleteInFlag" parameterType="java.lang.String">
  157. delete from BIS_INSP_RSVR_CAMERA where RS_CODE = #{rsCode}
  158. </update>
  159. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrCamera">
  160. update BIS_INSP_RSVR_CAMERA
  161. <trim prefix="set" suffixOverrides=",">
  162. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  163. <if test="admDiv != null and admDiv != ''">ADM_DIV = #{admDiv},</if>
  164. <if test="regCode != null and regCode != ''">REG_CODE = #{regCode},</if>
  165. <if test="indexCode != null and indexCode != ''">INDEX_CODE = #{indexCode},</if>
  166. <if test="externalIndexCode != null and externalIndexCode != ''">EXTERNAL_INDEX_CODE = #{externalIndexCode},</if>
  167. <if test="regionIndexCode != null and regionIndexCode != ''">REGION_INDEX_CODE = #{regionIndexCode},</if>
  168. <if test="indexName != null and indexName != ''">INDEX_NAME = #{indexName},</if>
  169. <if test="deviceIndexCode != null and deviceIndexCode != ''">DEVICE_INDEX_CODE = #{deviceIndexCode},</if>
  170. <if test="loggitude != null and loggitude != ''">LOGGITUDE = #{loggitude},</if>
  171. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  172. <if test="cameraType != null and cameraType != ''">CAMERA_TYPE = #{cameraType},</if>
  173. <if test="channum != null and channum != ''">CHANNUM = #{channum},</if>
  174. <if test="channelType != null and channelType != ''">CHANNEL_TYPE = #{channelType},</if>
  175. <if test="deviceResourceType != null and deviceResourceType != ''">DEVICE_RESOURCE_TYPE = #{deviceResourceType},</if>
  176. <if test="transType != null and transType != ''">TRANS_TYPE = #{transType},</if>
  177. <if test="capabilitySet != null and capabilitySet != ''">CAPABILITY_SET = #{capabilitySet},</if>
  178. <if test="dataVersion != null and dataVersion != ''">DATA_VERSION = #{dataVersion},</if>
  179. <if test="createTime != null and createTime != ''">CREATE_TIME = #{createTime},</if>
  180. <if test="updateTime != null and updateTime != ''">UPDATE_TIME = #{updateTime},</if>
  181. <if test="intm != null">INTM = #{intm},</if>
  182. <if test="uptm != null">UPTM = #{uptm},</if>
  183. </trim>
  184. <where>RS_CODE = #{rsCode}</where>
  185. </update>
  186. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrCamera">
  187. update BIS_INSP_RSVR_CAMERA
  188. <trim prefix="set" suffixOverrides=",">
  189. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  190. <if test="admDiv != null and admDiv != ''">ADM_DIV = #{admDiv},</if>
  191. <if test="regCode != null and regCode != ''">REG_CODE = #{regCode},</if>
  192. <if test="indexCode != null and indexCode != ''">INDEX_CODE = #{indexCode},</if>
  193. <if test="externalIndexCode != null and externalIndexCode != ''">EXTERNAL_INDEX_CODE = #{externalIndexCode},</if>
  194. <if test="regionIndexCode != null and regionIndexCode != ''">REGION_INDEX_CODE = #{regionIndexCode},</if>
  195. <if test="indexName != null and indexName != ''">INDEX_NAME = #{indexName},</if>
  196. <if test="deviceIndexCode != null and deviceIndexCode != ''">DEVICE_INDEX_CODE = #{deviceIndexCode},</if>
  197. <if test="loggitude != null and loggitude != ''">LOGGITUDE = #{loggitude},</if>
  198. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  199. <if test="cameraType != null and cameraType != ''">CAMERA_TYPE = #{cameraType},</if>
  200. <if test="channum != null and channum != ''">CHANNUM = #{channum},</if>
  201. <if test="channelType != null and channelType != ''">CHANNEL_TYPE = #{channelType},</if>
  202. <if test="deviceResourceType != null and deviceResourceType != ''">DEVICE_RESOURCE_TYPE = #{deviceResourceType},</if>
  203. <if test="transType != null and transType != ''">TRANS_TYPE = #{transType},</if>
  204. <if test="capabilitySet != null and capabilitySet != ''">CAPABILITY_SET = #{capabilitySet},</if>
  205. <if test="dataVersion != null and dataVersion != ''">DATA_VERSION = #{dataVersion},</if>
  206. <if test="createTime != null and createTime != ''">CREATE_TIME = #{createTime},</if>
  207. <if test="updateTime != null and updateTime != ''">UPDATE_TIME = #{updateTime},</if>
  208. <if test="intm != null">INTM = #{intm},</if>
  209. <if test="uptm != null">UPTM = #{uptm},</if>
  210. </trim>
  211. <include refid="page_where" />
  212. </update>
  213. <!-- 其他自定义SQL -->
  214. <insert id="insertBatchList" parameterType="java.util.List" useGeneratedKeys="false">
  215. insert into BIS_INSP_RSVR_CAMERA
  216. (<include refid="table_columns"/>)
  217. select t.* from (
  218. <foreach item="item" index="index" collection="list" separator="union all">
  219. select <include refid="entity_properties_item"/> from dual
  220. </foreach>
  221. ) t
  222. </insert>
  223. </mapper>