123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- <?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.ruoyi.orderManagement.finance.mapper.FTmsaccbillsMapper">
-
- <resultMap type="FTmsaccbills" id="FTmsaccbillsResult">
- <result property="id" column="id" />
- <result property="accYear" column="acc_year" />
- <result property="accMonth" column="acc_month" />
- <result property="actId" column="act_id" />
- <result property="billNo" column="bill_no" />
- <result property="corpId" column="corp_id" />
- <result property="transactId" column="transact_id" />
- <result property="fromDate" column="from_date" />
- <result property="toDate" column="to_date" />
- <result property="amt" column="amt" />
- <result property="refNo" column="ref_no" />
- <result property="postDate" column="post_date" />
- <result property="billStatus" column="bill_status" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remarks" column="remarks" />
- <result property="fCtrlcorpid" column="f_ctrlcorpid" />
- <result property="tMblno" column="t_mblno" />
- <result property="fBilltype" column="f_billtype" />
- <result property="fAccbilldate" column="f_accbilldate" />
- <result property="fBillno" column="f_billno" />
- <result property="chargingMethod" column="charging_method"/>
- <result property="invoiceNo" column="invoice_no"/>
- <result property="bank" column="bank"/>
- <result property="waterBillNo" column="water_bill_no"/>
- <result property="fCorpid" column="f_corpid"/>
- </resultMap>
- <sql id="selectFTmsaccbillsVo">
- select id, acc_year, acc_month, act_id, bill_no, corp_id, transact_id, from_date, to_date, amt, ref_no, post_date, bill_status, del_flag, create_by, create_time, update_by, update_time, remarks ,
- f_ctrlcorpid ,t_mblno ,f_billtype,f_accbilldate,f_billno,charging_method ,invoice_no , bank , water_bill_no ,f_corpid from F_TMSACCBILLS
- </sql>
- <select id="selectFTmsaccbillsList" parameterType="FTmsaccbills" resultMap="FTmsaccbillsResult">
- <include refid="selectFTmsaccbillsVo"/>
- <where>
- <if test="accYear != null "> and acc_year = #{accYear}</if>
- <if test="accMonth != null "> and acc_month = #{accMonth}</if>
- <if test="actId != null "> and act_id = #{actId}</if>
- <if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
- <if test="corpId != null "> and corp_id = #{corpId}</if>
- <if test="transactId != null "> and transact_id = #{transactId}</if>
- <if test="fromDate != null "> and from_date = #{fromDate}</if>
- <if test="toDate != null "> and to_date = #{toDate}</if>
- <if test="amt != null "> and amt = #{amt}</if>
- <if test="refNo != null and refNo != ''"> and ref_no = #{refNo}</if>
- <if test="postDate != null "> and post_date = #{postDate}</if>
- <if test="billStatus != null "> and bill_status = #{billStatus}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- <if test="chargingMethod != null ">and charging_method = #{chargingMethod}</if>
- <if test="invoiceNo != null ">and invoice_no = #{invoiceNo}</if>
- <if test="bank != null ">and bank = #{bank}</if>
- <if test="waterBillNo != null ">and water_bill_no = #{waterBillNo}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and f_accbilldate <= #{timeInterval[1]}
- </if>
- </where>
- </select>
-
- <select id="selectFTmsaccbillsById" parameterType="Long" resultMap="FTmsaccbillsResult">
- <include refid="selectFTmsaccbillsVo"/>
- where id = #{id}
- </select>
- <insert id="insertFTmsaccbills" parameterType="FTmsaccbills" useGeneratedKeys="true" keyProperty="id">
- insert into F_TMSACCBILLS
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="accYear != null">acc_year,</if>
- <if test="accMonth != null">acc_month,</if>
- <if test="actId != null">act_id,</if>
- <if test="billNo != null">bill_no,</if>
- <if test="corpId != null">corp_id,</if>
- <if test="transactId != null">transact_id,</if>
- <if test="fromDate != null">from_date,</if>
- <if test="toDate != null">to_date,</if>
- <if test="amt != null">amt,</if>
- <if test="refNo != null">ref_no,</if>
- <if test="postDate != null">post_date,</if>
- <if test="billStatus != null">bill_status,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remarks != null">remarks,</if>
- <if test="fCtrlcorpid != null">f_ctrlcorpid,</if>
- <if test="tMblno != null">t_mblno,</if>
- <if test="fBilltype != null">f_billtype,</if>
- <if test="fAccbilldate != null">f_accbilldate,</if>
- <if test="fBillno != null">f_billno,</if>
- <if test="chargingMethod != null">charging_method,</if>
- <if test="invoiceNo != null">invoice_no,</if>
- <if test="bank != null">bank,</if>
- <if test="waterBillNo != null">water_bill_no,</if>
- <if test="fCorpid != null">f_corpid,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="accYear != null">#{accYear},</if>
- <if test="accMonth != null">#{accMonth},</if>
- <if test="actId != null">#{actId},</if>
- <if test="billNo != null">#{billNo},</if>
- <if test="corpId != null">#{corpId},</if>
- <if test="transactId != null">#{transactId},</if>
- <if test="fromDate != null">#{fromDate},</if>
- <if test="toDate != null">#{toDate},</if>
- <if test="amt != null">#{amt},</if>
- <if test="refNo != null">#{refNo},</if>
- <if test="postDate != null">#{postDate},</if>
- <if test="billStatus != null">#{billStatus},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="fCtrlcorpid != null">#{fCtrlcorpid},</if>
- <if test="tMblno != null">#{tMblno},</if>
- <if test="fBilltype != null">#{fBilltype},</if>
- <if test="fAccbilldate != null">#{fAccbilldate},</if>
- <if test="fBillno != null">#{fBillno},</if>
- <if test="chargingMethod != null">#{chargingMethod},</if>
- <if test="invoiceNo != null">#{invoiceNo},</if>
- <if test="bank != null">#{bank},</if>
- <if test="waterBillNo != null">#{waterBillNo},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- </trim>
- </insert>
- <update id="updateFTmsaccbills" parameterType="FTmsaccbills">
- update F_TMSACCBILLS
- <trim prefix="SET" suffixOverrides=",">
- <if test="accYear != null">acc_year = #{accYear},</if>
- <if test="accMonth != null">acc_month = #{accMonth},</if>
- <if test="actId != null">act_id = #{actId},</if>
- <if test="billNo != null">bill_no = #{billNo},</if>
- <if test="corpId != null">corp_id = #{corpId},</if>
- <if test="transactId != null">transact_id = #{transactId},</if>
- <if test="fromDate != null">from_date = #{fromDate},</if>
- <if test="toDate != null">to_date = #{toDate},</if>
- <if test="amt != null">amt = #{amt},</if>
- <if test="refNo != null">ref_no = #{refNo},</if>
- <if test="postDate != null">post_date = #{postDate},</if>
- <if test="billStatus != null">bill_status = #{billStatus},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="chargingMethod != null">charging_method = #{chargingMethod},</if>
- <if test="invoiceNo != null">invoice_no = #{invoiceNo},</if>
- <if test="bank != null">bank = #{bank},</if>
- <if test="waterBillNo != null">water_bill_no = #{waterBillNo},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFTmsaccbillsById" parameterType="Long">
- delete from F_TMSACCBILLS where id = #{id}
- </delete>
- <delete id="deleteFTmsaccbillsByIds" parameterType="String">
- delete from F_TMSACCBILLS where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="fTmsaccbillsListAccamount" resultType="java.util.Map">
- SELECT
- t.id AS fSrcpid,
- c1.f_name AS fName,
- w.f_id AS fSrcid,
- c.f_name AS fFeesName,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.create_time AS createTime,
- w.act_id AS actId,
- dict.dict_label AS billType,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitprice,
- w.f_amount AS fAmount,
- w.f_feeUnitid AS fFeeUnitid,
- t.load_date AS loadDate,
- t.un_load_date AS unLoadDate
- FROM
- F_TMSORDERBILLSFEES w
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN t_corps AS c ON w.f_corpid = c.f_id
- LEFT JOIN F_TMSORDERBILLS AS t ON w.org_id = t.id
- LEFT JOIN t_corps AS c1 ON t.corp_id = c1.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = t.bill_type
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_billType'
- <if test="fCorpid != null and fCorpid != ''">and t.corp_id = #{ fCorpid} </if>
- <if test="fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{ fToCorpid} </if>
- <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{ fMblno}, '%') </if>
- <if test="fStatementNo != null and fStatementNo != ''">and w.f_statement_no like concat('%', #{ fStatementNo}, '%') </if>
- <if test='fReconciliation != null and fReconciliation != "" and fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test=' fDc != null and fDc != "" and fDc == "D" '>
- and w.f_dc = #{ fDc}
- </if>
- <if test=' fDc != null and fDc != "" and fDc == "C" '>
- and w.f_dc = #{ fDc}
- </if>
- <if test=" fFeeid != null and fFeeid != '' ">
- and w.f_feeid in
- <foreach collection=" fFeeid" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test=' timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
- and w.f_review_date >= #{ timeExamine[0]}
- </if>
- <if test=' timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
- and w.f_review_date <= #{ timeExamine[1]}
- </if>
- <if test=' timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and t.f_bsdate >= #{ timeInterval[0]}
- </if>
- <if test=' timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and t.f_bsdate <= #{ timeInterval[1]}
- </if>
- <if test=' timeReconci != null and timeReconci[0] != null and timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{ timeReconci[0]}
- </if>
- <if test=' timeReconci != null and timeReconci[1] != null and timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{ timeReconci[1]}
- </if>
- <if test=" fBusinessType != null and fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection=" fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) != 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="fTmsaccbillsList" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.id AS fSrcpid ,
- t.corp_id AS fCorpid,
- c1.f_name AS fName,
- c.f_id AS fId,
- c.f_name AS fFeesName,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.create_time AS fBsdate,
- w.act_id AS fBilltype,
- dict.dict_label AS billType,
- w.f_feeid AS fFeeid,
- w.src_bill_no AS srcBillNo,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt
- FROM
- f_tmsorderbillsfees w
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN t_corps AS c ON w.f_corpid = c.f_id
- LEFT JOIN f_tmsorderbills AS t ON w.org_id = t.id
- LEFT JOIN t_corps AS c1 ON t.corp_id = c1.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = t.bill_type
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_billType'
- <if test=" fCorpid != null and fCorpid != ''">and t.corp_id = #{ fCorpid} </if>
- <if test=" fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{ fToCorpid} </if>
- <if test=" fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{ fMblno}, '%') </if>
- <if test=" fStatementNo != null and fStatementNo != ''">and w.f_statement_no like concat('%', #{ fStatementNo}, '%') </if>
- <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test=' fDc != null and fDc != "" and fDc == "D" '>
- and w.f_dc = #{ fDc}
- </if>
- <if test=' fDc != null and fDc != "" and fDc == "C" '>
- and w.f_dc = #{ fDc}
- </if>
- <if test=" fFeeid != null and fFeeid != '' ">
- and w.f_feeid in
- <foreach collection=" fFeeid" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test=' timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
- and w.f_review_date >= #{ timeExamine[0]}
- </if>
- <if test=' timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
- and w.f_review_date <= #{ timeExamine[1]}
- </if>
- <if test=' timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and t.f_bsdate >= #{ timeInterval[0]}
- </if>
- <if test=' timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and t.f_bsdate <= #{ timeInterval[1]}
- </if>
- <if test=' timeReconci != null and timeReconci[0] != null and timeReconci[0]!= ""'>
- and w.f_stlamount_date >= #{ timeReconci[0]}
- </if>
- <if test=' timeReconci != null and timeReconci[1] != null and timeReconci[1]!= ""'>
- and w.f_stlamount_date <= #{ timeReconci[1]}
- </if>
- and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="selectFTmsaccbillsMapList" parameterType="FTmsaccbills" resultType="java.util.Map">
- SELECT
- f.id AS fId,
- f.bill_no AS fBillno,
- f.f_ctrlcorpid AS fCtrlcorpid,
- f.corp_id AS fCorpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate AS fAccbilldate,
- f.t_mblno AS tMblno,
- f.amt AS fAmtdr,
- f.f_billtype AS fBilltype,
- f.bill_status AS fBillstatus,
- f.remarks AS fRemarks,
- f.create_by AS createBy
- FROM
- F_TMSACCBILLS f
- LEFT JOIN t_corps AS c ON f.corp_id = c.f_id
- <where>
- <if test="actId != null "> and f.act_id = #{actId}</if>
- <if test="billNo != null and billNo != ''"> and f.bill_no = #{billNo}</if>
- <if test="corpId != null "> and f.corp_id = #{corpId}</if>
- <if test="fromDate != null "> and f.from_date = #{fromDate}</if>
- <if test="toDate != null "> and f.to_date = #{toDate}</if>
- <if test="amt != null "> and f.amt = #{amt}</if>
- <if test="refNo != null and refNo != ''"> and f.ref_no = #{refNo}</if>
- <if test="postDate != null "> and f.post_date = #{postDate}</if>
- <if test="billStatus != null "> and f.bill_status = #{billStatus}</if>
- <if test="remarks != null and remarks != ''"> and f.remarks = #{remarks}</if>
- </where>
- </select>
- </mapper>
|