IotWarnconfigMapper.xml 6.0 KB

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