|
@@ -113,21 +113,22 @@
|
|
END AS area_name,
|
|
END AS area_name,
|
|
t1.dict_label as elevatorTypeName
|
|
t1.dict_label as elevatorTypeName
|
|
from tq_contract_lift l
|
|
from tq_contract_lift l
|
|
- left join sys_user u on l.salesman = u.user_id AND l.del_flag = u.del_flag
|
|
|
|
- left join sys_user u2 on CAST(l.quoter AS SIGNED) = u2.user_id AND l.del_flag = u2.del_flag
|
|
|
|
- left join tb_agent ag on l.agent_id = ag.agent_id AND l.del_flag = ag.del_flag
|
|
|
|
- left join tc_account account on l.end_customers = account.account_id AND l.del_flag = account.del_flag
|
|
|
|
- left join tb_country country on country.country_id = l.country_id AND l.del_flag = country.del_flag
|
|
|
|
- left join tb_area area on area.area_id = l.area_id AND l.del_flag = area.del_flag
|
|
|
|
- left join sys_dict_data t1 on t1.dict_type = 'elevator_type' and l.elevator_type = t1.dict_value
|
|
|
|
- left join tq_contract contract on contract.contract_no = l.contract_no AND l.del_flag = contract.del_flag
|
|
|
|
|
|
+ LEFT JOIN sys_user u on l.salesman = u.user_id AND l.del_flag = u.del_flag
|
|
|
|
+ LEFT JOIN sys_user u2 on CAST(l.quoter AS SIGNED) = u2.user_id AND l.del_flag = u2.del_flag
|
|
|
|
+ LEFT JOIN tb_agent ag on l.agent_id = ag.agent_id AND l.del_flag = ag.del_flag
|
|
|
|
+ LEFT JOIN tc_account account on l.end_customers = account.account_id AND l.del_flag = account.del_flag
|
|
|
|
+ LEFT JOIN tb_country country on country.country_id = l.country_id AND l.del_flag = country.del_flag
|
|
|
|
+ LEFT JOIN tb_area area on area.area_id = l.area_id AND l.del_flag = area.del_flag
|
|
|
|
+ LEFT JOIN sys_dict_data t1 on t1.dict_type = 'elevator_type' and l.elevator_type = t1.dict_value
|
|
|
|
+ LEFT JOIN tq_contract contract on contract.contract_no = l.contract_no AND l.del_flag = contract.del_flag
|
|
|
|
+ LEFT JOIN (select count(*) as version,contract_no from tq_contract_history where del_flag = '0' group by contract_no) v on v.contract_no = l.contract_no
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectTqContractLiftList" resultType="com.ruoyi.project.business.domain.vo.contract.TqContractLiftVo">
|
|
<select id="selectTqContractLiftList" resultType="com.ruoyi.project.business.domain.vo.contract.TqContractLiftVo">
|
|
<include refid="selectTqContractLiftVo"/>
|
|
<include refid="selectTqContractLiftVo"/>
|
|
<where>
|
|
<where>
|
|
l.del_flag != '1'
|
|
l.del_flag != '1'
|
|
- <if test="approveStatus != null and approveStatus != ''"> and contract.approve_status = #{approveStatus}</if>
|
|
|
|
|
|
+ <if test="approveStatus != null and approveStatus != ''"> and (contract.approve_status = #{approveStatus} or CAST(SUBSTRING_INDEX(l.contract_no_version_no, '-', -1) AS UNSIGNED) < v.version)</if>
|
|
<if test="contractNo != null and contractNo != ''"> and l.contract_no like concat('%', #{contractNo}, '%')</if>
|
|
<if test="contractNo != null and contractNo != ''"> and l.contract_no like concat('%', #{contractNo}, '%')</if>
|
|
<if test="contractName != null and contractName != ''"> and l.contract_name like concat('%', #{contractName}, '%')</if>
|
|
<if test="contractName != null and contractName != ''"> and l.contract_name like concat('%', #{contractName}, '%')</if>
|
|
<if test="areaId != null and areaId.size() > 0">
|
|
<if test="areaId != null and areaId.size() > 0">
|