IotWarnreceiverMapper.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.IotWarnreceiverMapper">
  6. <resultMap type="IotWarnreceiver" id="IotWarnreceiverResult">
  7. <result property="id" column="id" />
  8. <result property="wrBid" column="wrBid" />
  9. <result property="wcBid" column="wcBid" />
  10. <result property="wruserId" column="wruserId" />
  11. <result property="tid" column="tid" />
  12. </resultMap>
  13. <sql id="selectIotWarnreceiverVo">
  14. select id, wrBid, wcBid, wruserId, tid from IotWarnreceiver
  15. </sql>
  16. <select id="selectIotWarnreceiverList" parameterType="IotWarnreceiver" resultMap="IotWarnreceiverResult">
  17. <include refid="selectIotWarnreceiverVo"/>
  18. <where>
  19. <if test="wrBid != null and wrBid != ''"> and wrBid = #{wrBid}</if>
  20. <if test="wcBid != null and wcBid != ''"> and wcBid = #{wcBid}</if>
  21. <if test="wruserId != null and wruserId != ''"> and wruserId = #{wruserId}</if>
  22. <if test="tid != null and tid != ''"> and tid = #{tid}</if>
  23. </where>
  24. </select>
  25. <select id="selectIotWarnreceiverByWrBid" parameterType="Long" resultMap="IotWarnreceiverResult">
  26. <include refid="selectIotWarnreceiverVo"/>
  27. where wrBid = #{wrBid} and tid = #{tid}
  28. </select>
  29. <select id="selectIotWarnreceiversByWcBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotWarnreceiver">
  30. SELECT *
  31. FROM IotWarnreceiver
  32. WHERE wcBid = #{wcBid}
  33. </select>
  34. <insert id="insertIotWarnreceiver" parameterType="IotWarnreceiver" useGeneratedKeys="true" keyProperty="id">
  35. insert into IotWarnreceiver
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="wrBid != null">wrBid,</if>
  38. <if test="wcBid != null">wcBid,</if>
  39. <if test="wruserId != null">wruserId,</if>
  40. <if test="tid != null and tid != ''">tid,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="wrBid != null">#{wrBid},</if>
  44. <if test="wcBid != null">#{wcBid},</if>
  45. <if test="wruserId != null">#{wruserId},</if>
  46. <if test="tid != null and tid != ''">#{tid},</if>
  47. </trim>
  48. </insert>
  49. <update id="updateIotWarnreceiver" parameterType="IotWarnreceiver">
  50. update IotWarnreceiver
  51. <trim prefix="SET" suffixOverrides=",">
  52. <if test="wrBid != null">wrBid = #{wrBid},</if>
  53. <if test="wcBid != null">wcBid = #{wcBid},</if>
  54. <if test="wruserId != null">wruserId = #{wruserId},</if>
  55. <if test="tid != null and tid != ''">tid = #{tid},</if>
  56. </trim>
  57. where wrBid = #{wrBid}
  58. </update>
  59. <delete id="deleteIotWarnreceiverByWrBid" >
  60. delete from IotWarnreceiver where wrBid = #{wrBid} and tid = #{tid}
  61. </delete>
  62. <delete id="deleteIotWarnreceiverByWrBids" parameterType="String">
  63. delete from IotWarnreceiver where tid = #{tid} and wrBid in
  64. <foreach item="wrBid" collection="array" open="(" separator="," close=")">
  65. #{wrBid}
  66. </foreach>
  67. </delete>
  68. <delete id="deleteIotWarnreceiverByWcBid">
  69. delete from IotWarnreceiver where wcBid = #{wcBid}
  70. </delete>
  71. </mapper>