ElectricFeeDao.xml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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="platform.modules.build.dao.ElectricFeeDao">
  4. <select id="findDueElectricFee" resultType="platform.modules.build.entity.ElectricFee"
  5. parameterType="platform.modules.build.DTO.ElectricWaterDto">
  6. SELECT * FROM y_electric_fee t
  7. WHERE
  8. t.build_id = #{build_id}
  9. and t.del_flag=0 and (t.status=0 or t.status is null)
  10. <if test="company_id!=null">
  11. and t.company_id=#{company_id}
  12. </if>
  13. order by t.create_time limit #{count}
  14. </select>
  15. <select id="getLastPeriod" resultType="Integer">
  16. SELECT t.current_period FROM y_electric_fee t WHERE t.company_id = #{company_id}
  17. and t.del_flag=0
  18. order by t.current_period desc limit 1
  19. </select>
  20. <select id="getBeforeReadByCompanyId" resultType="platform.modules.build.entity.ElectricFee">
  21. SELECT * FROM y_electric_fee t WHERE t.company_id = #{company_id}
  22. and t.del_flag=0
  23. order by create_time desc limit 1
  24. </select>
  25. <select id="getByCompanyIdAndRecordId" resultType="platform.modules.build.entity.ElectricFee">
  26. SELECT t.* FROM y_electric_fee t WHERE t.company_id = #{company_id}
  27. and t.del_flag=0 and t.record_id=#{record_id}
  28. </select>
  29. </mapper>