| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460 |
- <?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.goafanti.common.dao.TOrderPaymentMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderPayment">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="tid" jdbcType="INTEGER" property="tid" />
- <result column="node_id" jdbcType="INTEGER" property="nodeId" />
- <result column="choose_type" jdbcType="INTEGER" property="chooseType" />
- <result column="payment_type" jdbcType="INTEGER" property="paymentType" />
- <result column="company_name" jdbcType="VARCHAR" property="companyName" />
- <result column="quantity" jdbcType="INTEGER" property="quantity" />
- <result column="payment_status" jdbcType="INTEGER" property="paymentStatus" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="application_amount" jdbcType="DECIMAL" property="applicationAmount" />
- <result column="payment_amount" jdbcType="DECIMAL" property="paymentAmount" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="aname" jdbcType="VARCHAR" property="aname" />
- <result column="tpc_id" jdbcType="INTEGER" property="tpcId" />
- <result column="process_status" jdbcType="INTEGER" property="processStatus" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- id, tid, node_id, choose_type, payment_type, company_name, quantity, payment_status,
- `status`, application_amount, payment_amount, remarks, create_time, aid, aname, tpc_id,
- process_status
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- select
- <include refid="Base_Column_List" />
- from t_order_payment
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- delete from t_order_payment
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrderPayment">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- insert into t_order_payment (id, tid, node_id,
- choose_type, payment_type, company_name,
- quantity, payment_status, `status`,
- application_amount, payment_amount, remarks,
- create_time, aid, aname,
- tpc_id, process_status)
- values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{nodeId,jdbcType=INTEGER},
- #{chooseType,jdbcType=INTEGER}, #{paymentType,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR},
- #{quantity,jdbcType=INTEGER}, #{paymentStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
- #{applicationAmount,jdbcType=DECIMAL}, #{paymentAmount,jdbcType=DECIMAL}, #{remarks,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}, #{aname,jdbcType=VARCHAR},
- #{tpcId,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderPayment">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- insert into t_order_payment
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="tid != null">
- tid,
- </if>
- <if test="nodeId != null">
- node_id,
- </if>
- <if test="chooseType != null">
- choose_type,
- </if>
- <if test="paymentType != null">
- payment_type,
- </if>
- <if test="companyName != null">
- company_name,
- </if>
- <if test="quantity != null">
- quantity,
- </if>
- <if test="paymentStatus != null">
- payment_status,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="applicationAmount != null">
- application_amount,
- </if>
- <if test="paymentAmount != null">
- payment_amount,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="aname != null">
- aname,
- </if>
- <if test="tpcId != null">
- tpc_id,
- </if>
- <if test="processStatus != null">
- process_status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- #{tid,jdbcType=INTEGER},
- </if>
- <if test="nodeId != null">
- #{nodeId,jdbcType=INTEGER},
- </if>
- <if test="chooseType != null">
- #{chooseType,jdbcType=INTEGER},
- </if>
- <if test="paymentType != null">
- #{paymentType,jdbcType=INTEGER},
- </if>
- <if test="companyName != null">
- #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="quantity != null">
- #{quantity,jdbcType=INTEGER},
- </if>
- <if test="paymentStatus != null">
- #{paymentStatus,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="applicationAmount != null">
- #{applicationAmount,jdbcType=DECIMAL},
- </if>
- <if test="paymentAmount != null">
- #{paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="aname != null">
- #{aname,jdbcType=VARCHAR},
- </if>
- <if test="tpcId != null">
- #{tpcId,jdbcType=INTEGER},
- </if>
- <if test="processStatus != null">
- #{processStatus,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderPayment">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- update t_order_payment
- <set>
- <if test="tid != null">
- tid = #{tid,jdbcType=INTEGER},
- </if>
- <if test="nodeId != null">
- node_id = #{nodeId,jdbcType=INTEGER},
- </if>
- <if test="chooseType != null">
- choose_type = #{chooseType,jdbcType=INTEGER},
- </if>
- <if test="paymentType != null">
- payment_type = #{paymentType,jdbcType=INTEGER},
- </if>
- <if test="companyName != null">
- company_name = #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="quantity != null">
- quantity = #{quantity,jdbcType=INTEGER},
- </if>
- <if test="paymentStatus != null">
- payment_status = #{paymentStatus,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="applicationAmount != null">
- application_amount = #{applicationAmount,jdbcType=DECIMAL},
- </if>
- <if test="paymentAmount != null">
- payment_amount = #{paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="aname != null">
- aname = #{aname,jdbcType=VARCHAR},
- </if>
- <if test="tpcId != null">
- tpc_id = #{tpcId,jdbcType=INTEGER},
- </if>
- <if test="processStatus != null">
- process_status = #{processStatus,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderPayment">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jul 20 09:16:18 CST 2021.
- -->
- update t_order_payment
- set tid = #{tid,jdbcType=INTEGER},
- node_id = #{nodeId,jdbcType=INTEGER},
- choose_type = #{chooseType,jdbcType=INTEGER},
- payment_type = #{paymentType,jdbcType=INTEGER},
- company_name = #{companyName,jdbcType=VARCHAR},
- quantity = #{quantity,jdbcType=INTEGER},
- payment_status = #{paymentStatus,jdbcType=INTEGER},
- `status` = #{status,jdbcType=INTEGER},
- application_amount = #{applicationAmount,jdbcType=DECIMAL},
- payment_amount = #{paymentAmount,jdbcType=DECIMAL},
- remarks = #{remarks,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- aid = #{aid,jdbcType=VARCHAR},
- aname = #{aname,jdbcType=VARCHAR},
- tpc_id = #{tpcId,jdbcType=INTEGER},
- process_status = #{processStatus,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderPayment" useGeneratedKeys="true">
- insert into t_order_payment
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="tid != null">
- tid,
- </if>
- <if test="nodeId != null">
- node_id,
- </if>
- <if test="chooseType != null">
- choose_type,
- </if>
- <if test="paymentType != null">
- payment_type,
- </if>
- <if test="companyName != null">
- company_name,
- </if>
- <if test="quantity != null">
- quantity,
- </if>
- <if test="paymentStatus != null">
- payment_status,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="applicationAmount != null">
- application_amount,
- </if>
- <if test="paymentAmount != null">
- payment_amount,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="aname != null">
- aname,
- </if>
- <if test="tpcId != null">
- tpc_id,
- </if>
- <if test="processStatus != null">
- process_status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- #{tid,jdbcType=INTEGER},
- </if>
- <if test="nodeId != null">
- #{nodeId,jdbcType=INTEGER},
- </if>
- <if test="chooseType != null">
- #{chooseType,jdbcType=INTEGER},
- </if>
- <if test="paymentType != null">
- #{paymentType,jdbcType=INTEGER},
- </if>
- <if test="companyName != null">
- #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="quantity != null">
- #{quantity,jdbcType=INTEGER},
- </if>
- <if test="paymentStatus != null">
- #{paymentStatus,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="applicationAmount != null">
- #{applicationAmount,jdbcType=DECIMAL},
- </if>
- <if test="paymentAmount != null">
- #{paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="aname != null">
- #{aname,jdbcType=VARCHAR},
- </if>
- <if test="tpcId != null">
- #{tpcId,jdbcType=INTEGER},
- </if>
- <if test="processStatus != null">
- #{processStatus,jdbcType=INTEGER},
- </if>
- </trim>
- <selectKey keyProperty="id" order="AFTER" resultType="int">
- SELECT LAST_INSERT_ID()
- </selectKey>
- </insert>
- <select id="selectByidGetDetails" resultType="com.goafanti.organization.bo.outOrderPayment">
- select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name companyName,a.quantity,
- a.payment_status paymentStatus,a.status,a.payment_amount paymentAmount,a.remarks ,d.finance_name examineName,
- d.finance_name financeName ,c.order_no orderNo,a.application_amount applicationAmount
- from t_order_payment a
- left join t_order_task c on a.tid=c.id left join t_order_mid d on c.order_no=d.order_no where a.id= #{id}
- </select>
- <select id="selectByTid" resultType="com.goafanti.organization.bo.outOrderPayment">
- select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name companyName,a.quantity,choose_type chooseType,tpc.id tpcId,
- a.payment_status paymentStatus, a.status,a.payment_amount paymentAmount,a.remarks ,tpc.company_name tpcName,d.finance_name financeName ,
- c.order_no orderNo,date_format(a.create_time,'%Y-%m-%d %H:%i:%s')createTimes,a.application_amount applicationAmount
- from t_order_payment a left join t_order_task c on a.tid=c.id left join t_order_mid d on c.order_no=d.order_no
- left join third_party_company tpc on tpc.id=a.tpc_id where a.tid= #{tid}
- <if test="chooseType != null">
- and a.choose_type = #{chooseType}
- </if>
- <if test="type==1">
- and a.status in(0,1,2,3)
- </if>
- </select>
- <select id="selectList" resultType="com.goafanti.organization.bo.outOrderPayment">
- select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name companyName,a.quantity,
- a.payment_status paymentStatus, a.status,a.payment_amount paymentAmount,a.remarks , b.quantity NodeQuantity,
- b.party_amount NodePartyAmount,b.total_amount NodeTotalAmount,d.finance_name financeName ,c.order_no orderNo
- ,a.application_amount applicationAmount
- from t_order_payment a left join payment_node b on a.node_id=b.id
- left join t_order_task c on b.tid=c.id left join t_order_mid d on c.order_no=d.order_no where a.status in(0,1,2,3)
- <if test="tpcId != null">
- and a.tpc_id= #{tpcId}
- </if>
- <if test="nodeId != null">
- and a.node_id= #{nodeId}
- </if>
- <if test="chooseType != null">
- and a.choose_type= #{chooseType}
- </if>
- </select>
- <update id="updateByids">
- update t_order_payment set process_status= #{processStatus}
- where id in
- <foreach close=")" collection="list" index="" item="item" open="(" separator=",">
- #{item}
- </foreach>
- </update>
- <select id="selectByCid" resultType="java.lang.Integer">
- select count(*) from t_order_payment where tpc_id = #{tpcId}
- </select>
- <select id="selectCountByFinance" resultType="com.goafanti.common.model.FinanceCount">
- select x.aid,x.dates dateTime,count(*) paymentCount,sum(if(x.status=0,1,0))paymentUnauditedCount
- from (select d.finance_id aid,a.status ,DATE_FORMAT(a.create_time , '%Y-%m-%d') dates
- from t_order_payment a left join t_order_task b on a.tid =b.id
- left join t_order_new c on b.order_no =c.order_no
- left join department d on c.order_dep =d.id
- where c.delete_sign in (0,2,3) and a.status in (0,2,3)
- and d.finance_id = #{aid})x
- group by x.aid,x.dates
- </select>
- <delete id="deleteByParam">
- delete from t_order_payment
- where 1=1
- and tid= #{tid}
- <if test="chooseType !=null">
- and choose_type = #{chooseType}
- </if>
- </delete>
- </mapper>
|