| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <?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.ydtech.modules.inv.dao.InvAccountExcelMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccountExcel">
- <id property="excelAccountOperateId" column="excel_account_operate_id" jdbcType="VARCHAR"/>
- <result property="company" column="company" jdbcType="VARCHAR"/>
- <result property="applicant" column="applicant" jdbcType="VARCHAR"/>
- <result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
- <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
- <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
- <result property="fundFlow" column="fund_flow" jdbcType="VARCHAR"/>
- <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
- <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
- <result property="bigApplyAmount" column="big_apply_amount" jdbcType="VARCHAR"/>
- <result property="uplodePath" column="uplode_path" jdbcType="VARCHAR"/>
- <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="enterCardNum" column="enter_card_num" jdbcType="VARCHAR"/>
- <result property="outCardNum" column="out_card_num" jdbcType="VARCHAR"/>
- <result property="transferFlag" column="transfer_flag" jdbcType="CHAR"/>
- <result property="outFlag" column="out_flag" jdbcType="CHAR"/>
- <result property="outAccountQuality" column="out_account_quality" jdbcType="CHAR"/>
- <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
- <result property="payMethod" column="pay_method" jdbcType="VARCHAR"/>
- <result property="outProfit" column="out_profit" javaType="com.alibaba.fastjson.JSONObject"
- typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
- <result property="entProfit" column="ent_profit" javaType="com.alibaba.fastjson.JSONObject"
- typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
- <result property="fundFen" column="fund_fen" jdbcType="VARCHAR"/>
- <result property="remark" column="remark" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- excel_account_operate_id,company,applicant,
- apply_time,apply_sector,collection_message,
- fund_flow,fund_use,
- apply_amount,payout_amount,big_apply_amount,uplode_path,
- update_by,update_time,create_by,
- create_time,enter_card_num,out_card_num,
- del_flag,out_flag,out_account_quality,transfer_flag,pay_method,out_profit,ent_profit,fund_fen,remark
- </sql>
- <select id="selectExcelAccount" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from inv_account_excel
- where
- del_flag = '0'
- <if test="insAccountExcel.excelAccountOperateId!= null and insAccountExcel.excelAccountOperateId!= ''">
- and excel_account_operate_id = #{insAccountExcel.excelAccountOperateId}
- </if>
- <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
- and company like concat('%',#{insAccountExcel.company},'%')
- </if>
- <if test="insAccountExcel.applicant!= null and insAccountExcel.applicant!= ''">
- and applicant = #{insAccountExcel.applicant}
- </if>
- <if test="insAccountExcel.applyTimeStart!= null">
- and apply_time >= #{insAccountExcel.applyTimeStart}
- </if>
- <if test="insAccountExcel.applyTimeEnd!= null">
- and apply_time <= #{insAccountExcel.applyTimeEnd}
- </if>
- <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
- and apply_sector = #{insAccountExcel.applySector}
- </if>
- <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
- and collection_message like concat('%',#{insAccountExcel.collectionMessage},'%')
- </if>
- <if test="insAccountExcel.fundFlow!= null and insAccountExcel.fundFlow!= ''">
- and fund_flow = #{insAccountExcel.fundFlow}
- </if>
- <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
- and fund_use = #{insAccountExcel.fundUse}
- </if>
- <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
- and apply_amount = #{insAccountExcel.applyAmount}
- </if>
- <if test="insAccountExcel.bigApplyAmount!= null and insAccountExcel.bigApplyAmount!= ''">
- and big_apply_amount = #{insAccount}
- </if>
- <if test="insAccountExcel.uplodePath!= null and insAccountExcel.uplodePath!= ''">
- and uplode_path = #{insAccountExcel.uplodePath}
- </if>
- <if test="insAccountExcel.updateBy!= null and insAccountExcel.updateBy!= ''">
- and update_by = #{insAccountExcel.updateBy}
- </if>
- <if test="insAccountExcel.createBy!= null and insAccountExcel.createBy!= ''">
- and create_by = #{insAccountExcel.createBy}
- </if>
- <if test="insAccountExcel.createTime!= null">
- and create_time >= #{insAccountExcel.createTime}
- </if>
- <if test="insAccountExcel.createTime!= null">
- and create_time <= #{insAccountExcel.createTime}
- </if>
- <if test="insAccountExcel.enterCardNum!= null and insAccountExcel.enterCardNum!= ''">
- and enter_card_num = #{insAccountExcel.enterCardNum}
- </if>
- <if test="insAccountExcel.outCardNum!= null and insAccountExcel.outCardNum!= ''">
- and out_card_num = #{insAccountExcel.outCardNum}
- </if>
- <if test="insAccountExcel.outFlag!= null and insAccountExcel.outFlag!= ''">
- and out_flag = #{insAccountExcel.outFlag}
- </if>
- <if test="insAccountExcel.outAccountQuality!= null and insAccountExcel.outAccountQuality!= ''">
- and out_account_quality = #{insAccountExcel.outAccountQuality}
- </if>
- <if test="insAccountExcel.transferFlag!= null and insAccountExcel.transferFlag!= ''">
- and transfer_flag = #{insAccountExcel.transferFlag}
- </if>
- <if test="insAccountExcel.payMethod!= null and insAccountExcel.payMethod!= ''">
- and pay_method = #{insAccountExcel.payMethod}
- </if>
- order by create_time
- desc
- </select>
- <resultMap id="InvAccountOperateVoResultMap" type="com.ydtech.modules.inv.model.vo.InvAccountOperateVo">
- <id property="accountOperateId" column="account_operate_id" jdbcType="VARCHAR"/>
- <result property="company" column="company" jdbcType="VARCHAR"/>
- <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
- <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
- <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
- <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="remark" column="remark" jdbcType="VARCHAR"/>
- <result property="label" column="label" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="selectDisburse" resultMap="InvAccountOperateVoResultMap">
- SELECT DISTINCT
- a.account_operate_id,
- DATE_FORMAT(a.create_time, '%Y-%m-%d') as create_date,
- a.fund_use,
- a.remark,
- a.apply_amount,
- a.apply_sector,
- a.company,
- a.collection_message,
- a.create_time,
- c.label as label
- from inv_account_operate a
- LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
- Left join sys_dict c on b.expenditure_details = c.value
- WHERE
- c.itemname = 'cost_type'
- AND
- a.fund_use != '往来款'
- AND collection_message LIKE '外部用户%'
- and a.revenue_outlay = '1'
- AND a.del_flag = '0'
- <if test="inAccountOperateVo.createTimeStart!= null">
- and a.create_time >= #{inAccountOperateVo.createTimeStart}
- </if>
- <if test="inAccountOperateVo.createTimeEnd!= null">
- and a.create_time <= #{inAccountOperateVo.createTimeEnd}
- </if>
- <if test="inAccountOperateVo.applySector!= null and inAccountOperateVo.applySector!= ''">
- and a.apply_sector = #{inAccountOperateVo.applySector}
- </if>
- <if test="inAccountOperateVo.collectionMessage!= null and inAccountOperateVo.collectionMessage!= ''">
- and a.collection_message like concat('%',#{inAccountOperateVo.collectionMessage},'%')
- </if>
- <if test="inAccountOperateVo.company!= null and inAccountOperateVo.company!= ''">
- and a.company like concat('%',#{inAccountOperateVo.company},'%')
- </if>
- <if test="inAccountOperateVo.fundUse!= null and inAccountOperateVo.fundUse!= ''">
- and a.fund_use = #{inAccountOperateVo.fundUse}
- </if>
- <if test="inAccountOperateVo.applyAmount!= null and inAccountOperateVo.applyAmount!= ''">
- and a.apply_amount = #{inAccountOperateVo.applyAmount}
- </if>
- <if test="inAccountOperateVo.label!= null and inAccountOperateVo.label!= ''">
- and c.label like concat('%',#{inAccountOperateVo.label},'%')
- </if>
- order by a.create_time desc
- </select>
- <select id="queryExpensesDataPage"
- resultType="com.ydtech.modules.admin.model.report.financeData.ExpensesDataDto">
- SELECT DISTINCT
- a.account_operate_id,
- DATE_FORMAT(a.create_time, '%Y-%m-%d') as transferAccountsDate,
- a.fund_use as costType,
- "" as businessSegmentsType,
- a.remark as abstracts,
- a.apply_amount as amount,
- a.apply_sector as deptName,
- a.collection_message,
- a.create_time
- from inv_account_operate a
- LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
- WHERE
- a.fund_use != '往来款'
- AND collection_message LIKE '外部用户%'
- and a.revenue_outlay = '1'
- AND a.del_flag = '0'
- <if test="vo.startDate !=null and vo.startDate != '' and vo.endDate !=null and vo.endDate != '' ">
- a.create_time BETWEEN #{vo.startDate} AND #{vo.endDate}
- </if>
- <if test="vo.costType!= null and vo.costTypee!= ''">
- and a.fund_use = #{vo.costType}
- </if>
- order by a.create_time desc
- </select>
- </mapper>
|