123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <?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.finance.mapper.TFeeMapper">
- <resultMap type="TFee" id="TFeeResult">
- <result property="fId" column="f_id"/>
- <result property="fBillno" column="f_billno"/>
- <result property="fCtrlcorpid" column="f_ctrlcorpid"/>
- <result property="fCorpid" column="f_corpid"/>
- <result property="tMblno" column="t_mblno"/>
- <result property="fAmtdr" column="f_amtdr"/>
- <result property="fAmtcr" column="f_amtcr"/>
- <result property="fBilltype" column="f_billtype"/>
- <result property="fBillstatus" column="f_billstatus"/>
- <result property="fRemarks" column="f_remarks"/>
- <result property="fAccbilldate" column="f_accbilldate"/>
- <result property="delFlag" column="del_flag"/>
- <result property="createBy" column="create_by"/>
- <result property="fDeptid" column="f_deptid"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
- <sql id="selectTFeeVo">
- select f_id, f_billno, f_ctrlcorpid, f_corpid, t_mblno, f_amtdr, f_amtcr, f_billtype, f_billstatus, f_remarks, f_accbilldate, del_flag, create_by, f_deptid, create_time, update_by, update_time from t_fee
- </sql>
- <select id="selectTFeeList" parameterType="TFee" resultMap="TFeeResult">
- <include refid="selectTFeeVo"/>
- <where>
- <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
- <if test="fCtrlcorpid != null ">and f_ctrlcorpid = #{fCtrlcorpid}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="tMblno != null and tMblno != ''">and t_mblno = #{tMblno}</if>
- <if test="fAmtdr != null ">and f_amtdr = #{fAmtdr}</if>
- <if test="fAmtcr != null ">and f_amtcr = #{fAmtcr}</if>
- <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
- <if test="fRemarks != null and fRemarks != ''">and f_remarks = #{fRemarks}</if>
- <if test="fAccbilldate != null ">and f_accbilldate = #{fAccbilldate}</if>
- <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
- </where>
- </select>
- <select id="selectTFeeById" parameterType="Long" resultMap="TFeeResult">
- <include refid="selectTFeeVo"/>
- where f_id = #{fId}
- </select>
- <insert id="insertTFee" parameterType="TFee" useGeneratedKeys="true" keyProperty="fId">
- insert into t_fee
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fBillno != null">f_billno,</if>
- <if test="fCtrlcorpid != null">f_ctrlcorpid,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="tMblno != null">t_mblno,</if>
- <if test="fAmtdr != null">f_amtdr,</if>
- <if test="fAmtcr != null">f_amtcr,</if>
- <if test="fBilltype != null and fBilltype != ''">f_billtype,</if>
- <if test="fBillstatus != null and fBillstatus != ''">f_billstatus,</if>
- <if test="fRemarks != null">f_remarks,</if>
- <if test="fAccbilldate != null">f_accbilldate,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="fDeptid != null">f_deptid,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fBillno != null">#{fBillno},</if>
- <if test="fCtrlcorpid != null">#{fCtrlcorpid},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="tMblno != null">#{tMblno},</if>
- <if test="fAmtdr != null">#{fAmtdr},</if>
- <if test="fAmtcr != null">#{fAmtcr},</if>
- <if test="fBilltype != null and fBilltype != ''">#{fBilltype},</if>
- <if test="fBillstatus != null and fBillstatus != ''">#{fBillstatus},</if>
- <if test="fRemarks != null">#{fRemarks},</if>
- <if test="fAccbilldate != null">#{fAccbilldate},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="fDeptid != null">#{fDeptid},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateTFee" parameterType="TFee">
- update t_fee
- <trim prefix="SET" suffixOverrides=",">
- <if test="fBillno != null">f_billno = #{fBillno},</if>
- <if test="fCtrlcorpid != null">f_ctrlcorpid = #{fCtrlcorpid},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="tMblno != null">t_mblno = #{tMblno},</if>
- <if test="fAmtdr != null">f_amtdr = #{fAmtdr},</if>
- <if test="fAmtcr != null">f_amtcr = #{fAmtcr},</if>
- <if test="fBilltype != null and fBilltype != ''">f_billtype = #{fBilltype},</if>
- <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
- <if test="fRemarks != null">f_remarks = #{fRemarks},</if>
- <if test="fAccbilldate != null">f_accbilldate = #{fAccbilldate},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="fDeptid != null">f_deptid = #{fDeptid},</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>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTFeeById" parameterType="Long">
- delete from t_fee where f_id = #{fId}
- </delete>
- <delete id="deleteTFeeByIds" parameterType="String">
- delete from t_fee where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <select id="warehouseBillsFeesList" resultType="java.util.Map">
- SELECT
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- w.fId AS fId,
- w.fName AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- t.f_mblno AS fMblno,
- t.f_product_name AS fProductName,
- t.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_amount AS fOldAmount,
- w.f_feeid AS fFeeid,
- f.f_name AS fFeeName,
- w.f_dc AS fDc,
- w.f_amount AS fNewAmount
- FROM
- t_warehousebills t
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_status,
- f.remark,
- c.f_id AS fId,
- c.f_name AS fName
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- <where>
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid = #{map.tWareHouseFees.fCorpid} </if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid = #{map.tWareHouseFees.fToCorpid} </if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and t.f_mblno like concat('%', #{map.tWareHouseFees.fMblno}, '%') </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%') </if>
- <choose>
- <when test="map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != '' and map.tWareHouseFees.fReconciliation == '1' ">
- and w.f_accamount_date IS NOT NULL
- </when>
- <otherwise>
- and w.f_accamount_date IS NULL
- </otherwise>
- </choose>
- <choose>
- <when test="map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != '' and map.tWareHouseFees.fDc == 'D' ">
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </when>
- <otherwise>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </otherwise>
- </choose>
- <if test="map.feeIdList != null and map.feeIdList != '' ">
- and w.f_feeid in
- <foreach collection="feeIdList" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and t.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and t.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- and t.f_review_date IS NOT NULL
- </where>
- </select>
- </mapper>
|