ChannelNumberMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.ruoyi.manage.mapper.ChannelNumberMapper">
  6. <resultMap type="ChannelNumber" id="ChannelNumberResult">
  7. <result property="channelId" column="channel_id" />
  8. <result property="equipmentId" column="equipment_id" />
  9. <result property="equipmentNum" column="equipment_num" />
  10. <result property="equipmentName" column="equipment_name" />
  11. <result property="channelNum" column="channel_num" />
  12. <result property="port" column="port" />
  13. <result property="videoAddress" column="video_address" />
  14. <result property="account" column="account" />
  15. <result property="password" column="password" />
  16. <result property="protocolType" column="protocol_type" />
  17. <result property="channelDetails" column="channel_details" />
  18. <result property="delFlag" column="del_flag" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="remark" column="remark" />
  24. </resultMap>
  25. <sql id="selectChannelNumberVo">
  26. select channel_id, channel_num,equipment_id, equipment_num, equipment_name, video_address,port, account,password,protocol_type, channel_details, del_flag, create_by, create_time, update_by, update_time, remark from channel_number
  27. </sql>
  28. <select id="selectChannelNumberList" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
  29. <include refid="selectChannelNumberVo"/>
  30. <where>
  31. <if test="equipmentNum != null and equipmentNum != ''"> and equipment_num like concat('%', #{equipmentNum}, '%')</if>
  32. <if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
  33. <if test="channelNum != null and channelNum != ''"> and channel_num = #{channelNum}</if>
  34. <if test="videoAddress != null and videoAddress != ''"> and video_address = #{videoAddress}</if>
  35. <if test="protocolType != null and protocolType != ''"> and protocol_type = #{protocolType}</if>
  36. <if test="channelDetails != null and channelDetails != ''"> and channel_details = #{channelDetails}</if>
  37. </where>
  38. </select>
  39. <select id="selectChannelNumberByChannelId" parameterType="Long" resultMap="ChannelNumberResult">
  40. <include refid="selectChannelNumberVo"/>
  41. where channel_id = #{channelId}
  42. </select>
  43. <insert id="insertChannelNumber" parameterType="ChannelNumber" useGeneratedKeys="true" keyProperty="channelId">
  44. insert into channel_number
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="equipmentId != null">equipment_id,</if>
  47. <if test="equipmentNum != null">equipment_num,</if>
  48. <if test="equipmentName != null">equipment_name,</if>
  49. <if test="channelNum != null">channel_num,</if>
  50. <if test="videoAddress != null">video_address,</if>
  51. <if test="account != null">account,</if>
  52. <if test="port != null">port,</if>
  53. <if test="password != null">password,</if>
  54. <if test="protocolType != null">protocol_type,</if>
  55. <if test="channelDetails != null">channel_details,</if>
  56. <if test="delFlag != null">del_flag,</if>
  57. <if test="createBy != null">create_by,</if>
  58. <if test="createTime != null">create_time,</if>
  59. <if test="updateBy != null">update_by,</if>
  60. <if test="updateTime != null">update_time,</if>
  61. <if test="remark != null">remark,</if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides=",">
  64. <if test="equipmentId != null">#{equipmentId},</if>
  65. <if test="equipmentNum != null">#{equipmentNum},</if>
  66. <if test="equipmentName != null">#{equipmentName},</if>
  67. <if test="channelNum != null">#{channelNum},</if>
  68. <if test="videoAddress != null">#{videoAddress},</if>
  69. <if test="account != null">#{account},</if>
  70. <if test="port != null">#{port},</if>
  71. <if test="password != null">#{password},</if>
  72. <if test="protocolType != null">#{protocolType},</if>
  73. <if test="channelDetails != null">#{channelDetails},</if>
  74. <if test="delFlag != null">#{delFlag},</if>
  75. <if test="createBy != null">#{createBy},</if>
  76. <if test="createTime != null">#{createTime},</if>
  77. <if test="updateBy != null">#{updateBy},</if>
  78. <if test="updateTime != null">#{updateTime},</if>
  79. <if test="remark != null">#{remark},</if>
  80. </trim>
  81. </insert>
  82. <update id="updateChannelNumber" parameterType="ChannelNumber">
  83. update channel_number
  84. <trim prefix="SET" suffixOverrides=",">
  85. <if test="equipmentId != null">equipment_id = #{equipmentId},</if>
  86. <if test="equipmentNum != null">equipment_num = #{equipmentNum},</if>
  87. <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
  88. <if test="channelNum != null">channel_num = #{channelNum},</if>
  89. <if test="videoAddress != null">video_address = #{videoAddress},</if>
  90. <if test="account != null">account = #{account},</if>
  91. <if test="port != null">port = #{port},</if>
  92. <if test="password != null">password = #{password},</if>
  93. <if test="protocolType != null">protocol_type = #{protocolType},</if>
  94. <if test="channelDetails != null">channel_details = #{channelDetails},</if>
  95. <if test="delFlag != null">del_flag = #{delFlag},</if>
  96. <if test="createBy != null">create_by = #{createBy},</if>
  97. <if test="createTime != null">create_time = #{createTime},</if>
  98. <if test="updateBy != null">update_by = #{updateBy},</if>
  99. <if test="updateTime != null">update_time = #{updateTime},</if>
  100. <if test="remark != null">remark = #{remark},</if>
  101. </trim>
  102. where channel_id = #{channelId}
  103. </update>
  104. <delete id="deleteChannelNumberByChannelId" parameterType="Long">
  105. delete from channel_number where channel_id = #{channelId}
  106. </delete>
  107. <delete id="deleteChannelNumberByChannelIds" parameterType="String">
  108. delete from channel_number where channel_id in
  109. <foreach item="channelId" collection="array" open="(" separator="," close=")">
  110. #{channelId}
  111. </foreach>
  112. </delete>
  113. </mapper>