SensorStainingRulesConditionMapper.xml 1.6 KB

12345678910111213141516171819202122232425262728
  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.SensorStainingRulesConditionDao">
  5. <resultMap type="com.bosshand.virgo.ringzle.model.SensorStainingRulesCondition" id="sensorStainingRulesConditionResult">
  6. <id column="id" property="id"/>
  7. <result column="sensorStainingRulesId" property="sensorStainingRulesId"/>
  8. <result column="sensorId" property="sensorId"/>
  9. <result column="sensorPhysicalQuantityId" property="sensorPhysicalQuantityId"/>
  10. <result column="sensorPhysicalQuantityName" property="sensorPhysicalQuantityName"/>
  11. <result column="sensorPhysicalQuantityValue" property="sensorPhysicalQuantityValue"/>
  12. </resultMap>
  13. <insert id="save" parameterType="com.bosshand.virgo.ringzle.model.SensorStainingRulesCondition" useGeneratedKeys="true" keyProperty="id">
  14. INSERT INTO sensor_staining_rules_condition (sensorStainingRulesId,sensorId,sensorPhysicalQuantityId,sensorPhysicalQuantityName,sensorPhysicalQuantityValue)
  15. VALUES (#{sensorStainingRulesId},#{sensorId},#{sensorPhysicalQuantityId},#{sensorPhysicalQuantityName},#{sensorPhysicalQuantityValue})
  16. </insert>
  17. <delete id="delete">
  18. delete FROM sensor_staining_rules_condition where sensorStainingRulesId=#{sensorStainingRulesId}
  19. </delete>
  20. <select id="getBySensorId" resultMap="sensorStainingRulesConditionResult">
  21. select * FROM sensor_staining_rules_condition where sensorId =#{sensorId} and sensorPhysicalQuantityId =#{sensorPhysicalQuantityId}
  22. </select>
  23. </mapper>