ChannelNumberMapper.xml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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="channelNum" column="channel_num" />
  9. <result property="videoAddress" column="video_address" />
  10. <result property="protocolType" column="protocol_type" />
  11. <result property="channelDetails" column="channel_details" />
  12. <result property="delFlag" column="del_flag" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="remark" column="remark" />
  18. </resultMap>
  19. <sql id="selectChannelNumberVo">
  20. select channel_id, channel_num, video_address, protocol_type, channel_details, del_flag, create_by, create_time, update_by, update_time, remark from channel_number
  21. </sql>
  22. <select id="selectChannelNumberList" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
  23. <include refid="selectChannelNumberVo"/>
  24. <where>
  25. <if test="channelNum != null and channelNum != ''"> and channel_num = #{channelNum}</if>
  26. <if test="videoAddress != null and videoAddress != ''"> and video_address = #{videoAddress}</if>
  27. <if test="protocolType != null and protocolType != ''"> and protocol_type = #{protocolType}</if>
  28. <if test="channelDetails != null and channelDetails != ''"> and channel_details = #{channelDetails}</if>
  29. </where>
  30. </select>
  31. <select id="selectChannelNumberByChannelId" parameterType="Long" resultMap="ChannelNumberResult">
  32. <include refid="selectChannelNumberVo"/>
  33. where channel_id = #{channelId}
  34. </select>
  35. <insert id="insertChannelNumber" parameterType="ChannelNumber" useGeneratedKeys="true" keyProperty="channelId">
  36. insert into channel_number
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="channelNum != null">channel_num,</if>
  39. <if test="videoAddress != null">video_address,</if>
  40. <if test="protocolType != null">protocol_type,</if>
  41. <if test="channelDetails != null">channel_details,</if>
  42. <if test="delFlag != null">del_flag,</if>
  43. <if test="createBy != null">create_by,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="updateBy != null">update_by,</if>
  46. <if test="updateTime != null">update_time,</if>
  47. <if test="remark != null">remark,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="channelNum != null">#{channelNum},</if>
  51. <if test="videoAddress != null">#{videoAddress},</if>
  52. <if test="protocolType != null">#{protocolType},</if>
  53. <if test="channelDetails != null">#{channelDetails},</if>
  54. <if test="delFlag != null">#{delFlag},</if>
  55. <if test="createBy != null">#{createBy},</if>
  56. <if test="createTime != null">#{createTime},</if>
  57. <if test="updateBy != null">#{updateBy},</if>
  58. <if test="updateTime != null">#{updateTime},</if>
  59. <if test="remark != null">#{remark},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateChannelNumber" parameterType="ChannelNumber">
  63. update channel_number
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="channelNum != null">channel_num = #{channelNum},</if>
  66. <if test="videoAddress != null">video_address = #{videoAddress},</if>
  67. <if test="protocolType != null">protocol_type = #{protocolType},</if>
  68. <if test="channelDetails != null">channel_details = #{channelDetails},</if>
  69. <if test="delFlag != null">del_flag = #{delFlag},</if>
  70. <if test="createBy != null">create_by = #{createBy},</if>
  71. <if test="createTime != null">create_time = #{createTime},</if>
  72. <if test="updateBy != null">update_by = #{updateBy},</if>
  73. <if test="updateTime != null">update_time = #{updateTime},</if>
  74. <if test="remark != null">remark = #{remark},</if>
  75. </trim>
  76. where channel_id = #{channelId}
  77. </update>
  78. <delete id="deleteChannelNumberByChannelId" parameterType="Long">
  79. delete from channel_number where channel_id = #{channelId}
  80. </delete>
  81. <delete id="deleteChannelNumberByChannelIds" parameterType="String">
  82. delete from channel_number where channel_id in
  83. <foreach item="channelId" collection="array" open="(" separator="," close=")">
  84. #{channelId}
  85. </foreach>
  86. </delete>
  87. </mapper>