| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?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.ContractMapper">
- <select id="queryPage" resultType="com.ydtech.modules.fnc.entity.ContractEntity">
- select * from
- ins_contract ic
- <where>
- <if test="vo.contractCode !=null and vo.contractCode !=''">
- and (ic.contract_code like concat('%',#{vo.contractCode},'%') or ic.contract_name 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>
- <select id="getMaxCode" resultType="java.util.HashMap">
- SELECT MAX(CAST(RIGHT(REGEXP_REPLACE(contract_code, '[^0-9]', ''), 3) AS UNSIGNED)) AS "contractCode"
- FROM ins_contract
- </select>
- <select id="copyContractCode" resultType="java.util.HashMap">
- SELECT MAX(CAST(RIGHT(REGEXP_REPLACE(contract_code, '[^0-9]', ''), 1) AS UNSIGNED)) AS "contractCode"
- FROM ins_contract
- <where>
- <if test="id !=null and id !=''">
- and parent_id =#{id}
- </if>
- </where>
- </select>
- <select id="selectFilterFailure" resultType="com.ydtech.modules.fnc.entity.ContractEntity">
- select
- ic.id as "id",
- "1" as "contractStatus"
- from
- ins_contract ic
- <where>
- ic.expiring_date is not null
- <if test="nowTime !=null and nowTime != ''">
- and ic.expiring_date < #{nowTime}
- </if>
- </where>
- </select>
- <update id="updateMapper">
- UPDATE ins_contract
- set contract_code =#{contractCode},
- contract_name =#{contractName},
- internal_company_name =#{internalCompanyName},
- internal_company_id =#{internalCompanyId},
- external_companies_name =#{externalCompaniesName},
- external_companies_id =#{externalCompaniesId},
- supplier_name =#{supplierName},
- supplier_id =#{supplierId},
- contract_type =#{contractType},
- is_open_contract =#{isOpenContract},
- should_postponed =#{shouldPostponed},
- expiration_reminder =#{expirationReminder},
- effective_date =#{effectiveDate},
- expiring_date =#{expiringDate},
- should_postponed_date =#{shouldPostponedDate},
- should_postponed_effective_date =#{shouldPostponedEffectiveDate},
- file_path_id =#{filePathId},
- extern_type =#{externType},
- internal_type =#{internalType},
- parent_id =#{parentId},
- date_time =#{dateTime},
- date_type =#{dateType}
- WHERE id = #{id};
- </update>
- </mapper>
|