IotEntityBimMapper.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE mapper
  2. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.bosshand.virgo.ringzle.dao.IotEntityBimDao">
  5. <resultMap type="com.bosshand.virgo.ringzle.model.IotEntityBim" id="iotEntityBimResult">
  6. <id column="id" property="id"/>
  7. <result column="iotEntityId" property="iotEntityId"/>
  8. <result column="bimId" property="bimId"/>
  9. <result column="bimIntegrateId" property="bimIntegrateId"/>
  10. <result column="bimType" property="bimType"/>
  11. <result column="bindType" property="bindType"/>
  12. <result column="data" property="data"/>
  13. </resultMap>
  14. <insert id="batchSave" parameterType="com.bosshand.virgo.ringzle.model.IotEntityBim" useGeneratedKeys="true" keyProperty="id">
  15. INSERT INTO iot_entity_bim (iotEntityId,bimIntegrateId,bimId,bimType,bindType,data) VALUES
  16. <foreach collection="list" index="index" item="item" separator=",">
  17. (#{item.iotEntityId},#{item.bimIntegrateId},#{item.bimId},#{item.bimType},#{item.bindType},#{item.data})
  18. </foreach>
  19. </insert>
  20. <select id="getList" resultMap="iotEntityBimResult">
  21. select * from iot_entity_bim
  22. <where>
  23. <if test="id != 0">
  24. and id =#{id}
  25. </if>
  26. <if test="iotEntityId != null">
  27. and iotEntityId =#{iotEntityId}
  28. </if>
  29. <if test="bimId != null">
  30. and bimId =#{bimId}
  31. </if>
  32. <if test="bimIntegrateId != null">
  33. and bimIntegrateId =#{bimIntegrateId}
  34. </if>
  35. <if test="bimType != 0">
  36. and bimType =#{bimType}
  37. </if>
  38. <if test="bindType != null">
  39. and bindType =#{bindType}
  40. </if>
  41. </where>
  42. </select>
  43. <select id="getBimId" resultMap="iotEntityBimResult">
  44. select * from iot_entity_bim where bimId =#{bimId}
  45. </select>
  46. <select id="getBimIntegrateId" resultMap="iotEntityBimResult">
  47. select * from iot_entity_bim where bimIntegrateId =#{bimIntegrateId}
  48. </select>
  49. <select id="getIotEntityBimId" resultMap="iotEntityBimResult">
  50. select * from iot_entity_bim where iotEntityId =#{iotEntityId}
  51. </select>
  52. <update id="update">
  53. update iot_entity_bim
  54. <trim prefix="set" suffixOverrides=",">
  55. <if test="iotEntityId!=null">iotEntityId=#{iotEntityId},</if>
  56. <if test="bimId!=null">bimId=#{bimId},</if>
  57. <if test="bimIntegrateId!=null">bimIntegrateId=#{bimIntegrateId},</if>
  58. <if test="bimType!=0">bimType=#{bimType},</if>
  59. <if test="bindType!=null">bindType=#{bindType},</if>
  60. <if test="data!=null">data=#{data},</if>
  61. </trim>
  62. where id=#{id}
  63. </update>
  64. <delete id="delete">
  65. delete FROM iot_entity_bim where id=#{id}
  66. </delete>
  67. </mapper>