IotWarnpolicyMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.yunfeiyun.agmp.iotm.web.mapper.IotWarnpolicyMapper">
  6. <resultMap type="IotWarnpolicy" id="IotWarnpolicyResult">
  7. <result property="id" column="id" />
  8. <result property="wpBid" column="wpBid" />
  9. <result property="wcBid" column="wcBid" />
  10. <result property="wpFrequency" column="wpFrequency" />
  11. <result property="wpType" column="wpType" />
  12. <result property="deliveryTimePeriod" column="deliveryTimePeriod" />
  13. <result property="wpChannel" column="wpChannel" />
  14. <result property="wpCreator" column="wpCreator" />
  15. <result property="wpCreateddate" column="wpCreateddate" />
  16. <result property="wpModifieddate" column="wpModifieddate" />
  17. <result property="wpModifier" column="wpModifier" />
  18. <result property="tid" column="tid" />
  19. </resultMap>
  20. <sql id="selectIotWarnpolicyVo">
  21. select id, wpBid, wcBid, wpFrequency, wpType, deliveryTimePeriod, wpChannel, wpCreator, wpCreateddate, wpModifieddate, wpModifier, tid from IotWarnpolicy
  22. </sql>
  23. <select id="selectIotWarnpolicyList" parameterType="IotWarnpolicy" resultMap="IotWarnpolicyResult">
  24. <include refid="selectIotWarnpolicyVo"/>
  25. <where>
  26. <if test="wpBid != null and wpBid != ''"> and wpBid = #{wpBid}</if>
  27. <if test="wcBid != null and wcBid != ''"> and wcBid = #{wcBid}</if>
  28. <if test="wpFrequency != null and wpFrequency != ''"> and wpFrequency = #{wpFrequency}</if>
  29. <if test="wpType != null and wpType != ''"> and wpType = #{wpType}</if>
  30. <if test="deliveryTimePeriod != null and deliveryTimePeriod != ''"> and deliveryTimePeriod = #{deliveryTimePeriod}</if>
  31. <if test="wpChannel != null and wpChannel != ''"> and wpChannel = #{wpChannel}</if>
  32. <if test="wpCreator != null and wpCreator != ''"> and wpCreator = #{wpCreator}</if>
  33. <if test="wpCreateddate != null and wpCreateddate != ''"> and wpCreateddate = #{wpCreateddate}</if>
  34. <if test="wpModifieddate != null and wpModifieddate != ''"> and wpModifieddate = #{wpModifieddate}</if>
  35. <if test="wpModifier != null and wpModifier != ''"> and wpModifier = #{wpModifier}</if>
  36. <if test="tid != null and tid != ''"> and tid = #{tid}</if>
  37. </where>
  38. </select>
  39. <select id="selectIotWarnpolicyById" parameterType="Long" resultMap="IotWarnpolicyResult">
  40. <include refid="selectIotWarnpolicyVo"/>
  41. where wpBid = #{wpBid} and tid = #{tid}
  42. </select>
  43. <insert id="insertIotWarnpolicy" parameterType="IotWarnpolicy" useGeneratedKeys="true" keyProperty="id">
  44. insert into IotWarnpolicy
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="wpBid != null">wpBid,</if>
  47. <if test="wcBid != null">wcBid,</if>
  48. <if test="wpFrequency != null">wpFrequency,</if>
  49. <if test="wpType != null">wpType,</if>
  50. <if test="deliveryTimePeriod != null">deliveryTimePeriod,</if>
  51. <if test="wpChannel != null">wpChannel,</if>
  52. <if test="wpCreator != null">wpCreator,</if>
  53. <if test="wpCreateddate != null">wpCreateddate,</if>
  54. <if test="wpModifieddate != null">wpModifieddate,</if>
  55. <if test="wpModifier != null">wpModifier,</if>
  56. <if test="tid != null and tid != ''">tid,</if>
  57. </trim>
  58. <trim prefix="values (" suffix=")" suffixOverrides=",">
  59. <if test="wpBid != null">#{wpBid},</if>
  60. <if test="wcBid != null">#{wcBid},</if>
  61. <if test="wpFrequency != null">#{wpFrequency},</if>
  62. <if test="wpType != null">#{wpType},</if>
  63. <if test="deliveryTimePeriod != null">#{deliveryTimePeriod},</if>
  64. <if test="wpChannel != null">#{wpChannel},</if>
  65. <if test="wpCreator != null">#{wpCreator},</if>
  66. <if test="wpCreateddate != null">#{wpCreateddate},</if>
  67. <if test="wpModifieddate != null">#{wpModifieddate},</if>
  68. <if test="wpModifier != null">#{wpModifier},</if>
  69. <if test="tid != null and tid != ''">#{tid},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateIotWarnpolicy" parameterType="IotWarnpolicy">
  73. update IotWarnpolicy
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="wpBid != null">wpBid = #{wpBid},</if>
  76. <if test="wcBid != null">wcBid = #{wcBid},</if>
  77. <if test="wpFrequency != null">wpFrequency = #{wpFrequency},</if>
  78. <if test="wpType != null">wpType = #{wpType},</if>
  79. <if test="deliveryTimePeriod != null">deliveryTimePeriod = #{deliveryTimePeriod},</if>
  80. <if test="wpChannel != null">wpChannel = #{wpChannel},</if>
  81. <if test="wpCreator != null">wpCreator = #{wpCreator},</if>
  82. <if test="wpCreateddate != null">wpCreateddate = #{wpCreateddate},</if>
  83. <if test="wpModifieddate != null">wpModifieddate = #{wpModifieddate},</if>
  84. <if test="wpModifier != null">wpModifier = #{wpModifier},</if>
  85. <if test="tid != null and tid != ''">tid = #{tid},</if>
  86. </trim>
  87. where wpBid = #{wpBid}
  88. </update>
  89. <delete id="deleteIotWarnpolicyByWpBid" parameterType="Long">
  90. delete from IotWarnpolicy where wpBid = #{wpBid} and tid = #{tid}
  91. </delete>
  92. <delete id="deleteIotWarnpolicyByWpBids" parameterType="String">
  93. delete from IotWarnpolicy where tid = #{tid} and wpBid in
  94. <foreach item="wpBid" collection="array" open="(" separator="," close=")">
  95. #{wpBid}
  96. </foreach>
  97. </delete>
  98. </mapper>