| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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="com.ydtech.modules.fnc.dao.contract.ContractSupplierMapper">
- <delete id="deleteBySupplierIds">
- delete from ins_contract_supplier
- <where>
- <if test="supplierIdList != null and supplierIdList != '' and supplierIdList.size() > 0">
- and supplier_id in
- <foreach collection="supplierIdList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="id !=null and id !=''">
- and contract_id =#{id}
- </if>
- </where>
- </delete>
- <select id="selectByContractId" resultType="com.ydtech.modules.fnc.entity.ContractSupplierEntity">
- select
- ics.id as "id",
- ics.supplier_id as "supplierId",
- ics.contract_id as "contractId",
- ics.create_time as "createTime",
- ics.dept_id as "deptId",
- ics.user_id as "userId",
- eic.namesimple as "namesimple"
- from ins_contract_supplier ics
- left join esm_ins_company eic on eic.id =ics.supplier_id
- <where>
- <if test="id != null and id !=''">
- and ics.contract_id =#{id}
- </if>
- </where>
- </select>
- <select id="selecSupplierList" resultType="com.ydtech.modules.fnc.entity.ContractSupplierEntity">
- select
- ics.id as "id",
- ics.supplier_id as "supplierId",
- ics.contract_id as "contractId",
- ics.create_time as "createTime",
- ics.dept_id as "deptId",
- ics.user_id as "userId",
- eic.namesimple as "namesimple"
- from ins_contract_supplier ics
- left join esm_ins_company eic on eic.id =ics.supplier_id
- <where>
- <if test="id != null and id !=''">
- and ics.contract_id =#{id}
- </if>
- <if test="supplierIdList != null and supplierIdList !='' and supplierIdList.size()>0 ">
- and ics.supplierId IN
- <foreach collection="supplierIdList" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- </where>
- </select>
- <select id="queryPage" resultType="com.ydtech.modules.fnc.dto.contract.ContractDto">
- select
- ics.supplier_id as "supplierId",
- eic.namesimple as "namesimple",
- ic.contract_code as "contractCode",
- ic.contract_name as "contractName",
- ic.contract_type as "contractType",
- ic.internal_company_id as "internalCompanyId",
- ic.internal_company_name as "internalCompanyName",
- ic.external_companies_name as "externalCompaniesName",
- ic.external_companies_id as "externalCompaniesId",
- ic.extern_type as "externType",
- ic.internal_type as "internalType",
- ic.is_open_contract as "isOpenContract",
- ic.effective_date as "effectiveDate",
- ic.expiring_date as "expiringDate",
- ic.should_postponed_effective_date as "shouldPostponedEffectiveDate",
- ic.id as "id"
- from ins_contract_supplier ics
- left join esm_ins_company eic on eic.id =ics.supplier_id
- left join ins_contract ic on ic.id =ics.contract_id
- <where>
- <if test="vo.contractCode !=null and vo.contractCode !=''">
- and ic.contract_code like concat('%',#{vo.contractCode},'%')
- </if>
- <if test="vo.contractIdList != null and vo.contractIdList !='' and vo.contractIdList.size()>0 ">
- and ic.id IN
- <foreach collection="vo.contractIdList" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="vo.contractName !=null and vo.contractName !=''">
- and ic.contract_name =#{vo.contractName}
- </if>
- <if test="vo.internalCompanyId !=null and vo.internalCompanyId !=''">
- and ic.internal_company_id =#{vo.internalCompanyId}
- </if>
- <if test="vo.externalCompaniesId !=null and vo.externalCompaniesId !=''">
- and ic.external_companies_id =#{vo.externalCompaniesId}
- </if>
- <if test="vo.supplierId !=null and vo.supplierId !=''">
- and ic.supplier_id =#{vo.supplierId}
- </if>
- <if test="vo.contractType !=null and vo.contractType !=''">
- and ic.contract_type =#{vo.contractType}
- </if>
- <if test="vo.contractStatus !=null and vo.contractStatus !='' and vo.contractStatus !='all'">
- and ic.contract_status =#{vo.contractStatus}
- </if>
- </where>
- </select>
- </mapper>
|