CommonGBChannelMapper.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. package com.genersoft.iot.vmp.gb28181.dao;
  2. import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
  3. import org.apache.ibatis.annotations.*;
  4. import org.springframework.stereotype.Repository;
  5. import java.util.List;
  6. @Mapper
  7. @Repository
  8. public interface CommonGBChannelMapper {
  9. @Select("select\n" +
  10. " id as gb_id,\n" +
  11. " device_db_id,\n" +
  12. " stream_push_id,\n" +
  13. " stream_proxy_id,\n" +
  14. " create_time,\n" +
  15. " update_time,\n" +
  16. " sub_count,\n" +
  17. " stream_id,\n" +
  18. " has_audio,\n" +
  19. " gps_time,\n" +
  20. " stream_identification,\n" +
  21. " coalesce(gb_device_id, device_id) as gb_device_id,\n" +
  22. " coalesce(gb_name, name) as gb_name,\n" +
  23. " coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
  24. " coalesce(gb_model, model) as gb_model,\n" +
  25. " coalesce(gb_owner, owner) as gb_owner,\n" +
  26. " coalesce(gb_civil_code, civil_code) as gb_civil_code,\n" +
  27. " coalesce(gb_block, block) as gb_block,\n" +
  28. " coalesce(gb_address, address) as gb_address,\n" +
  29. " coalesce(gb_parental, parental) as gb_parental,\n" +
  30. " coalesce(gb_parent_id, parent_id) as gb_parent_id,\n" +
  31. " coalesce(gb_safety_way, safety_way) as gb_safety_way,\n" +
  32. " coalesce(gb_register_way, register_way) as gb_register_way,\n" +
  33. " coalesce(gb_cert_num, cert_num) as gb_cert_num,\n" +
  34. " coalesce(gb_certifiable, certifiable) as gb_certifiable,\n" +
  35. " coalesce(gb_err_code, err_code) as gb_err_code,\n" +
  36. " coalesce(gb_end_time, end_time) as gb_end_time,\n" +
  37. " coalesce(gb_secrecy, secrecy) as gb_secrecy,\n" +
  38. " coalesce(gb_ip_address, ip_address) as gb_ip_address,\n" +
  39. " coalesce(gb_port, port) as gb_port,\n" +
  40. " coalesce(gb_password, password) as gb_password,\n" +
  41. " coalesce(gb_status, status) as gb_status,\n" +
  42. " coalesce(gb_longitude, longitude) as gb_longitude,\n" +
  43. " coalesce(gb_latitude, latitude) as gb_latitude,\n" +
  44. " coalesce(gb_ptz_type, ptz_type) as gb_ptz_type,\n" +
  45. " coalesce(gb_position_type, position_type) as gb_position_type,\n" +
  46. " coalesce(gb_room_type, room_type) as gb_room_type,\n" +
  47. " coalesce(gb_use_type, use_type) as gb_use_type,\n" +
  48. " coalesce(gb_supply_light_type, supply_light_type) as gb_supply_light_type,\n" +
  49. " coalesce(gb_direction_type, direction_type) as gb_direction_type,\n" +
  50. " coalesce(gb_resolution, resolution) as gb_resolution,\n" +
  51. " coalesce(gb_business_group_id, business_group_id) as gb_business_group_id,\n" +
  52. " coalesce(gb_download_speed, download_speed) as gb_download_speed,\n" +
  53. " coalesce(gb_svc_space_support_mod, svc_space_support_mod) as gb_svc_space_support_mod,\n" +
  54. " coalesce(gb_svc_time_support_mode,svc_time_support_mode) as gb_svc_time_support_mode\n" +
  55. "from wvp_device_channel\n" +
  56. "where gb_device_id = #{gbDeviceId} or device_id = #{gbDeviceId}")
  57. CommonGBChannel queryByDeviceId(@Param("gbDeviceId") String gbDeviceId);
  58. @Insert(" <script>" +
  59. "INSERT INTO wvp_device_channel (" +
  60. "gb_device_id," +
  61. " <if test='streamProxyId != null' > stream_proxy_id,</if>" +
  62. " <if test='streamPushId != null' > stream_push_id,</if>" +
  63. "create_time," +
  64. "update_time," +
  65. "sub_count," +
  66. "stream_id," +
  67. "has_audio," +
  68. "gps_time," +
  69. "stream_identification," +
  70. "gb_name," +
  71. "gb_manufacturer," +
  72. "gb_model," +
  73. "gb_owner," +
  74. "gb_civil_code," +
  75. "gb_block," +
  76. "gb_address," +
  77. "gb_parental," +
  78. "gb_parent_id ," +
  79. "gb_safety_way," +
  80. "gb_register_way," +
  81. "gb_cert_num," +
  82. "gb_certifiable," +
  83. "gb_err_code," +
  84. "gb_end_time," +
  85. "gb_secrecy," +
  86. "gb_ip_address," +
  87. "gb_port," +
  88. "gb_password," +
  89. "gb_status," +
  90. "gb_longitude," +
  91. "gb_latitude," +
  92. "gb_ptz_type," +
  93. "gb_position_type," +
  94. "gb_room_type," +
  95. "gb_use_type," +
  96. "gb_supply_light_type," +
  97. "gb_direction_type," +
  98. "gb_resolution," +
  99. "gb_business_group_id," +
  100. "gb_download_speed," +
  101. "gb_svc_space_support_mod," +
  102. "gb_svc_time_support_mode ) " +
  103. "VALUES (" +
  104. "#{gbDeviceId}, " +
  105. " <if test='streamProxyId != null' > #{streamProxyId},</if>" +
  106. " <if test='streamPushId != null' > #{streamPushId},</if>" +
  107. "#{createTime}, " +
  108. "#{updateTime}, " +
  109. "#{subCount}, " +
  110. "#{streamId}, " +
  111. "#{hasAudio}, " +
  112. "#{gpsTime}, " +
  113. "#{streamIdentification}, " +
  114. "#{gbName}, " +
  115. "#{gbManufacturer}, " +
  116. "#{gbModel}, " +
  117. "#{gbOwner}, " +
  118. "#{gbCivilCode}, " +
  119. "#{gbBlock}, " +
  120. "#{gbAddress}, " +
  121. "#{gbParental}, " +
  122. "#{gbParentId}, " +
  123. "#{gbSafetyWay}, " +
  124. "#{gbRegisterWay}, " +
  125. "#{gbCertNum}, " +
  126. "#{gbCertifiable}, " +
  127. "#{gbErrCode}, " +
  128. "#{gbEndTime}, " +
  129. "#{gbSecrecy},"+
  130. "#{gbIpAddress},"+
  131. "#{gbPort},"+
  132. "#{gbPassword},"+
  133. "#{gbStatus},"+
  134. "#{gbLongitude},"+
  135. "#{gbLatitude},"+
  136. "#{gbPtzType},"+
  137. "#{gbPositionType},"+
  138. "#{gbRoomType},"+
  139. "#{gbUseType},"+
  140. "#{gbSupplyLightType},"+
  141. "#{gbDirectionType},"+
  142. "#{gbResolution},"+
  143. "#{gbBusinessGroupId},"+
  144. "#{gbDownloadSpeed},"+
  145. "#{gbSvcSpaceSupportMod},"+
  146. "#{gbSvcTimeSupportMode}"+
  147. ")" +
  148. " </script>")
  149. int insert(CommonGBChannel commonGBChannel);
  150. @Select(" select\n" +
  151. " id as gb_id,\n" +
  152. " device_db_id,\n" +
  153. " stream_push_id,\n" +
  154. " stream_proxy_id,\n" +
  155. " create_time,\n" +
  156. " update_time,\n" +
  157. " sub_count,\n" +
  158. " stream_id,\n" +
  159. " has_audio,\n" +
  160. " gps_time,\n" +
  161. " stream_identification,\n" +
  162. " device_db_id as gb_device_db_id,\n" +
  163. " coalesce(gb_device_id, device_id) as gb_device_id,\n" +
  164. " coalesce(gb_name, name) as gb_name,\n" +
  165. " coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
  166. " coalesce(gb_model, model) as gb_model,\n" +
  167. " coalesce(gb_owner, owner) as gb_owner,\n" +
  168. " coalesce(gb_civil_code, civil_code) as gb_civil_code,\n" +
  169. " coalesce(gb_block, block) as gb_block,\n" +
  170. " coalesce(gb_address, address) as gb_address,\n" +
  171. " coalesce(gb_parental, parental) as gb_parental,\n" +
  172. " coalesce(gb_parent_id, parent_id) as gb_parent_id,\n" +
  173. " coalesce(gb_safety_way, safety_way) as gb_safety_way,\n" +
  174. " coalesce(gb_register_way, register_way) as gb_register_way,\n" +
  175. " coalesce(gb_cert_num, cert_num) as gb_cert_num,\n" +
  176. " coalesce(gb_certifiable, certifiable) as gb_certifiable,\n" +
  177. " coalesce(gb_err_code, err_code) as gb_err_code,\n" +
  178. " coalesce(gb_end_time, end_time) as gb_end_time,\n" +
  179. " coalesce(gb_secrecy, secrecy) as gb_secrecy,\n" +
  180. " coalesce(gb_ip_address, ip_address) as gb_ip_address,\n" +
  181. " coalesce(gb_port, port) as gb_port,\n" +
  182. " coalesce(gb_password, password) as gb_password,\n" +
  183. " coalesce(gb_status, status) as gb_status,\n" +
  184. " coalesce(gb_longitude, longitude) as gb_longitude,\n" +
  185. " coalesce(gb_latitude, latitude) as gb_latitude,\n" +
  186. " coalesce(gb_ptz_type, ptz_type) as gb_ptz_type,\n" +
  187. " coalesce(gb_position_type, position_type) as gb_position_type,\n" +
  188. " coalesce(gb_room_type, room_type) as gb_room_type,\n" +
  189. " coalesce(gb_use_type, use_type) as gb_use_type,\n" +
  190. " coalesce(gb_supply_light_type, supply_light_type) as gb_supply_light_type,\n" +
  191. " coalesce(gb_direction_type, direction_type) as gb_direction_type,\n" +
  192. " coalesce(gb_resolution, resolution) as gb_resolution,\n" +
  193. " coalesce(gb_business_group_id, business_group_id) as gb_business_group_id,\n" +
  194. " coalesce(gb_download_speed, download_speed) as gb_download_speed,\n" +
  195. " coalesce(gb_svc_space_support_mod, svc_space_support_mod) as gb_svc_space_support_mod,\n" +
  196. " coalesce(gb_svc_time_support_mode, svc_time_support_mode) as gb_svc_time_support_mode\n" +
  197. " from wvp_device_channel" +
  198. " where id = #{gbId}")
  199. CommonGBChannel queryById(@Param("gbId") int gbId);
  200. @Delete(value = {"delete from wvp_device_channel where id = #{gbId} "})
  201. void delete(int gbId);
  202. @Update(value = {" <script>" +
  203. "UPDATE wvp_device_channel " +
  204. "SET update_time=#{updateTime}" +
  205. "<if test='streamPushId != null'>, stream_push_id = #{streamPushId}</if>" +
  206. "<if test='streamPushId == null'>, stream_push_id = null</if>" +
  207. "<if test='streamProxyId != null'>, stream_proxy_id = #{streamProxyId}</if>" +
  208. "<if test='streamProxyId == null'>, stream_proxy_id = null</if>" +
  209. "<if test='subCount != null'>, sub_count = #{subCount}</if>" +
  210. "<if test='subCount == null'>, sub_count = null</if>" +
  211. "<if test='streamId != null'>, stream_id = #{streamId}</if>" +
  212. "<if test='streamId == null'>, stream_id = null</if>" +
  213. "<if test='hasAudio != null'>, has_audio = #{hasAudio}</if>" +
  214. "<if test='hasAudio == null'>, has_audio = null</if>" +
  215. "<if test='gpsTime != null'>, gps_time = #{gpsTime}</if>" +
  216. "<if test='gpsTime == null'>, gps_time = null</if>" +
  217. "<if test='streamIdentification != null'>, stream_identification = #{streamIdentification}</if>" +
  218. "<if test='streamIdentification == null'>, stream_identification = null</if>" +
  219. "<if test='gbDeviceId != null'>, gb_device_id = #{gbDeviceId}</if>" +
  220. "<if test='gbDeviceId == null'>, gb_device_id = null</if>" +
  221. "<if test='gbName != null'>, gb_name = #{gbName}</if>" +
  222. "<if test='gbName == null'>, gb_name = null</if>" +
  223. "<if test='gbManufacturer != null'>, gb_manufacturer = #{gbManufacturer}</if>" +
  224. "<if test='gbManufacturer == null'>, gb_manufacturer = null</if>" +
  225. "<if test='gbModel != null'>, gb_model = #{gbModel}</if>" +
  226. "<if test='gbModel == null'>, gb_model = null</if>" +
  227. "<if test='gbOwner != null' >, gb_owner = #{gbOwner}</if>" +
  228. "<if test='gbOwner == null'>, gb_owner = null</if>" +
  229. "<if test='gbCivilCode, != null' >, gb_civil_code = #{gbCivilCode}</if>" +
  230. "<if test='gbCivilCode, == null'>, gb_civil_code = null</if>" +
  231. "<if test='gbBlock != null' >, gb_block = #{gbBlock}</if>" +
  232. "<if test='gbBlock == null'>, gb_block = null</if>" +
  233. "<if test='gbAddress != null' >, gb_address = #{gbAddress}</if>" +
  234. "<if test='gbAddress == null'>, gb_address = null</if>" +
  235. "<if test='gbParental != null' >, gb_parental = #{gbParental}</if>" +
  236. "<if test='gbParental == null'>, gb_parental = null</if>" +
  237. "<if test='gbParentId != null' >, gb_parent_id = #{gbParentId}</if>" +
  238. "<if test='gbParentId == null'>, gb_parent_id = null</if>" +
  239. "<if test='gbSafetyWay != null' >, gb_safety_way = #{gbSafetyWay}</if>" +
  240. "<if test='gbSafetyWay == null'>, gb_safety_way = null</if>" +
  241. "<if test='gbRegisterWay != null' >, gb_register_way = #{gbRegisterWay}</if>" +
  242. "<if test='gbRegisterWay == null'>, gb_register_way = null</if>" +
  243. "<if test='gbCertNum != null' >, gb_cert_num = #{gbCertNum}</if>" +
  244. "<if test='gbCertNum == null'>, gb_cert_num = null</if>" +
  245. "<if test='gbCertifiable != null' >, gb_certifiable = #{gbCertifiable}</if>" +
  246. "<if test='gbCertifiable == null'>, gb_certifiable = null</if>" +
  247. "<if test='gbErrCode != null' >, gb_err_code = #{gbErrCode}</if>" +
  248. "<if test='gbErrCode == null'>, gb_err_code = null</if>" +
  249. "<if test='gbEndTime != null' >, gb_end_time = #{gbEndTime}</if>" +
  250. "<if test='gbEndTime == null'>, gb_end_time = null</if>" +
  251. "<if test='gbSecrecy != null' >, gb_secrecy = #{gbSecrecy}</if>" +
  252. "<if test='gbSecrecy == null'>, gb_secrecy = null</if>" +
  253. "<if test='gbIpAddress != null' >, gb_ip_address = #{gbIpAddress}</if>" +
  254. "<if test='gbIpAddress == null'>, gb_ip_address = null</if>" +
  255. "<if test='gbPort != null' >, gb_ip_address = #{gbPort}</if>" +
  256. "<if test='gbPort == null'>, gb_port = null</if>" +
  257. "<if test='gbPassword != null' >, gb_password = #{gbPassword}</if>" +
  258. "<if test='gbPassword == null'>, gb_password = null</if>" +
  259. "<if test='gbStatus != null' >, gb_status = #{gbStatus}</if>" +
  260. "<if test='gbStatus == null'>, gb_status = null</if>" +
  261. "<if test='gbLongitude != null' >, gb_longitude = #{gbLongitude}</if>" +
  262. "<if test='gbLongitude == null'>, gb_longitude = null</if>" +
  263. "<if test='gbLatitude != null' >, gb_latitude = #{gbLatitude}</if>" +
  264. "<if test='gbLatitude == null'>, gb_latitude = null</if>" +
  265. "<if test='gbPtzType != null' >, gb_ptz_type = #{gbPtzType}</if>" +
  266. "<if test='gbPtzType == null'>, gb_ptz_type = null</if>" +
  267. "<if test='gbPositionType != null' >, gb_position_type = #{gbPositionType}</if>" +
  268. "<if test='gbPositionType == null'>, gb_position_type = null</if>" +
  269. "<if test='gbRoomType != null' >, gb_room_type = #{gbRoomType}</if>" +
  270. "<if test='gbRoomType == null'>, gb_room_type = null</if>" +
  271. "<if test='gbUseType != null' >, gb_use_type = #{gbUseType}</if>" +
  272. "<if test='gbUseType == null'>, gb_use_type = null</if>" +
  273. "<if test='gbSupplyLightType != null' >, gb_supply_light_type = #{gbSupplyLightType}</if>" +
  274. "<if test='gbSupplyLightType == null'>, gb_supply_light_type = null</if>" +
  275. "<if test='gbDirectionType != null' >, gb_direction_type = #{gbDirectionType}</if>" +
  276. "<if test='gbDirectionType == null'>, gb_direction_type = null</if>" +
  277. "<if test='gbResolution != null' >, gb_resolution = #{gbResolution}</if>" +
  278. "<if test='gbResolution == null'>, gb_resolution = null</if>" +
  279. "<if test='gbBusinessGroupId != null' >, gb_business_group_id = #{gbBusinessGroupId}</if>" +
  280. "<if test='gbBusinessGroupId == null'>, gb_business_group_id = null</if>" +
  281. "<if test='gbDownloadSpeed != null' >, gb_download_speed = #{gbDownloadSpeed}</if>" +
  282. "<if test='gbDownloadSpeed == null'>, gb_download_speed = null</if>" +
  283. "<if test='gbSvcSpaceSupportMod != null' >, gb_svc_space_support_mod = #{gbSvcSpaceSupportMod}</if>" +
  284. "<if test='gbSvcSpaceSupportMod == null'>, gb_svc_space_support_mod = null</if>" +
  285. "<if test='gbSvcTimeSupportMode != null' >, gb_svc_time_support_mode = #{gbSvcTimeSupportMode}</if>" +
  286. "<if test='gbSvcTimeSupportMode == null'>, gb_svc_time_support_mode = null</if>" +
  287. "WHERE id = #{gbId}"+
  288. " </script>"})
  289. int update(CommonGBChannel commonGBChannel);
  290. @Update(value = {" <script>" +
  291. "UPDATE wvp_device_channel " +
  292. "SET gb_status = #{gbStatus}" +
  293. "WHERE id = #{gbId}"+
  294. " </script>"})
  295. int updateStatusById(@Param("gbId") int gbId, @Param("status") int status);
  296. @Update("<script> " +
  297. "<foreach collection='commonGBChannels' index='index' item='item' separator=';'> " +
  298. "UPDATE wvp_device_channel SET gb_status = #{gbStatus} WHERE id = #{item.gbId}" +
  299. "</foreach> " +
  300. "</script>")
  301. int updateStatusForListById(List<CommonGBChannel> commonGBChannels, @Param("status") int status);
  302. @Select(value = {" <script>" +
  303. " select\n" +
  304. " id as gb_id,\n" +
  305. " device_db_id,\n" +
  306. " stream_push_id,\n" +
  307. " stream_proxy_id,\n" +
  308. " create_time,\n" +
  309. " update_time,\n" +
  310. " sub_count,\n" +
  311. " stream_id,\n" +
  312. " has_audio,\n" +
  313. " gps_time,\n" +
  314. " stream_identification,\n" +
  315. " coalesce(gb_device_id, device_id) as gb_device_id,\n" +
  316. " coalesce(gb_name, name) as gb_name,\n" +
  317. " coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
  318. " coalesce(gb_model, model) as gb_model,\n" +
  319. " coalesce(gb_owner, owner) as gb_owner,\n" +
  320. " coalesce(gb_civil_code, civil_code) as gb_civil_code,\n" +
  321. " coalesce(gb_block, block) as gb_block,\n" +
  322. " coalesce(gb_address, address) as gb_address,\n" +
  323. " coalesce(gb_parental, parental) as gb_parental,\n" +
  324. " coalesce(gb_parent_id, parent_id) as gb_parent_id,\n" +
  325. " coalesce(gb_safety_way, safety_way) as gb_safety_way,\n" +
  326. " coalesce(gb_register_way, register_way) as gb_register_way,\n" +
  327. " coalesce(gb_cert_num, cert_num) as gb_cert_num,\n" +
  328. " coalesce(gb_certifiable, certifiable) as gb_certifiable,\n" +
  329. " coalesce(gb_err_code, err_code) as gb_err_code,\n" +
  330. " coalesce(gb_end_time, end_time) as gb_end_time,\n" +
  331. " coalesce(gb_secrecy, secrecy) as gb_secrecy,\n" +
  332. " coalesce(gb_ip_address, ip_address) as gb_ip_address,\n" +
  333. " coalesce(gb_port, port) as gb_port,\n" +
  334. " coalesce(gb_password, password) as gb_password,\n" +
  335. " coalesce(gb_status, status) as gb_status,\n" +
  336. " coalesce(gb_longitude, longitude) as gb_longitude,\n" +
  337. " coalesce(gb_latitude, latitude) as gb_latitude,\n" +
  338. " coalesce(gb_ptz_type, ptz_type) as gb_ptz_type,\n" +
  339. " coalesce(gb_position_type, position_type) as gb_position_type,\n" +
  340. " coalesce(gb_room_type, room_type) as gb_room_type,\n" +
  341. " coalesce(gb_use_type, use_type) as gb_use_type,\n" +
  342. " coalesce(gb_supply_light_type, supply_light_type) as gb_supply_light_type,\n" +
  343. " coalesce(gb_direction_type, direction_type) as gb_direction_type,\n" +
  344. " coalesce(gb_resolution, resolution) as gb_resolution,\n" +
  345. " coalesce(gb_business_group_id, business_group_id) as gb_business_group_id,\n" +
  346. " coalesce(gb_download_speed, download_speed) as gb_download_speed,\n" +
  347. " coalesce(gb_svc_space_support_mod, svc_space_support_mod) as gb_svc_space_support_mod,\n" +
  348. " coalesce(gb_svc_time_support_mode,svc_time_support_mode) as gb_svc_time_support_mode\n" +
  349. " from wvp_device_channel" +
  350. " where gb_status=#{status} and id in " +
  351. " <foreach collection='commonGBChannelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
  352. "</script>"})
  353. List<CommonGBChannel> queryInListByStatus(List<CommonGBChannel> commonGBChannelList, @Param("status") int status);
  354. @Insert(" <script>" +
  355. "INSERT INTO wvp_device_channel (" +
  356. "gb_device_id," +
  357. "stream_proxy_id, " +
  358. "stream_push_id," +
  359. "create_time," +
  360. "update_time," +
  361. "sub_count," +
  362. "stream_id," +
  363. "has_audio," +
  364. "gps_time," +
  365. "stream_identification," +
  366. "gb_name," +
  367. "gb_manufacturer," +
  368. "gb_model," +
  369. "gb_owner," +
  370. "gb_civil_code," +
  371. "gb_block," +
  372. "gb_address," +
  373. "gb_parental," +
  374. "gb_parent_id ," +
  375. "gb_safety_way," +
  376. "gb_register_way," +
  377. "gb_cert_num," +
  378. "gb_certifiable," +
  379. "gb_err_code," +
  380. "gb_end_time," +
  381. "gb_secrecy," +
  382. "gb_ip_address," +
  383. "gb_port," +
  384. "gb_password," +
  385. "gb_status," +
  386. "gb_longitude," +
  387. "gb_latitude," +
  388. "gb_ptz_type," +
  389. "gb_position_type," +
  390. "gb_room_type," +
  391. "gb_use_type," +
  392. "gb_supply_light_type," +
  393. "gb_direction_type," +
  394. "gb_resolution," +
  395. "gb_business_group_id," +
  396. "gb_download_speed," +
  397. "gb_svc_space_support_mod," +
  398. "gb_svc_time_support_mode ) " +
  399. "VALUES" +
  400. "<foreach collection='commonGBChannels' index='index' item='item' separator=','> " +
  401. "(#{item.gbDeviceId}, #{item.streamProxyId}, #{item.streamPushId},#{item.createTime},#{item.updateTime},#{item.subCount}," +
  402. "#{item.streamId},#{item.hasAudio},#{item.gpsTime},#{item.streamIdentification},#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," +
  403. "#{item.gbOwner},#{item.gbCivilCode},#{item.gbBlock}, #{item.gbAddress}, #{item.gbParental}, #{item.gbParentId},#{item.gbSafetyWay}, " +
  404. "#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," +
  405. "#{item.gbPort},#{item.gbPassword},#{item.gbStatus},#{item.gbLongitude}, #{item.gbLatitude},#{item.gbPtzType},#{item.gbPositionType},#{item.gbRoomType}," +
  406. "#{item.gbUseType},#{item.gbSupplyLightType},#{item.gbDirectionType},#{item.gbResolution},#{item.gbBusinessGroupId},#{item.gbDownloadSpeed}," +
  407. "#{item.gbSvcSpaceSupportMod},#{item.gbSvcTimeSupportMode})" +
  408. "</foreach> " +
  409. " </script>")
  410. int batchAdd(List<CommonGBChannel> commonGBChannels);
  411. @Update("<script> " +
  412. "<foreach collection='commonGBChannels' index='index' item='item' separator=';'> " +
  413. "UPDATE wvp_device_channel SET gb_status = #{item.gbStatus} WHERE id = #{item.gbId}" +
  414. "</foreach> " +
  415. "</script>")
  416. int updateStatus(List<CommonGBChannel> commonGBChannels);
  417. @Select(value = {"select\n" +
  418. " wdc.id as gb_id,\n" +
  419. " wdc.device_db_id,\n" +
  420. " wdc.create_time,\n" +
  421. " wdc.update_time,\n" +
  422. " wdc.sub_count,\n" +
  423. " wdc.stream_id,\n" +
  424. " wdc.has_audio,\n" +
  425. " wdc.gps_time,\n" +
  426. " wdc.stream_identification,\n" +
  427. " coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
  428. " coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
  429. " coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
  430. " coalesce(wdc.gb_model, wdc.model) as gb_model,\n" +
  431. " coalesce(wdc.gb_owner, wdc.owner) as gb_owner,\n" +
  432. " coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
  433. " coalesce(wdc.gb_block, wdc.block) as gb_block,\n" +
  434. " coalesce(wdc.gb_address, wdc.address) as gb_address,\n" +
  435. " coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
  436. " coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
  437. " coalesce(wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
  438. " coalesce(wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
  439. " coalesce(wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
  440. " coalesce(wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
  441. " coalesce(wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
  442. " coalesce(wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
  443. " coalesce(wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
  444. " coalesce(wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
  445. " coalesce(wdc.gb_port, wdc.port) as gb_port,\n" +
  446. " coalesce(wdc.gb_password, wdc.password) as gb_password,\n" +
  447. " coalesce(wdc.gb_status, wdc.status) as gb_status,\n" +
  448. " coalesce(wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
  449. " coalesce(wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
  450. " coalesce(wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
  451. " coalesce(wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
  452. " coalesce(wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
  453. " coalesce(wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
  454. " coalesce(wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
  455. " coalesce(wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
  456. " coalesce(wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
  457. " coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
  458. " coalesce(wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
  459. " coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
  460. " coalesce(wdc.gb_svc_time_support_mode,wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
  461. "from wvp_device_channel wdc left join wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id\n" +
  462. "where wpgc.platform_id = #{platformId}"})
  463. List<CommonGBChannel> queryByPlatformId(@Param("platformId") Integer platformId);
  464. }