You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
4.5 KiB

<?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.qs.serve.modules.vtb.mapper.VtbFundFlowMapper">
<resultMap id="vtbFundFlowMap" type="com.qs.serve.modules.vtb.entity.VtbFundFlow" >
<result property="id" column="id"/>
<result property="fundType" column="fund_type"/>
<result property="verificationId" column="verification_id"/>
<result property="centerGoodsCode" column="center_goods_code"/>
<result property="costApplyId" column="cost_apply_id"/>
<result property="activityId" column="activity_id"/>
<result property="subjectId" column="subject_id"/>
<result property="subjectCode" column="subject_code"/>
<result property="subjectName" column="subject_name"/>
<result property="centerType" column="center_type"/>
<result property="centerId" column="center_id"/>
<result property="centerCode" column="center_code"/>
<result property="centerName" column="center_name"/>
<result property="usedAmount" column="used_amount"/>
<result property="targetType" column="target_type"/>
<result property="targetId" column="target_id"/>
<result property="targetCode" column="target_code"/>
<result property="targetName" column="target_name"/>
<result property="targetLevelPathIds" column="target_level_path_ids"/>
<result property="targetLevelPathNames" column="target_level_path_names"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
<result property="centerGoodItemId" column="center_good_item_id"/>
<result property="supplierId" column="supplier_id"/>
<result property="supplierCode" column="supplier_code"/>
<result property="supplierName" column="supplier_name"/>
</resultMap>
<sql id="vtbFundFlowSql">
vtb_fund_flow.`id`,
vtb_fund_flow.`fund_type`,
vtb_fund_flow.`verification_id`,
vtb_fund_flow.`center_goods_code`,
vtb_fund_flow.`cost_apply_id`,
vtb_fund_flow.`activity_id`,
vtb_fund_flow.`subject_id`,
vtb_fund_flow.`subject_code`,
vtb_fund_flow.`subject_name`,
vtb_fund_flow.`center_type`,
vtb_fund_flow.`center_id`,
vtb_fund_flow.`center_code`,
vtb_fund_flow.`center_name`,
vtb_fund_flow.`used_amount`,
vtb_fund_flow.`target_type`,
vtb_fund_flow.`target_id`,
vtb_fund_flow.`target_code`,
vtb_fund_flow.`target_name`,
vtb_fund_flow.`target_level_path_ids`,
vtb_fund_flow.`target_level_path_names`,
vtb_fund_flow.`remark`,
vtb_fund_flow.`create_time`,
vtb_fund_flow.`update_time`,
vtb_fund_flow.`tenant_id`,
vtb_fund_flow.`create_by`,
vtb_fund_flow.`update_by`,
vtb_fund_flow.`del_flag`,
vtb_fund_flow.`center_good_item_id`,
vtb_fund_flow.`supplier_id`,
vtb_fund_flow.`supplier_code`,
vtb_fund_flow.`supplier_name` </sql>
<select id="listSumAmount" resultType="com.qs.serve.modules.vtb.entity.dto.VtbFundFlowSumAmtDTO">
SELECT
vtb_fund_flow.activity_id,
sum( vtb_fund_flow.used_amount ) as total_amt
FROM
`vtb_fund_flow`
WHERE
vtb_fund_flow.activity_id IN
<foreach collection="query.selectActivityIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
AND vtb_fund_flow.fund_type = #{query.fundType}
GROUP BY
vtb_fund_flow.activity_id
</select>
<select id="listActivityCenterGoodsUsed" resultType="com.qs.serve.common.model.AmountDTO">
select sum(vtb_fund_flow.used_amount) as amount,
center_good_item_id as id
from vtb_fund_flow
where center_good_item_id in
<foreach collection="ids" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
and del_flag = 0
and fund_type = 'verification'
GROUP BY center_good_item_id
</select>
</mapper>