123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- <?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.zjugis.business.flow.usemoney.dao.UseMoneyDao">
- <select id="getUseMoneyEarnestPage"
- resultType="com.zjugis.business.flow.usemoney.controller.vo.UseMoneyEarnestRespVO">
- SELECT
- T2.ID,
- T2.instance_id,
- T2.PROJECT_ID,
- T2.APPLY_TIME,
- to_char(T2.COLLECTION_COMPANY) as COLLECTION_COMPANY,
- T2.USER_NICKNAME,
- T2.DEPT_NAME,
- T2.PAYMENT_COMPANY_ID,
- T1.AMOUNT,
- to_char(T1.REMARK) REMARK,
- T1.WRITE_OFF_AMOUNT,
- T1.I_WRITE_OFF,
- T1.WRITE_OFF_TIME,
- T1.COST_TYPE,
- T1.ID as detailId,
- case when T2.PROJECT_ID is not null then T3.XMMC else T4.XMMC end as XMMC,
- 'usemonvy' as type
- FROM
- WF_USE_MONEY_DETAIL T1
- LEFT JOIN WF_USE_MONEY T2 ON T1.USE_MONEY_ID = T2.ID
- LEFT JOIN PROJECT T3 ON T2.PROJECT_ID=T3.ID
- LEFT JOIN project T4 ON T1.PROJECT_ID=T4.ID
- <where>
- T1.COST_TYPE LIKE '14%' and T2.FLOW_STATUS=90
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND T2.COLLECTION_COMPANY like #{collectionCompany}
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.REMARK like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <if test="params != null and params.useMoneyNo != null and params.useMoneyNo != ''">
- AND T2.USE_MONEY_NO = #{params.useMoneyNo}
- </if>
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T2.TOTAL_AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null ">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null ">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="params != null and params.UserDeptList != null and params.UserDeptList.size > 0">
- AND T2.DEPT_ID in
- <foreach collection="params.UserDeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- union
- SELECT
- T2.ID,
- T2.instance_id,
- T2.PROJECT_ID,
- T2.APPLY_TIME,
- '' as COLLECTION_COMPANY,
- T2.USER_NICKNAME,
- T2.DEPT_NAME,
- T2.PAYMENT_COMPANY_ID,
- T1.AMOUNT,
- to_char(T1.BZ1) AS REMARK,
- T1.WRITE_OFF_AMOUNT,
- T1.I_WRITE_OFF,
- T1.WRITE_OFF_TIME,
- T1.COST_TYPE,
- T1.ID as detailId,
- T3.XMMC,
- 'cost' as type
- FROM
- WF_COMMON_COST_DETAIL T1
- LEFT JOIN WF_COMMON_COST T2 ON T1.COMMON_COST_ID = T2.ID
- LEFT JOIN PROJECT T3 ON T1.PROJECT_ID=T3.ID
- <where>
- T1.COST_TYPE LIKE '14%' and T2.FLOW_STATUS=90
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND 1!=1
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.BZ1 like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <if test="params != null and params.useMoneyNo != null and params.useMoneyNo != ''">
- AND T2.COMMON_COST_NO = #{params.useMoneyNo}
- </if>
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T1.AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null ">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="params != null and params.UserDeptList != null and params.UserDeptList.size > 0">
- AND T2.DEPT_ID in
- <foreach collection="params.UserDeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- order by APPLY_TIME DESC NULLS LAST
- </select>
- <select id="getUseMoneyEarnestDeptPage"
- resultType="com.zjugis.business.flow.usemoney.controller.vo.UseMoneyEarnestRespVO">
- SELECT
- T2.ID,
- T2.INSTANCE_ID,
- T2.PROJECT_ID,
- T2.APPLY_TIME,
- to_char(T2.COLLECTION_COMPANY) as COLLECTION_COMPANY,
- T2.USER_NICKNAME,
- T2.PAYMENT_COMPANY_ID,
- T1.AMOUNT,
- to_char(T1.REMARK) as REMARK,
- T1.WRITE_OFF_AMOUNT,
- T1.I_WRITE_OFF,
- T1.WRITE_OFF_TIME,
- T1.COST_TYPE,
- case when T2.PROJECT_ID is not null then T3.XMMC else T4.XMMC end as XMMC
- FROM
- WF_USE_MONEY_DETAIL T1
- LEFT JOIN WF_USE_MONEY T2 ON T1.USE_MONEY_ID = T2.ID
- LEFT JOIN project T3 ON T2.PROJECT_ID=T3.ID
- LEFT JOIN project T4 ON T1.PROJECT_ID=T4.ID
- <where>
- T1.COST_TYPE LIKE '14%' and T2.FLOW_STATUS=90
- <if test="projectIds != null and projectIds.size > 0">
- AND (T2.PROJECT_ID IN
- <foreach collection="projectIds" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- or T1.PROJECT_ID IN
- <foreach collection="projectIds" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- <if test="params.UserDeptList != null and params.UserDeptList.size > 0">
- or (T2.DEPT_ID IN
- <foreach collection="params.UserDeptList" index="index" item="item1" open="(" separator="," close=")">
- #{item1,jdbcType=VARCHAR}
- </foreach>
- )
- </if>
- )
- </if>
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND T2.COLLECTION_COMPANY like #{collectionCompany}
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.REMARK like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T2.TOTAL_AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null ">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null ">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- union
- SELECT
- T2.ID,
- T2.instance_id,
- T2.PROJECT_ID,
- T2.APPLY_TIME,
- '' as COLLECTION_COMPANY,
- T2.USER_NICKNAME,
- T2.PAYMENT_COMPANY_ID,
- T1.AMOUNT,
- to_char(T1.BZ1) AS REMARK,
- T1.WRITE_OFF_AMOUNT,
- T1.I_WRITE_OFF,
- T1.WRITE_OFF_TIME,
- T1.COST_TYPE,
- T3.XMMC
- FROM
- WF_COMMON_COST_DETAIL T1
- LEFT JOIN WF_COMMON_COST T2 ON T1.COMMON_COST_ID = T2.ID
- LEFT JOIN PROJECT T3 ON T2.PROJECT_ID=T3.ID
- <where>
- T1.COST_TYPE LIKE '14%' and T2.FLOW_STATUS=90
- <if test="projectIds != null and projectIds.size > 0">
- AND (T1.PROJECT_ID IN
- <foreach collection="projectIds" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- <if test="params.UserDeptList != null and params.UserDeptList.size > 0">
- or (T2.DEPT_ID IN
- <foreach collection="params.UserDeptList" index="index" item="item1" open="(" separator="," close=")">
- #{item1,jdbcType=VARCHAR}
- </foreach>
- )
- </if>
- )
- </if>
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND 1!=1
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.BZ1 like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <!-- <if test="params != null and params.useMoneyNo != null and params.useMoneyNo != ''">-->
- <!-- AND T2.COMMON_COST_NO = #{params.useMoneyNo}-->
- <!-- </if>-->
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T1.AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null ">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null ">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY APPLY_TIME DESC NULLS LAST
- </select>
- <select id="getCount" resultType="java.lang.Integer">
- select sum(num) from (
- SELECT count(*) as num
- from
- WF_USE_MONEY_DETAIL T1
- LEFT JOIN WF_USE_MONEY T2 ON T1.USE_MONEY_ID = T2.ID
- <where>
- T1.ISVALID = 1 and T2.FLOW_STATUS=90 and I_WRITE_OFF=0 AND T2.ISVALID = 1 and T1.COST_TYPE LIKE '14%'
- <if test="params != null and params.userId != null and params.userId != ''">
- AND USER_ID = #{params.userId}
- </if>
- </where>
- union all
- SELECT count(*) as num
- from
- WF_COMMON_COST_DETAIL T1
- LEFT JOIN WF_COMMON_COST T2 ON T1.COMMON_COST_ID = T2.ID
- <where>
- T1.ISVALID = 1 and T2.FLOW_STATUS=90 and I_WRITE_OFF=0 AND T2.ISVALID = 1 and T1.COST_TYPE LIKE '14%'
- <if test="params != null and params.userId != null and params.userId != ''">
- AND USER_ID = #{params.userId}
- </if>
- </where>
- ) e
- </select>
- <select id="getUseMoneyOverviewHx" resultType="com.zjugis.business.flow.usemoney.controller.vo.UseMoneyOverviewVO">
- select
- NVL( sum( totalAmount ), 0 ) AS totalAmount,
- NVL( sum( totalUseAmount ), 0 ) AS totalUseAmount,
- NVL( sum( totalAmount ) - sum( totalUseAmount ), 0 ) AS totalApplyAmount
- from (
- SELECT
- NVL(sum(AMOUNT),0) as totalAmount,
- NVL(sum(WRITE_OFF_AMOUNT),0) as totalUseAmount,
- NVL(sum(AMOUNT)-sum(WRITE_OFF_AMOUNT),0) as totalApplyAmount
- from
- WF_USE_MONEY_DETAIL T1
- LEFT JOIN WF_USE_MONEY T2 ON T1.USE_MONEY_ID = T2.ID
- LEFT JOIN project T3 ON T2.PROJECT_ID=T3.ID
- <where>
- T1.ISVALID = 1 and T2.FLOW_STATUS=90 AND T2.ISVALID = 1 and T1.COST_TYPE LIKE '14%'
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND T2.COLLECTION_COMPANY like #{collectionCompany}
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.REMARK like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <if test="params != null and params.useMoneyNo != null and params.useMoneyNo != ''">
- AND T2.USE_MONEY_NO = #{params.useMoneyNo}
- </if>
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T2.TOTAL_AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null ">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null ">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="params.project != null and params.project.size > 0">
- AND (T2.PROJECT_ID IN
- <foreach collection="params.project" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- or T1.PROJECT_ID IN
- <foreach collection="params.project" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- <if test="params.UserDeptList != null and params.UserDeptList.size > 0">
- or (T2.DEPT_ID IN
- <foreach collection="params.UserDeptList" index="index" item="item1" open="(" separator="," close=")">
- #{item1,jdbcType=VARCHAR}
- </foreach>
- )
- </if>
- )
- </if>
- </where>
- union all
- SELECT
- NVL(sum(AMOUNT),0) as totalAmount,
- NVL(sum(WRITE_OFF_AMOUNT),0) as totalUseAmount,
- NVL(sum(AMOUNT)-sum(WRITE_OFF_AMOUNT),0) as totalApplyAmount
- from
- WF_COMMON_COST_DETAIL T1
- LEFT JOIN WF_COMMON_COST T2 ON T1.COMMON_COST_ID = T2.ID
- LEFT JOIN project T3 ON T2.PROJECT_ID=T3.ID
- <where>
- T1.ISVALID = 1 and T2.FLOW_STATUS=90 AND T2.ISVALID = 1 and T1.COST_TYPE LIKE '14%'
- <if test="params != null and params.collectionCompany != null and params.collectionCompany != ''">
- <bind name="collectionCompany" value="'%'+params.collectionCompany+'%'"/>
- AND 1!=1
- </if>
- <if test="params != null and params.REMARK != null and params.REMARK != ''">
- <bind name="REMARK" value="'%'+params.REMARK+'%'"/>
- AND T1.BZ1 like #{REMARK}
- </if>
- <if test="params != null and params.costType != null and params.costType != ''">
- AND T1.COST_TYPE = #{params.costType}
- </if>
- <if test="params != null and params.useMoneyNo != null and params.useMoneyNo != ''">
- AND T2.COMMON_COST_NO = #{params.useMoneyNo}
- </if>
- <if test="params != null and params.totalAmount != null and params.totalAmount != ''">
- AND T2.TOTAL_AMOUNT = #{params.totalAmount}
- </if>
- <if test="params != null and params.status != null and params.status != ''">
- AND T1.I_WRITE_OFF = #{params.status}
- </if>
- <if test="params != null and params.userId != null and params.userId != ''">
- AND T2.USER_ID = #{params.userId}
- </if>
- <if test="params != null and params.applyOn != null ">
- AND T2.APPLY_TIME >= #{params.applyOn}
- </if>
- <if test="params != null and params.applyOff != null ">
- AND T2.APPLY_TIME <= #{params.applyOff}
- </if>
- <if test="params != null and params.writeOn != null">
- AND T1.WRITE_OFF_TIME >= #{params.writeOn}
- </if>
- <if test="params != null and params.writeOff != null ">
- AND T1.WRITE_OFF_TIME <= #{params.writeOff}
- </if>
- <if test="params != null and params.DeptList != null and params.DeptList.size > 0">
- AND T3.ZRBM_ID in
- <foreach collection="params.DeptList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="params.project != null and params.project.size > 0">
- AND (T1.PROJECT_ID IN
- <foreach collection="params.project" index="index" item="item" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- <if test="params.UserDeptList != null and params.UserDeptList.size > 0">
- or (T2.DEPT_ID IN
- <foreach collection="params.UserDeptList" index="index" item="item1" open="(" separator="," close=")">
- #{item1,jdbcType=VARCHAR}
- </foreach>
- )
- </if>
- )
- </if>
- </where>) e
- </select>
- <!-- <select id="getUseMoneyPage" resultType="com.zjugis.business.flow.usemoney.controller.vo.UseMoneyRespVO">-->
- <!-- SELECT-->
- <!-- T.*-->
- <!-- FROM-->
- <!-- WF_USE_MONEY T-->
- <!-- <where>-->
- <!-- <if test="params != null and params.userId != null">-->
- <!-- AND T.USER_ID = #{params.userId}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.costType != null">-->
- <!-- AND T.DEPT_ID = #{params.costType}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.costType != null">-->
- <!-- AND T.USE_MONEY_NO = #{params.costType}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.costType != null">-->
- <!-- AND T.COST_TYPE = #{params.costType}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.params.flowStatus != null">-->
- <!-- AND T.FLOW_STATUS = #{params.flowStatus}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.costType != null">-->
- <!-- AND T.TOTAL_AMOUNT = #{params.costType}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.applyOn != null">-->
- <!-- AND T.APPLY_DATE >= #{params.applyOn}-->
- <!-- </if>-->
- <!-- <if test="params != null and params.applyOff != null">-->
- <!-- AND T.APPLY_DATE <= #{params.applyOff}-->
- <!-- </if>-->
- <!-- </where>-->
- <!-- ORDER BY T.APPLY_TIME DESC NULLS LAST-->
- <!-- </select>-->
- <select id="getAllIdByProject" resultType="java.lang.String">
- SELECT T1.id
- from
- WF_USE_MONEY T1
- LEFT JOIN WF_USE_MONEY_DETAIL T2 ON T2.USE_MONEY_ID = T1.ID
- <where>
- T1.ISVALID = 1 and T1.FLOW_STATUS=90 AND T2.ISVALID = 1
- and (t1.PROJECT_ID=#{project} or t2.PROJECT_ID=#{project})
- </where>
- </select>
- <select id="getDataByProject" resultType="com.zjugis.business.flow.usemoney.controller.vo.UseMoneyTypeRespVO">
- SELECT
- sum(case when t1.COST_TYPE ='0101' or t1.COST_TYPE ='0102' then t1.AMOUNT else 0 end ) as subAmount,
- sum(case when t1.COST_TYPE ='03' then t1.AMOUNT else 0 end ) as outAmount,
- sum(case when t1.COST_TYPE !='03' and t1.COST_TYPE !='0101' and t1.COST_TYPE !='0102' then t1.AMOUNT else 0 end ) as otherAmount
- from
- WF_USE_MONEY_DETAIL T1
- LEFT JOIN WF_USE_MONEY T2 ON T1.USE_MONEY_ID = T2.ID
- <where>
- T1.ISVALID = 1 and T2.FLOW_STATUS=90 AND T2.ISVALID = 1
- and (t1.PROJECT_ID=#{project} or t2.PROJECT_ID=#{project})
- </where>
- </select>
- </mapper>
|