| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="platform.modules.build.dao.ContractPropertyDao">
- <select id="findLatestByContractId" resultType="platform.modules.build.entity.ContractProperty">
- SELECT * FROM y_contract_property u WHERE u.contract_id = #{contract_id}
- and u.fee_type = #{fee_type} and u.del_flag=0
- order by u.create_time desc ,pay_time desc limit 1
- </select>
-
- <select id="findDueProperty" resultType="platform.modules.build.entity.ContractProperty"
- parameterType="platform.modules.build.DTO.PropertyDto">
- SELECT
- t.*,
- (t.price*t.number*t.payment_cycle) as total_fee
- FROM y_contract_property t
- left join y_contract contract on t.contract_id=contract.id
- WHERE
- contract.del_flag = '0'
- and t.build_id = #{build_id}
- and t.del_flag=0 and t.actural_paid_date is null
- and datediff( t.pay_time,curdate()) <= contract.remind_day
- <if test="company_id!=null">
- and t.company_id=#{company_id}
- </if>
- order by t.pay_time limit #{count}
- </select>
- <update id="deleteByContractId">
- update y_contract_property set del_flag=1
- where contract_id=#{contract_id} and fee_type=#{type}
- </update>
- <select id="isExistPayTime" resultType="Integer">
- SELECT count(id) FROM y_contract_property property
- WHERE property.pay_time = #{pay_time} and property.contract_no=#{contract_no}
- and property.fee_type = #{fee_type}
- </select>
-
- </mapper>
|