DeviceMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.zoniot.wg.dao.DeviceMapper">
  4. <select id="findDeviceIdByWaterMeterNo" resultType="java.lang.Long">
  5. select id from sc_device where status = 1 and customer_id = #{customerId} and water_meter_no = #{meterNo}
  6. </select>
  7. <!--auto generated Code-->
  8. <update id="updateByPrimaryKeySelective">
  9. UPDATE sc_device
  10. <set>
  11. <if test="device.deviceNo != null"> device_no = #{device.deviceNo,jdbcType=VARCHAR},</if>
  12. <if test="device.deviceType != null"> device_type = #{device.deviceType,jdbcType=BIGINT},</if>
  13. <if test="device.sysId != null"> sys_id = #{device.sysId,jdbcType=BIGINT},</if>
  14. <if test="device.siteId != null"> site_id = #{device.siteId,jdbcType=BIGINT},</if>
  15. <if test="device.buildingId != null"> building_id = #{device.buildingId,jdbcType=BIGINT},</if>
  16. <if test="device.floor != null"> `floor` = #{device.floor,jdbcType=INTEGER},</if>
  17. <if test="device.locDesc != null"> loc_desc = #{device.locDesc,jdbcType=VARCHAR},</if>
  18. <if test="device.relatedDeviceNo != null"> related_device_no = #{device.relatedDeviceNo,jdbcType=BIGINT},</if>
  19. <if test="device.manufacturerId != null"> manufacturer_id = #{device.manufacturerId,jdbcType=BIGINT},</if>
  20. <if test="device.deviceStatus != null"> device_status = #{device.deviceStatus,jdbcType=INTEGER},</if>
  21. <if test="device.status != null"> `status` = #{device.status,jdbcType=INTEGER},</if>
  22. <if test="device.isTag != null"> is_tag = #{device.isTag,jdbcType=INTEGER},</if>
  23. <if test="device.xCoordinates != null"> x_coordinates = #{device.xCoordinates,jdbcType=DECIMAL},</if>
  24. <if test="device.yCoordinates != null"> y_coordinates = #{device.yCoordinates,jdbcType=DECIMAL},</if>
  25. <if test="device.updateBy != null"> update_by = #{device.updateBy,jdbcType=VARCHAR},</if>
  26. <if test="device.dateUpdate != null"> date_update = #{device.dateUpdate,jdbcType=TIMESTAMP},</if>
  27. <if test="device.planId != null"> plan_id = #{device.planId,jdbcType=INTEGER},</if>
  28. <if test="device.waterMeterNo != null"> water_meter_no = #{device.waterMeterNo,jdbcType=VARCHAR},</if>
  29. <if test="device.waterMeterFileNo != null"> water_meter_file_no = #{device.waterMeterFileNo,jdbcType=VARCHAR},</if>
  30. <if test="device.customerId != null"> customer_id = #{device.customerId,jdbcType=INTEGER},</if>
  31. <if test="device.udipId != null"> udip_id = #{device.udipId,jdbcType=VARCHAR},</if>
  32. <if test="device.registerStatus != null"> register_status = #{device.registerStatus,jdbcType=INTEGER},</if>
  33. <if test="device.syncStatus != null"> sync_status = #{device.syncStatus,jdbcType=INTEGER},</if>
  34. <if test="device.sealNo != null"> seal_no = #{device.sealNo,jdbcType=VARCHAR}</if>
  35. </set>
  36. WHERE id = #{device.id,jdbcType=BIGINT}
  37. </update>
  38. </mapper>