|
@@ -4,21 +4,10 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei365.manager.dao.providers.CmProvidersContractMapper">
|
|
|
|
|
|
- <resultMap type="CmProvidersContract" id="CmProvidersContractResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="providersId" column="providersId" />
|
|
|
- <result property="contractId" column="contractId" />
|
|
|
- <result property="contractStartDate" column="contractStartDate" />
|
|
|
- <result property="contractEndDate" column="contractEndDate" />
|
|
|
- <result property="createBy" column="createBy" />
|
|
|
- <result property="updateTime" column="updateTime" />
|
|
|
- <result property="createTime" column="createTime" />
|
|
|
- </resultMap>
|
|
|
-
|
|
|
<sql id="selectCmProvidersContractVo">
|
|
|
select
|
|
|
cm_providers_contract.id,
|
|
|
- cm_providers_contract.providersId,
|
|
|
+ cm_providers_contract.providersId as serviceProviderId,
|
|
|
cm_providers_contract.contractId,
|
|
|
cm_providers_contract.contractStartDate,
|
|
|
cm_providers_contract.contractEndDate,
|
|
@@ -27,26 +16,34 @@
|
|
|
cm_providers_contract.createTime
|
|
|
</sql>
|
|
|
|
|
|
- <select id="getByCmProvidersContract" parameterType="CmProvidersContract" resultMap="CmProvidersContractResult">
|
|
|
- <include refid="selectCmProvidersContractVo"/>
|
|
|
- from cm_providers_contract AS cm_providers_contract
|
|
|
+ <select id="getByCmProvidersContract" parameterType="CmProvidersContract" resultType="com.caimei365.manager.entity.caimei.providers.CmProvidersContract">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ providersId as serviceProviderId,
|
|
|
+ contractId,
|
|
|
+ contractStartDate,
|
|
|
+ contractEndDate,
|
|
|
+ createBy,
|
|
|
+ updateTime,
|
|
|
+ createTime
|
|
|
+ from cm_providers_contract
|
|
|
<where>
|
|
|
- <if test="id != null and id != ''"> and cm_providers_contract.id = #{id}</if>
|
|
|
- <if test="providersId != null "> and cm_providers_contract.providersId = #{providersId}</if>
|
|
|
- <if test="contractId != null and contractId != ''"> and cm_providers_contract.contractId = #{contractId}</if>
|
|
|
- <if test="contractStartDate != null "> and cm_providers_contract.contractStartDate = #{contractStartDate}</if>
|
|
|
- <if test="contractEndDate != null "> and cm_providers_contract.contractEndDate = #{contractEndDate}</if>
|
|
|
+ <if test="id != null and id != ''"> and id = #{id}</if>
|
|
|
+ <if test="serviceProviderId != null "> and providersId = #{serviceProviderId}</if>
|
|
|
+ <if test="contractId != null and contractId != ''"> and contractId = #{contractId}</if>
|
|
|
+ <if test="contractStartDate != null "> and contractStartDate = #{contractStartDate}</if>
|
|
|
+ <if test="contractEndDate != null "> and contractEndDate = #{contractEndDate}</if>
|
|
|
</where>
|
|
|
group by cm_providers_contract.id
|
|
|
limit 0,1
|
|
|
</select>
|
|
|
|
|
|
- <select id="getCmProvidersContractList" parameterType="CmProvidersContract" resultMap="CmProvidersContractResult">
|
|
|
+ <select id="getCmProvidersContractList" parameterType="CmProvidersContract" resultType="com.caimei365.manager.entity.caimei.providers.CmProvidersContract">
|
|
|
<include refid="selectCmProvidersContractVo"/>
|
|
|
from cm_providers_contract AS cm_providers_contract
|
|
|
<where>
|
|
|
<if test="id != null and id != ''"> and cm_providers_contract.id = #{id}</if>
|
|
|
- <if test="providersId != null "> and cm_providers_contract.providersId = #{providersId}</if>
|
|
|
+ <if test="serviceProviderId != null "> and cm_providers_contract.providersId = #{serviceProviderId}</if>
|
|
|
<if test="contractId != null and contractId != ''"> and cm_providers_contract.contractId = #{contractId}</if>
|
|
|
<if test="contractStartDate != null "> and cm_providers_contract.contractStartDate >= #{contractStartDate}</if>
|
|
|
<if test="contractEndDate != null "> and cm_providers_contract.contractEndDate <![CDATA[ <= ]]> #{contractEndDate}</if>
|
|
@@ -60,14 +57,14 @@
|
|
|
from cm_providers_contract AS cm_providers_contract
|
|
|
<where>
|
|
|
<if test="id != null and id != ''"> and cm_providers_contract.id = #{id}</if>
|
|
|
- <if test="providersId != null "> and cm_providers_contract.providersId = #{providersId}</if>
|
|
|
+ <if test="serviceProviderId != null "> and cm_providers_contract.providersId = #{serviceProviderId}</if>
|
|
|
<if test="contractId != null and contractId != ''"> and cm_providers_contract.contractId = #{contractId}</if>
|
|
|
<if test="contractStartDate != null "> and cm_providers_contract.contractStartDate = #{contractStartDate}</if>
|
|
|
<if test="contractEndDate != null "> and cm_providers_contract.contractEndDate = #{contractEndDate}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getCmProvidersContractById" parameterType="String" resultMap="CmProvidersContractResult">
|
|
|
+ <select id="getCmProvidersContractById" parameterType="String" resultType="com.caimei365.manager.entity.caimei.providers.CmProvidersContract">
|
|
|
<include refid="selectCmProvidersContractVo"/>
|
|
|
from cm_providers_contract AS cm_providers_contract
|
|
|
where cm_providers_contract.id = #{id}
|
|
@@ -79,7 +76,7 @@
|
|
|
from cm_providers_contract AS cm_providers_contract
|
|
|
<where>
|
|
|
<if test="id != null and id != ''"> and cm_providers_contract.id = #{id}</if>
|
|
|
- <if test="providersId != null "> and cm_providers_contract.providersId = #{providersId}</if>
|
|
|
+ <if test="serviceProviderId != null "> and cm_providers_contract.providersId = #{serviceProviderId}</if>
|
|
|
<if test="contractId != null and contractId != ''"> and cm_providers_contract.contractId = #{contractId}</if>
|
|
|
<if test="contractStartDate != null "> and cm_providers_contract.contractStartDate = #{contractStartDate}</if>
|
|
|
<if test="contractEndDate != null "> and cm_providers_contract.contractEndDate = #{contractEndDate}</if>
|
|
@@ -92,7 +89,7 @@
|
|
|
insert into cm_providers_contract
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null and id != ''">id,</if>
|
|
|
- <if test="providersId != null">providersId,</if>
|
|
|
+ <if test="serviceProviderId != null">providersId,</if>
|
|
|
<if test="contractId != null and contractId != ''">contractId,</if>
|
|
|
<if test="contractStartDate != null">contractStartDate,</if>
|
|
|
<if test="contractEndDate != null">contractEndDate,</if>
|
|
@@ -102,7 +99,7 @@
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null and id != ''">#{id},</if>
|
|
|
- <if test="providersId != null">#{providersId},</if>
|
|
|
+ <if test="serviceProviderId != null">#{serviceProviderId},</if>
|
|
|
<if test="contractId != null and contractId != ''">#{contractId},</if>
|
|
|
<if test="contractStartDate != null">#{contractStartDate},</if>
|
|
|
<if test="contractEndDate != null">#{contractEndDate},</if>
|
|
@@ -115,7 +112,7 @@
|
|
|
<update id="updateCmProvidersContract" parameterType="CmProvidersContract">
|
|
|
update cm_providers_contract
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="providersId != null">providersId = #{providersId},</if>
|
|
|
+ <if test="serviceProviderId != null">providersId = #{serviceProviderId},</if>
|
|
|
<if test="contractId != null and contractId != ''">contractId = #{contractId},</if>
|
|
|
<if test="contractStartDate != null">contractStartDate = #{contractStartDate},</if>
|
|
|
<if test="contractEndDate != null">contractEndDate = #{contractEndDate},</if>
|
|
@@ -136,7 +133,7 @@
|
|
|
from cm_providers_contract AS cm_providers_contract
|
|
|
<where>
|
|
|
<if test="id != null and id != ''"> and cm_providers_contract.id = #{id}</if>
|
|
|
- <if test="providersId != null "> and cm_providers_contract.providersId = #{providersId}</if>
|
|
|
+ <if test="serviceProviderId != null "> and cm_providers_contract.providersId = #{serviceProviderId}</if>
|
|
|
<if test="contractId != null and contractId != ''"> and cm_providers_contract.contractId = #{contractId}</if>
|
|
|
<if test="contractStartDate != null "> and cm_providers_contract.contractStartDate = #{contractStartDate}</if>
|
|
|
<if test="contractEndDate != null "> and cm_providers_contract.contractEndDate = #{contractEndDate}</if>
|