|
@@ -13,6 +13,13 @@
|
|
|
<result column="roleName" property="roleName"/>
|
|
|
<result column="investmentPromotion" property="investmentPromotion"/>
|
|
|
<result column="operator" property="operator"/>
|
|
|
+ <result column="investmentPromotionName" property="investmentPromotionName"/>
|
|
|
+ <result column="operatorName" property="operatorName"/>
|
|
|
+ <result column="tenantType" property="tenantType"/>
|
|
|
+ <result column="merchantId" property="merchantId"/>
|
|
|
+ <result column="merchantName" property="merchantName"/>
|
|
|
+ <result column="clientId" property="clientId"/>
|
|
|
+ <result column="clientName" property="clientName"/>
|
|
|
<result column="tenant" property="tenant"/>
|
|
|
<result column="industry" property="industry"/>
|
|
|
<result column="corporation" property="corporation"/>
|
|
@@ -31,11 +38,48 @@
|
|
|
<result column="data" property="data"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.Contract" id="result">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="createDate" property="createDate"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="organizationName" property="organizationName"/>
|
|
|
+ <result column="roleId" property="roleId"/>
|
|
|
+ <result column="roleName" property="roleName"/>
|
|
|
+ <result column="investmentPromotion" property="investmentPromotion"/>
|
|
|
+ <result column="operator" property="operator"/>
|
|
|
+ <result column="investmentPromotionName" property="investmentPromotionName"/>
|
|
|
+ <result column="operatorName" property="operatorName"/>
|
|
|
+ <result column="tenantType" property="tenantType"/>
|
|
|
+ <result column="merchantId" property="merchantId"/>
|
|
|
+ <result column="merchantName" property="merchantName"/>
|
|
|
+ <result column="clientId" property="clientId"/>
|
|
|
+ <result column="clientName" property="clientName"/>
|
|
|
+ <result column="tenant" property="tenant"/>
|
|
|
+ <result column="industry" property="industry"/>
|
|
|
+ <result column="corporation" property="corporation"/>
|
|
|
+ <result column="signatory" property="signatory"/>
|
|
|
+ <result column="tenantContactPerson" property="tenantContactPerson"/>
|
|
|
+ <result column="signingDate" property="signingDate"/>
|
|
|
+ <result column="startDate" property="startDate"/>
|
|
|
+ <result column="endDate" property="endDate"/>
|
|
|
+ <result column="lateFeesStartingDays" property="lateFeesStartingDays"/>
|
|
|
+ <result column="lateFeesProportion" property="lateFeesProportion"/>
|
|
|
+ <result column="lateFeesCeiling" property="lateFeesCeiling"/>
|
|
|
+ <result column="tagIds" property="tagIds"/>
|
|
|
+ <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="documentId" property="documentId"/>
|
|
|
+ <result column="data" property="data"/>
|
|
|
+ <collection property="clauseList" ofType="com.bosshand.virgo.api.model.Clause" resultMap="com.bosshand.virgo.api.dao.ClauseDao.clauseResult" columnPrefix="clause_"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.Contract" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO contract(`createDate`, `organizationId`, `organizationName`, `roleId`, `roleName`, `investmentPromotion`, `operator`,
|
|
|
+ INSERT INTO contract(`createDate`, `organizationId`, `organizationName`, `roleId`, `roleName`, `investmentPromotion`, `operator`, `investmentPromotionName`, `operatorName`,`tenantType`, `merchantId`, `merchantName`, `clientId`, `clientName`
|
|
|
`tenant`, `industry`, `corporation`, `signatory`, `tenantContactPerson`, `signingDate`, `startDate`, `endDate`,
|
|
|
`lateFeesStartingDays`, `lateFeesProportion`, `lateFeesCeiling`, `tagIds`, `projectItemTargetRoomIds`, `attachment`, `documentId`, `data`)
|
|
|
- VALUES (now(), #{organizationId}, #{organizationName}, #{roleId}, #{roleName}, #{investmentPromotion}, #{operator}, #{tenant},
|
|
|
+ VALUES (now(), #{organizationId}, #{organizationName}, #{roleId}, #{roleName}, #{investmentPromotion}, #{operator}, #{investmentPromotionName}, #{operatorName}, #{tenantType}, #{merchantId}, #{merchantName}, #{clientId}, #{clientName}, #{tenant},
|
|
|
#{industry}, #{corporation}, #{signatory}, #{tenantContactPerson}, #{signingDate}, #{startDate}, #{endDate}, #{lateFeesStartingDays},
|
|
|
#{lateFeesProportion}, #{lateFeesCeiling}, #{tagIds}, #{projectItemTargetRoomIds}, #{attachment}, #{documentId}, #{data})
|
|
|
</insert>
|
|
@@ -50,8 +94,15 @@
|
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
<if test="organizationName!=null">organizationName=#{organizationName},</if>
|
|
|
<if test="roleId!=0">roleId=#{roleId},</if>
|
|
|
- <if test="investmentPromotion!=null">investmentPromotion=#{investmentPromotion},</if>
|
|
|
- <if test="operator!=null">operator=#{operator},</if>
|
|
|
+ <if test="investmentPromotion!=0">investmentPromotion=#{investmentPromotion},</if>
|
|
|
+ <if test="operator!=0">operator=#{operator},</if>
|
|
|
+ <if test="investmentPromotionName!=null">investmentPromotionName=#{investmentPromotionName},</if>
|
|
|
+ <if test="operatorName!=null">operatorName=#{operatorName},</if>
|
|
|
+ <if test="tenantType!=null">tenantType=#{tenantType},</if>
|
|
|
+ <if test="merchantId!=0">merchantId=#{merchantId},</if>
|
|
|
+ <if test="merchantName!=null">merchantName=#{merchantName},</if>
|
|
|
+ <if test="clientId!=0">clientId=#{clientId},</if>
|
|
|
+ <if test="clientName!=null">clientName=#{clientName},</if>
|
|
|
<if test="tenant!=null">tenant=#{tenant},</if>
|
|
|
<if test="industry!=null">industry=#{industry},</if>
|
|
|
<if test="corporation!=null">corporation=#{corporation},</if>
|
|
@@ -72,8 +123,37 @@
|
|
|
WHERE id=#{id}
|
|
|
</update>
|
|
|
|
|
|
- <select id="get" resultMap="contractResult">
|
|
|
- SELECT * FROM contract where id = #{id}
|
|
|
+ <select id="get" resultMap="result">
|
|
|
+ SELECT
|
|
|
+ c.*,
|
|
|
+ cl.id as clause_id,
|
|
|
+ cl.contractId as clause_contractId,
|
|
|
+ cl.type as clause_type,
|
|
|
+ cl.rentWay as clause_rentWay,
|
|
|
+ cl.startTime as clause_startTime,
|
|
|
+ cl.endTime as clause_endTime,
|
|
|
+ cl.unitPrice as clause_unitPrice,
|
|
|
+ cl.payTime as clause_payTime,
|
|
|
+ cl.chargingType as clause_chargingType,
|
|
|
+ cl.unnaturalMonthChargingWay as clause_unnaturalMonthChargingWay,
|
|
|
+ cl.yearDays as clause_yearDays,
|
|
|
+ cl.payCycle as clause_payCycle,
|
|
|
+ cl.leaseTermWay as clause_leaseTermWay,
|
|
|
+ cl.earnestMoneyType as clause_earnestMoneyType,
|
|
|
+ cl.earnestMoney as clause_earnestMoney,
|
|
|
+ cl.currencyType as clause_currencyType,
|
|
|
+ cl.incrementalTime as clause_incrementalTime,
|
|
|
+ cl.incrementalUnitPrice as clause_incrementalUnitPrice,
|
|
|
+ cl.incrementalEarnestMoney as clause_incrementalEarnestMoney,
|
|
|
+ cl.preferentialType as clause_preferentialType,
|
|
|
+ cl.preferentialStartTime as clause_preferentialStartTime,
|
|
|
+ cl.preferentialEndTime as clause_preferentialEndTime,
|
|
|
+ cl.preferentialRemark as clause_preferentialRemark,
|
|
|
+ cl.preferentialRentFreeWay as clause_preferentialRentFreeWay,
|
|
|
+ cl.data as clause_data
|
|
|
+ FROM contract c
|
|
|
+ LEFT JOIN clause cl ON c.id = cl.contractId
|
|
|
+ where c.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" resultMap="contractResult">
|
|
@@ -82,8 +162,15 @@
|
|
|
<if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
|
<if test="organizationName!=null">and organizationName=#{organizationName}</if>
|
|
|
<if test="roleId!=0">and roleId=#{roleId}</if>
|
|
|
- <if test="investmentPromotion!=null">and investmentPromotion=#{investmentPromotion}</if>
|
|
|
- <if test="operator!=null">and operator=#{operator}</if>
|
|
|
+ <if test="investmentPromotion!=0">and investmentPromotion=#{investmentPromotion}</if>
|
|
|
+ <if test="operator!=0">and operator=#{operator}</if>
|
|
|
+ <if test="investmentPromotionName!=null">investmentPromotionName=#{investmentPromotionName},</if>
|
|
|
+ <if test="operatorName!=null">operatorName=#{operatorName},</if>
|
|
|
+ <if test="tenantType!=null">and tenantType=#{tenantType}</if>
|
|
|
+ <if test="merchantId!=0">and merchantId=#{merchantId}</if>
|
|
|
+ <if test="merchantName!=null">and merchantName=#{merchantName}</if>
|
|
|
+ <if test="clientId!=0">and clientId=#{clientId}</if>
|
|
|
+ <if test="clientName!=null">and clientName=#{clientName}</if>
|
|
|
<if test="tenant!=null">and tenant=#{tenant}</if>
|
|
|
<if test="industry!=null">and industry=#{industry}</if>
|
|
|
<if test="corporation!=null">and corporation=#{corporation}</if>
|
|
@@ -113,8 +200,15 @@
|
|
|
<if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
|
<if test="organizationName!=null">and organizationName=#{organizationName}</if>
|
|
|
<if test="roleId!=0">and roleId=#{roleId}</if>
|
|
|
- <if test="investmentPromotion!=null">and investmentPromotion=#{investmentPromotion}</if>
|
|
|
- <if test="operator!=null">and operator=#{operator}</if>
|
|
|
+ <if test="investmentPromotion!=0">and investmentPromotion=#{investmentPromotion}</if>
|
|
|
+ <if test="operator!=0">and operator=#{operator}</if>
|
|
|
+ <if test="investmentPromotionName!=null">investmentPromotionName=#{investmentPromotionName},</if>
|
|
|
+ <if test="operatorName!=null">operatorName=#{operatorName},</if>
|
|
|
+ <if test="tenantType!=null">and tenantType=#{tenantType}</if>
|
|
|
+ <if test="merchantId!=0">and merchantId=#{merchantId}</if>
|
|
|
+ <if test="merchantName!=null">and merchantName=#{merchantName}</if>
|
|
|
+ <if test="clientId!=0">and clientId=#{clientId}</if>
|
|
|
+ <if test="clientName!=null">and clientName=#{clientName}</if>
|
|
|
<if test="tenant!=null">and tenant=#{tenant}</if>
|
|
|
<if test="industry!=null">and industry=#{industry}</if>
|
|
|
<if test="corporation!=null">and corporation=#{corporation}</if>
|
|
@@ -144,8 +238,15 @@
|
|
|
<if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
|
|
|
<if test="p.organizationName!=null">and organizationName=#{p.organizationName}</if>
|
|
|
<if test="p.roleId!=0">and roleId=#{p.roleId}</if>
|
|
|
- <if test="p.investmentPromotion!=null">and investmentPromotion=#{p.investmentPromotion}</if>
|
|
|
- <if test="p.operator!=null">and operator=#{p.operator}</if>
|
|
|
+ <if test="p.investmentPromotion!=0">and investmentPromotion=#{p.investmentPromotion}</if>
|
|
|
+ <if test="p.operator!=0">and operator=#{p.operator}</if>
|
|
|
+ <if test="p.investmentPromotionName!=null">investmentPromotionName=#{p.investmentPromotionName},</if>
|
|
|
+ <if test="p.operatorName!=null">operatorName=#{p.operatorName},</if>
|
|
|
+ <if test="p.tenantType!=null">and tenantType=#{p.tenantType}</if>
|
|
|
+ <if test="p.merchantId!=0">and merchantId=#{p.merchantId}</if>
|
|
|
+ <if test="p.merchantName!=null">and merchantName=#{p.merchantName}</if>
|
|
|
+ <if test="p.clientId!=0">and clientId=#{p.clientId}</if>
|
|
|
+ <if test="p.clientName!=null">and clientName=#{p.clientName}</if>
|
|
|
<if test="p.tenant!=null">and tenant=#{p.tenant}</if>
|
|
|
<if test="p.industry!=null">and industry=#{p.industry}</if>
|
|
|
<if test="p.corporation!=null">and corporation=#{p.corporation}</if>
|