| 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.TenancyDao">
- <select id="findDueTenancy" resultType="platform.modules.build.entity.Tenancy"
- parameterType="platform.modules.build.DTO.TenancyDto">
- SELECT * FROM y_contract_tenancy 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.status=0 and t.is_effect=1
- 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>
- <select id="isExistPayTime" resultType="Integer">
- SELECT count(id) FROM y_contract_tenancy t WHERE t.pay_time = #{pay_time} and contract_id=#{contract_id}
- </select>
-
- <select id="findLastTenancyByContractNo" resultType="platform.modules.build.entity.Tenancy">
- SELECT * FROM y_contract_tenancy t
- WHERE
- t.del_flag = '0'
- and t.contract_no = #{contract_no}
- and t.del_flag=0
- order by t.period desc limit 1
- </select>
-
- <update id="deleteByContractId">
- update y_contract_tenancy set del_flag=1
- where contract_id=#{contract_id}
- </update>
-
- </mapper>
|