|
@@ -26,10 +26,10 @@
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.bosshand.virgo.api.model.Payment" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="batchInsert" parameterType="com.bosshand.virgo.api.model.Payment" useGeneratedKeys="true" keyProperty="id">
|
|
- INSERT INTO payment(`reminderDate`, `projectId`, `contractCode`, `contractId`, `organizationId`, `payMerchantId`, `payClientId`, `startDate`, `endDate`, `phase`, `amount`, `status`, `data`)
|
|
|
|
|
|
+ INSERT INTO payment(`reminderDate`, `projectId`, `contractCode`, `contractId`, `organizationId`, `payMerchantId`, `payClientId`, `startDate`, `endDate`, `phase`, `amount`, `data`)
|
|
VALUES
|
|
VALUES
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
- (#{item.reminderDate}, #{item.projectId}, #{item.contractCode}, #{item.contractId}, #{item.organizationId}, #{item.payMerchantId}, #{item.payClientId}, #{item.startDate}, #{item.endDate}, #{item.phase}, #{item.amount}, #{item.status}, #{item.data})
|
|
|
|
|
|
+ (#{item.reminderDate}, #{item.projectId}, #{item.contractCode}, #{item.contractId}, #{item.organizationId}, #{item.payMerchantId}, #{item.payClientId}, #{item.startDate}, #{item.endDate}, #{item.phase}, #{item.amount}, #{item.data})
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -49,6 +49,18 @@
|
|
SELECT contractId FROM payment where contractId = #{contractId}
|
|
SELECT contractId FROM payment where contractId = #{contractId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="getMonthProjectId" resultType="map">
|
|
|
|
+ SELECT SUM(`amount`) as receivable, SUM(if(`status`=2,`amount`,0)) as received, SUM(if(`status`!=2 and startDate < now(),`amount`,0)) as overdue FROM payment WHERE projectId = #{projectId} and YEAR(startDate) = YEAR(NOW()) and MONTH(startDate) = MONTH(NOW())
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getYearProjectId" resultType="map">
|
|
|
|
+ SELECT SUM(`amount`) as receivable, SUM(if(`status`=2,`amount`,0)) as received, SUM(if(`status`!=2 and startDate < now(),`amount`,0)) as overdue FROM payment WHERE projectId = #{projectId} and YEAR(startDate) = YEAR(NOW())
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getAccumulateProjectId" resultType="map">
|
|
|
|
+ SELECT SUM(`amount`) as receivable, SUM(if(`status`=2,`amount`,0)) as received, SUM(if(`status`!=2 and startDate < now(),`amount`,0)) as overdue FROM payment WHERE projectId = #{projectId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="getList" resultMap="paymentResult">
|
|
<select id="getList" resultMap="paymentResult">
|
|
SELECT * FROM payment
|
|
SELECT * FROM payment
|
|
<where>
|
|
<where>
|