| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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>
- </mapper>
|