IPage<ContractSynopsisVo> findContractList(@Param("toPage") IPage<ContractListConditionDto> toPage,
@Param("dto") ContractListConditionDto contractListConditionDto);
<select id="findContractList" resultType="com.tgchina.server.contract.module.approach.vo.ContractSynopsisVo">
select c.contract_id,
c.contract_name,
c.contract_code,
c.customer_id,
c.customer_name,
c.project_id,
c.operation_manager,
c.paper_archive_state,
c.electronic_archive_state
from tb_ct_contract as c left join tb_ct_contract_coordination tccc on c.contract_id = tccc.contract_id
<where>
c.is_delete = 0
and c.auth_state = 4
<if test="dto.viewType != null and dto.viewType == 2">
and ( c.operation_manager = #{dto.operationManager} or tccc.collaborative_business_user_id = #{dto.operationManager})
</if>
<if test="dto.orgId != null and dto.orgId != ''">
and c.org_id = #{dto.orgId}
</if>
<if test="dto.deptIdList != null and dto.deptIdList.size() != 0">
and c.dept_id in
<foreach close=")" collection="dto.deptIdList" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="dto.condition != null and dto.condition != ''">
and (c.contract_name like concat('%', #{dto.condition}, '%') or
c.contract_code like concat('%', #{dto.condition}, '%') or
c.project_name like concat('%', #{dto.condition}, '%') or
c.customer_name like concat('%', #{dto.condition}, '%'))
</if>
</where>
order by c.update_time desc
</select>