|
@@ -107,4 +107,67 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.Contract" resultType="Integer">
|
|
|
+ SELECT count(*) FROM contract
|
|
|
+ <where>
|
|
|
+ <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="tenant!=null">and tenant=#{tenant}</if>
|
|
|
+ <if test="industry!=null">and industry=#{industry}</if>
|
|
|
+ <if test="corporation!=null">and corporation=#{corporation}</if>
|
|
|
+ <if test="signatory!=null">and signatory=#{signatory}</if>
|
|
|
+ <if test="tenantContactPerson!=null">and tenantContactPerson=#{tenantContactPerson}</if>
|
|
|
+ <if test="signingDate!=null">and signingDate=#{signingDate}</if>
|
|
|
+ <if test="startDate!=null">and startDate=#{startDate}</if>
|
|
|
+ <if test="endDate!=null">and endDate=#{endDate}</if>
|
|
|
+ <if test="lateFeesStartingDays!=null">and lateFeesStartingDays=#{lateFeesStartingDays}</if>
|
|
|
+ <if test="lateFeesProportion!=null">and lateFeesProportion=#{lateFeesProportion}</if>
|
|
|
+ <if test="lateFeesCeiling!=null">and lateFeesCeiling=#{lateFeesCeiling}</if>
|
|
|
+ <if test="tagIds != null">and
|
|
|
+ <foreach item="tagId" collection="tagIds.split(',')" open="(" separator=" and " close=")">
|
|
|
+ FIND_IN_SET (#{tagId}, tagIds)
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
|
|
|
+ <if test="attachment!=null">and attachment=#{attachment}</if>
|
|
|
+ <if test="documentId!=0">and documentId=#{documentId}</if>
|
|
|
+ <if test="data!=null">and data=#{data}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="contractResult">
|
|
|
+ SELECT * FROM contract
|
|
|
+ <where>
|
|
|
+ <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.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>
|
|
|
+ <if test="p.signatory!=null">and signatory=#{p.signatory}</if>
|
|
|
+ <if test="p.tenantContactPerson!=null">and tenantContactPerson=#{p.tenantContactPerson}</if>
|
|
|
+ <if test="p.signingDate!=null">and signingDate=#{p.signingDate}</if>
|
|
|
+ <if test="p.startDate!=null">and startDate=#{p.startDate}</if>
|
|
|
+ <if test="p.endDate!=null">and endDate=#{p.endDate}</if>
|
|
|
+ <if test="p.lateFeesStartingDays!=null">and lateFeesStartingDays=#{p.lateFeesStartingDays}</if>
|
|
|
+ <if test="p.lateFeesProportion!=null">and lateFeesProportion=#{p.lateFeesProportion}</if>
|
|
|
+ <if test="p.lateFeesCeiling!=null">and lateFeesCeiling=#{p.lateFeesCeiling}</if>
|
|
|
+ <if test="p.tagIds != null">and
|
|
|
+ <foreach item="tagId" collection="p.tagIds.split(',')" open="(" separator=" and " close=")">
|
|
|
+ FIND_IN_SET (#{tagId}, tagIds)
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="p.projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{p.projectItemTargetRoomIds}</if>
|
|
|
+ <if test="p.attachment!=null">and attachment=#{p.attachment}</if>
|
|
|
+ <if test="p.documentId!=0">and documentId=#{p.documentId}</if>
|
|
|
+ <if test="p.data!=null">and data=#{p.data}</if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|