123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <?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.warehouseBusiness.mapper.TWarehouseAgreementMapper">
- <resultMap type="TWarehouseAgreement" id="TWarehouseAgreementResult">
- <result property="fId" column="f_id"/>
- <result property="fBillno" column="f_billno"/>
- <result property="fContractno" column="f_contractno"/>
- <result property="fDeptid" column="f_deptid"/>
- <result property="fCorpid" column="f_corpid"/>
- <result property="fGoodsid" column="f_goodsid"/>
- <result property="fStltypeid" column="f_stltypeid"/>
- <result property="fFeetypeid" column="f_feetypeid"/>
- <result property="tPackages" column="t_packages"/>
- <result property="fTrademodeid" column="f_trademodeid"/>
- <result property="fFreedays" column="f_freedays"/>
- <result property="fBegindate" column="f_begindate"/>
- <result property="fEnddate" column="f_enddate"/>
- <result property="fBillstatus" column="f_billstatus"/>
- <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="remark" column="remark"/>
- </resultMap>
- <sql id="selectTWarehouseAgreementVo">
- select f_id, f_billno,f_contractno, f_deptid, f_corpid, f_stltypeid, f_feetypeid, t_packages, f_trademodeid, f_freedays, f_begindate, f_enddate, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse_agreement
- </sql>
- <select id="selectTWarehouseAgreementList" parameterType="TWarehouseAgreement"
- resultMap="TWarehouseAgreementResult">
- <include refid="selectTWarehouseAgreementVo"/>
- <where>
- <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
- <if test="fContractno != null and fContractno != ''">and f_contractno = #{fContractno}</if>
- <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
- <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
- <if test="fFeetypeid != null ">and f_feetypeid = #{fFeetypeid}</if>
- <if test="tPackages != null and tPackages != ''">and t_packages = #{tPackages}</if>
- <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
- <if test="fFreedays != null ">and f_freedays = #{fFreedays}</if>
- <if test="fBegindate != null ">and f_begindate = #{fBegindate}</if>
- <if test="fEnddate != null ">and f_enddate = #{fEnddate}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
- </where>
- </select>
- <select id="selectTWarehouseAgreementList1" parameterType="TWarehouseAgreement"
- resultType="Map" >
- SELECT DISTINCT
- agre.f_id AS fId,
- corp.f_name AS fCorpid,
- agre.f_contractno AS fContractno,
- goods.f_name AS fGoodsid,
- agre.f_begindate AS fBegindate,
- agre.f_enddate AS fEnddate,
- agre.f_feetypeid AS fFeetypeid,
- agre.f_billstatus AS fBillstatus
- FROM
- t_warehouse_agreement agre
- LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
- LEFT JOIN t_goods goods ON goods.f_id = agre.f_goodsid
- <where>
- <if test="fBillno != null and fBillno != ''">and agre.f_billno = #{fBillno}</if>
- <if test="fContractno != null and fContractno != ''">and agre.f_contractno = #{fContractno}</if>
- <if test="fDeptid != null ">and agre.f_deptid = #{fDeptid}</if>
- <if test="fCorpid != null ">and agre.f_corpid = #{fCorpid}</if>
- <if test="fGoodsid != null">and agre.f_goodsid = #{fGoodsid}</if>
- <if test="fStltypeid != null ">and agre.f_stltypeid = #{fStltypeid}</if>
- <if test="fFeetypeid != null ">and agre.f_feetypeid = #{fFeetypeid}</if>
- <if test="tPackages != null and tPackages != ''">and agre.t_packages = #{tPackages}</if>
- <if test="fTrademodeid != null ">and agre.f_trademodeid = #{fTrademodeid}</if>
- <if test="fFreedays != null ">and agre.f_freedays = #{fFreedays}</if>
- <if test="fBegindate != null ">and agre.f_begindate = #{fBegindate}</if>
- <if test="fEnddate != null ">and agre.f_enddate = #{fEnddate}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and agre.f_billstatus = #{fBillstatus}</if>
- </where>
- </select>
- <select id="selectTWarehouseAgreementById" parameterType="Long" resultMap="TWarehouseAgreementResult">
- <include refid="selectTWarehouseAgreementVo"/>
- where f_id = #{fId}
- </select>
- <insert id="insertTWarehouseAgreement" parameterType="TWarehouseAgreement" useGeneratedKeys="true"
- keyProperty="fId">
- insert into t_warehouse_agreement
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fBillno != null and fBillno != ''">f_billno,</if>
- <if test="fContractno != null and fContractno != ''">f_contractno,</if>
- <if test="fDeptid != null">f_deptid,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="fGoodsid != null">f_goodsid,</if>
- <if test="fStltypeid != null">f_stltypeid,</if>
- <if test="fFeetypeid != null">f_feetypeid,</if>
- <if test="tPackages != null">t_packages,</if>
- <if test="fTrademodeid != null">f_trademodeid,</if>
- <if test="fFreedays != null">f_freedays,</if>
- <if test="fBegindate != null">f_begindate,</if>
- <if test="fEnddate != null">f_enddate,</if>
- <if test="fBillstatus != null">f_billstatus,</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="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fBillno != null and fBillno != ''">#{fBillno},</if>
- <if test="fContractno != null and fContractno != ''">#{fContractno},</if>
- <if test="fDeptid != null">#{fDeptid},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="fGoodsid != null">#{fGoodsid},</if>
- <if test="fStltypeid != null">#{fStltypeid},</if>
- <if test="fFeetypeid != null">#{fFeetypeid},</if>
- <if test="tPackages != null">#{tPackages},</if>
- <if test="fTrademodeid != null">#{fTrademodeid},</if>
- <if test="fFreedays != null">#{fFreedays},</if>
- <if test="fBegindate != null">#{fBegindate},</if>
- <if test="fEnddate != null">#{fEnddate},</if>
- <if test="fBillstatus != null">#{fBillstatus},</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="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTWarehouseAgreement" parameterType="TWarehouseAgreement">
- update t_warehouse_agreement
- <trim prefix="SET" suffixOverrides=",">
- <if test="fBillno != null and fBillno != ''">f_billno = #{fBillno},</if>
- <if test="fContractno != null and fContractno != ''">f_billno = #{fContractno},</if>
- <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
- <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
- <if test="fFeetypeid != null">f_feetypeid = #{fFeetypeid},</if>
- <if test="tPackages != null">t_packages = #{tPackages},</if>
- <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
- <if test="fFreedays != null">f_freedays = #{fFreedays},</if>
- <if test="fBegindate != null">f_begindate = #{fBegindate},</if>
- <if test="fEnddate != null">f_enddate = #{fEnddate},</if>
- <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</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="remark != null">remark = #{remark},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTWarehouseAgreementById" parameterType="Long">
- delete from t_warehouse_agreement where f_id = #{fId}
- </delete>
- <delete id="deleteTWarehouseAgreementByIds" parameterType="String">
- delete from t_warehouse_agreement where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- </mapper>
|