IotWarnconfigMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.IotWarnconfigMapper">
  6. <resultMap type="IotWarnconfig" id="IotWarnconfigResult">
  7. <result property="id" column="id" />
  8. <result property="wcBid" column="wcBid" />
  9. <result property="wcName" column="wcName" />
  10. <result property="wcDesc" column="wcDesc" />
  11. <result property="wcStatus" column="wcStatus" />
  12. <result property="wcLevel" column="wcLevel" />
  13. <result property="wcTouchtype" column="wcTouchtype" />
  14. <result property="wcCondition" column="wcCondition" />
  15. <result property="wcRepeatnum" column="wcRepeatnum" />
  16. <result property="wcCreator" column="wcCreator" />
  17. <result property="wcCreateddate" column="wcCreateddate" />
  18. <result property="wcModifieddate" column="wcModifieddate" />
  19. <result property="wcModifier" column="wcModifier" />
  20. <result property="tid" column="tid" />
  21. </resultMap>
  22. <sql id="selectIotWarnconfigVo">
  23. select id, wcBid, wcName, wcDesc, wcStatus, wcLevel, wcTouchtype, wcCondition,wcRepeatnum, wcCreator, wcCreateddate, wcModifieddate, wcModifier, tid from IotWarnconfig
  24. </sql>
  25. <select id="selectIotWarnconfigList" parameterType="IotWarnconfig" resultMap="IotWarnconfigResult">
  26. <include refid="selectIotWarnconfigVo"/>
  27. <where>
  28. <if test="wcBid != null and wcBid != ''"> and wcBid = #{wcBid}</if>
  29. <if test="wcName != null and wcName != ''"> and wcName like concat('%', #{wcName}, '%')</if>
  30. <if test="wcDesc != null and wcDesc != ''"> and wcDesc = #{wcDesc}</if>
  31. <if test="wcStatus != null and wcStatus != ''"> and wcStatus = #{wcStatus}</if>
  32. <if test="wcLevel != null and wcLevel != ''"> and wcLevel = #{wcLevel}</if>
  33. <if test="wcTouchtype != null and wcTouchtype != ''"> and wcTouchtype = #{wcTouchtype}</if>
  34. <if test="wcCondition != null and wcCondition != ''"> and wcCondition = #{wcCondition}</if>
  35. <if test="wcRepeatnum != null and wcRepeatnum != ''"> and wcRepeatnum = #{wcRepeatnum}</if>
  36. <if test="wcCreator != null and wcCreator != ''"> and wcCreator = #{wcCreator}</if>
  37. <if test="wcCreateddate != null and wcCreateddate != ''"> and wcCreateddate = #{wcCreateddate}</if>
  38. <if test="wcModifieddate != null and wcModifieddate != ''"> and wcModifieddate = #{wcModifieddate}</if>
  39. <if test="wcModifier != null and wcModifier != ''"> and wcModifier = #{wcModifier}</if>
  40. <if test="tid != null and tid != ''"> and tid = #{tid}</if>
  41. </where>
  42. </select>
  43. <select id="selectIotWarnconfigByWcBid" parameterType="Long" resultMap="IotWarnconfigResult">
  44. <include refid="selectIotWarnconfigVo"/>
  45. where wcBid = #{wcBid} and tid = #{tid}
  46. </select>
  47. <insert id="insertIotWarnconfig" parameterType="IotWarnconfig" useGeneratedKeys="true" keyProperty="id">
  48. insert into IotWarnconfig
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="wcBid != null">wcBid,</if>
  51. <if test="wcName != null">wcName,</if>
  52. <if test="wcDesc != null">wcDesc,</if>
  53. <if test="wcStatus != null">wcStatus,</if>
  54. <if test="wcLevel != null">wcLevel,</if>
  55. <if test="wcTouchtype != null">wcTouchtype,</if>
  56. <if test="wcCondition != null">wcCondition,</if>
  57. <if test="wcRepeatnum != null">wcRepeatnum,</if>
  58. <if test="wcCreator != null">wcCreator,</if>
  59. <if test="wcCreateddate != null">wcCreateddate,</if>
  60. <if test="wcModifieddate != null">wcModifieddate,</if>
  61. <if test="wcModifier != null">wcModifier,</if>
  62. <if test="tid != null and tid != ''">tid,</if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="wcBid != null">#{wcBid},</if>
  66. <if test="wcName != null">#{wcName},</if>
  67. <if test="wcDesc != null">#{wcDesc},</if>
  68. <if test="wcStatus != null">#{wcStatus},</if>
  69. <if test="wcLevel != null">#{wcLevel},</if>
  70. <if test="wcTouchtype != null">#{wcTouchtype},</if>
  71. <if test="wcCondition != null">#{wcCondition},</if>
  72. <if test="wcRepeatnum != null">#{wcRepeatnum},</if>
  73. <if test="wcCreator != null">#{wcCreator},</if>
  74. <if test="wcCreateddate != null">#{wcCreateddate},</if>
  75. <if test="wcModifieddate != null">#{wcModifieddate},</if>
  76. <if test="wcModifier != null">#{wcModifier},</if>
  77. <if test="tid != null and tid != ''">#{tid},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateIotWarnconfig" parameterType="IotWarnconfig">
  81. update IotWarnconfig
  82. <trim prefix="SET" suffixOverrides=",">
  83. <if test="wcBid != null">wcBid = #{wcBid},</if>
  84. <if test="wcName != null">wcName = #{wcName},</if>
  85. <if test="wcDesc != null">wcDesc = #{wcDesc},</if>
  86. <if test="wcStatus != null">wcStatus = #{wcStatus},</if>
  87. <if test="wcLevel != null">wcLevel = #{wcLevel},</if>
  88. <if test="wcTouchtype != null">wcTouchtype = #{wcTouchtype},</if>
  89. <if test="wcCondition != null">wcCondition = #{wcCondition},</if>
  90. <if test="wcRepeatnum != null">wcRepeatnum = #{wcRepeatnum},</if>
  91. <if test="wcCreator != null">wcCreator = #{wcCreator},</if>
  92. <if test="wcCreateddate != null">wcCreateddate = #{wcCreateddate},</if>
  93. <if test="wcModifieddate != null">wcModifieddate = #{wcModifieddate},</if>
  94. <if test="wcModifier != null">wcModifier = #{wcModifier},</if>
  95. <if test="tid != null and tid != ''">tid = #{tid},</if>
  96. </trim>
  97. where wcBid = #{wcBid}
  98. </update>
  99. <delete id="deleteIotWarnconfigByWcBid" parameterType="java.lang.String">
  100. delete from IotWarnconfig where wcBid = #{wcBid} and tid = #{tid}
  101. </delete>
  102. <delete id="deleteIotWarnconfigWcBids" parameterType="String">
  103. delete from IotWarnconfig where tid = #{tid} and wcBid in
  104. <foreach item="wcBid" collection="array" open="(" separator="," close=")">
  105. #{wcBid}
  106. </foreach>
  107. </delete>
  108. </mapper>