| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848 |
- <?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.NewOrderChangeMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.NewOrderChange">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="process_state" jdbcType="INTEGER" property="processState" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="voucher_url" jdbcType="VARCHAR" property="voucherUrl" />
- <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
- <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
- <result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
- <result column="applicant" jdbcType="VARCHAR" property="applicant" />
- <result column="dep_name" jdbcType="VARCHAR" property="depName" />
- <result column="project_state" jdbcType="VARCHAR" property="projectState" />
- <result column="zxs_cost" jdbcType="DECIMAL" property="zxsCost" />
- <result column="zxs_remarks" jdbcType="VARCHAR" property="zxsRemarks" />
- <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
- <result column="payment_amount" jdbcType="DECIMAL" property="paymentAmount" />
- <result column="invoice_time" jdbcType="TIMESTAMP" property="invoiceTime" />
- <result column="invoice_amount" jdbcType="DECIMAL" property="invoiceAmount" />
- <result column="invoice_type" jdbcType="VARCHAR" property="invoiceType" />
- <result column="cw_cost" jdbcType="DECIMAL" property="cwCost" />
- <result column="refundable_amount" jdbcType="DECIMAL" property="refundableAmount" />
- <result column="cw_remarks" jdbcType="VARCHAR" property="cwRemarks" />
- <result column="estimate_cost" jdbcType="DECIMAL" property="estimateCost" />
- <result column="estimate_refundable" jdbcType="DECIMAL" property="estimateRefundable" />
- <result column="refund_Invoice" jdbcType="DECIMAL" property="refundInvoice" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- id, order_no, process_state, status, type, create_time, remarks, voucher_url, total_amount,
- settlement_amount, change_amount, applicant, dep_name, project_state, zxs_cost, zxs_remarks,
- payment_time, payment_amount, invoice_time, invoice_amount, invoice_type, cw_cost,
- refundable_amount, cw_remarks, estimate_cost, estimate_refundable, refund_Invoice
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from new_order_change
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <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 Wed Sep 18 14:33:46 CST 2019.
- -->
- select
- <include refid="Base_Column_List" />
- from new_order_change
- 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 Wed Sep 18 14:33:46 CST 2019.
- -->
- delete from new_order_change
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- delete from new_order_change
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.NewOrderChange">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- insert into new_order_change (id, order_no, process_state,
- status, type, create_time,
- remarks, voucher_url, total_amount,
- settlement_amount, change_amount, applicant,
- dep_name, project_state, zxs_cost,
- zxs_remarks, payment_time, payment_amount,
- invoice_time, invoice_amount, invoice_type,
- cw_cost, refundable_amount, cw_remarks,
- estimate_cost, estimate_refundable, refund_Invoice
- )
- values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{processState,jdbcType=INTEGER},
- #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{remarks,jdbcType=VARCHAR}, #{voucherUrl,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
- #{settlementAmount,jdbcType=DECIMAL}, #{changeAmount,jdbcType=DECIMAL}, #{applicant,jdbcType=VARCHAR},
- #{depName,jdbcType=VARCHAR}, #{projectState,jdbcType=VARCHAR}, #{zxsCost,jdbcType=DECIMAL},
- #{zxsRemarks,jdbcType=VARCHAR}, #{paymentTime,jdbcType=TIMESTAMP}, #{paymentAmount,jdbcType=DECIMAL},
- #{invoiceTime,jdbcType=TIMESTAMP}, #{invoiceAmount,jdbcType=DECIMAL}, #{invoiceType,jdbcType=VARCHAR},
- #{cwCost,jdbcType=DECIMAL}, #{refundableAmount,jdbcType=DECIMAL}, #{cwRemarks,jdbcType=VARCHAR},
- #{estimateCost,jdbcType=DECIMAL}, #{estimateRefundable,jdbcType=DECIMAL}, #{refundInvoice,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.NewOrderChange">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- insert into new_order_change
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="processState != null">
- process_state,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="voucherUrl != null">
- voucher_url,
- </if>
- <if test="totalAmount != null">
- total_amount,
- </if>
- <if test="settlementAmount != null">
- settlement_amount,
- </if>
- <if test="changeAmount != null">
- change_amount,
- </if>
- <if test="applicant != null">
- applicant,
- </if>
- <if test="depName != null">
- dep_name,
- </if>
- <if test="projectState != null">
- project_state,
- </if>
- <if test="zxsCost != null">
- zxs_cost,
- </if>
- <if test="zxsRemarks != null">
- zxs_remarks,
- </if>
- <if test="paymentTime != null">
- payment_time,
- </if>
- <if test="paymentAmount != null">
- payment_amount,
- </if>
- <if test="invoiceTime != null">
- invoice_time,
- </if>
- <if test="invoiceAmount != null">
- invoice_amount,
- </if>
- <if test="invoiceType != null">
- invoice_type,
- </if>
- <if test="cwCost != null">
- cw_cost,
- </if>
- <if test="refundableAmount != null">
- refundable_amount,
- </if>
- <if test="cwRemarks != null">
- cw_remarks,
- </if>
- <if test="estimateCost != null">
- estimate_cost,
- </if>
- <if test="estimateRefundable != null">
- estimate_refundable,
- </if>
- <if test="refundInvoice != null">
- refund_Invoice,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="processState != null">
- #{processState,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="voucherUrl != null">
- #{voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="totalAmount != null">
- #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="settlementAmount != null">
- #{settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="changeAmount != null">
- #{changeAmount,jdbcType=DECIMAL},
- </if>
- <if test="applicant != null">
- #{applicant,jdbcType=VARCHAR},
- </if>
- <if test="depName != null">
- #{depName,jdbcType=VARCHAR},
- </if>
- <if test="projectState != null">
- #{projectState,jdbcType=VARCHAR},
- </if>
- <if test="zxsCost != null">
- #{zxsCost,jdbcType=DECIMAL},
- </if>
- <if test="zxsRemarks != null">
- #{zxsRemarks,jdbcType=VARCHAR},
- </if>
- <if test="paymentTime != null">
- #{paymentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="paymentAmount != null">
- #{paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="invoiceTime != null">
- #{invoiceTime,jdbcType=TIMESTAMP},
- </if>
- <if test="invoiceAmount != null">
- #{invoiceAmount,jdbcType=DECIMAL},
- </if>
- <if test="invoiceType != null">
- #{invoiceType,jdbcType=VARCHAR},
- </if>
- <if test="cwCost != null">
- #{cwCost,jdbcType=DECIMAL},
- </if>
- <if test="refundableAmount != null">
- #{refundableAmount,jdbcType=DECIMAL},
- </if>
- <if test="cwRemarks != null">
- #{cwRemarks,jdbcType=VARCHAR},
- </if>
- <if test="estimateCost != null">
- #{estimateCost,jdbcType=DECIMAL},
- </if>
- <if test="estimateRefundable != null">
- #{estimateRefundable,jdbcType=DECIMAL},
- </if>
- <if test="refundInvoice != null">
- #{refundInvoice,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.NewOrderChangeExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- select count(*) from new_order_change
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- update new_order_change
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=INTEGER},
- </if>
- <if test="record.orderNo != null">
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- </if>
- <if test="record.processState != null">
- process_state = #{record.processState,jdbcType=INTEGER},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=INTEGER},
- </if>
- <if test="record.type != null">
- type = #{record.type,jdbcType=INTEGER},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.remarks != null">
- remarks = #{record.remarks,jdbcType=VARCHAR},
- </if>
- <if test="record.voucherUrl != null">
- voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="record.totalAmount != null">
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.settlementAmount != null">
- settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.changeAmount != null">
- change_amount = #{record.changeAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.applicant != null">
- applicant = #{record.applicant,jdbcType=VARCHAR},
- </if>
- <if test="record.depName != null">
- dep_name = #{record.depName,jdbcType=VARCHAR},
- </if>
- <if test="record.projectState != null">
- project_state = #{record.projectState,jdbcType=VARCHAR},
- </if>
- <if test="record.zxsCost != null">
- zxs_cost = #{record.zxsCost,jdbcType=DECIMAL},
- </if>
- <if test="record.zxsRemarks != null">
- zxs_remarks = #{record.zxsRemarks,jdbcType=VARCHAR},
- </if>
- <if test="record.paymentTime != null">
- payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.paymentAmount != null">
- payment_amount = #{record.paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.invoiceTime != null">
- invoice_time = #{record.invoiceTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.invoiceAmount != null">
- invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.invoiceType != null">
- invoice_type = #{record.invoiceType,jdbcType=VARCHAR},
- </if>
- <if test="record.cwCost != null">
- cw_cost = #{record.cwCost,jdbcType=DECIMAL},
- </if>
- <if test="record.refundableAmount != null">
- refundable_amount = #{record.refundableAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.cwRemarks != null">
- cw_remarks = #{record.cwRemarks,jdbcType=VARCHAR},
- </if>
- <if test="record.estimateCost != null">
- estimate_cost = #{record.estimateCost,jdbcType=DECIMAL},
- </if>
- <if test="record.estimateRefundable != null">
- estimate_refundable = #{record.estimateRefundable,jdbcType=DECIMAL},
- </if>
- <if test="record.refundInvoice != null">
- refund_Invoice = #{record.refundInvoice,jdbcType=DECIMAL},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- update new_order_change
- set id = #{record.id,jdbcType=INTEGER},
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- process_state = #{record.processState,jdbcType=INTEGER},
- status = #{record.status,jdbcType=INTEGER},
- type = #{record.type,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- remarks = #{record.remarks,jdbcType=VARCHAR},
- voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
- change_amount = #{record.changeAmount,jdbcType=DECIMAL},
- applicant = #{record.applicant,jdbcType=VARCHAR},
- dep_name = #{record.depName,jdbcType=VARCHAR},
- project_state = #{record.projectState,jdbcType=VARCHAR},
- zxs_cost = #{record.zxsCost,jdbcType=DECIMAL},
- zxs_remarks = #{record.zxsRemarks,jdbcType=VARCHAR},
- payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
- payment_amount = #{record.paymentAmount,jdbcType=DECIMAL},
- invoice_time = #{record.invoiceTime,jdbcType=TIMESTAMP},
- invoice_amount = #{record.invoiceAmount,jdbcType=DECIMAL},
- invoice_type = #{record.invoiceType,jdbcType=VARCHAR},
- cw_cost = #{record.cwCost,jdbcType=DECIMAL},
- refundable_amount = #{record.refundableAmount,jdbcType=DECIMAL},
- cw_remarks = #{record.cwRemarks,jdbcType=VARCHAR},
- estimate_cost = #{record.estimateCost,jdbcType=DECIMAL},
- estimate_refundable = #{record.estimateRefundable,jdbcType=DECIMAL},
- refund_Invoice = #{record.refundInvoice,jdbcType=DECIMAL}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.NewOrderChange">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- update new_order_change
- <set>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="processState != null">
- process_state = #{processState,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="voucherUrl != null">
- voucher_url = #{voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="totalAmount != null">
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="settlementAmount != null">
- settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="changeAmount != null">
- change_amount = #{changeAmount,jdbcType=DECIMAL},
- </if>
- <if test="applicant != null">
- applicant = #{applicant,jdbcType=VARCHAR},
- </if>
- <if test="depName != null">
- dep_name = #{depName,jdbcType=VARCHAR},
- </if>
- <if test="projectState != null">
- project_state = #{projectState,jdbcType=VARCHAR},
- </if>
- <if test="zxsCost != null">
- zxs_cost = #{zxsCost,jdbcType=DECIMAL},
- </if>
- <if test="zxsRemarks != null">
- zxs_remarks = #{zxsRemarks,jdbcType=VARCHAR},
- </if>
- <if test="paymentTime != null">
- payment_time = #{paymentTime,jdbcType=TIMESTAMP},
- </if>
- <if test="paymentAmount != null">
- payment_amount = #{paymentAmount,jdbcType=DECIMAL},
- </if>
- <if test="invoiceTime != null">
- invoice_time = #{invoiceTime,jdbcType=TIMESTAMP},
- </if>
- <if test="invoiceAmount != null">
- invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
- </if>
- <if test="invoiceType != null">
- invoice_type = #{invoiceType,jdbcType=VARCHAR},
- </if>
- <if test="cwCost != null">
- cw_cost = #{cwCost,jdbcType=DECIMAL},
- </if>
- <if test="refundableAmount != null">
- refundable_amount = #{refundableAmount,jdbcType=DECIMAL},
- </if>
- <if test="cwRemarks != null">
- cw_remarks = #{cwRemarks,jdbcType=VARCHAR},
- </if>
- <if test="estimateCost != null">
- estimate_cost = #{estimateCost,jdbcType=DECIMAL},
- </if>
- <if test="estimateRefundable != null">
- estimate_refundable = #{estimateRefundable,jdbcType=DECIMAL},
- </if>
- <if test="refundInvoice != null">
- refund_Invoice = #{refundInvoice,jdbcType=DECIMAL},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.NewOrderChange">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Sep 18 14:33:46 CST 2019.
- -->
- update new_order_change
- set order_no = #{orderNo,jdbcType=VARCHAR},
- process_state = #{processState,jdbcType=INTEGER},
- status = #{status,jdbcType=INTEGER},
- type = #{type,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- remarks = #{remarks,jdbcType=VARCHAR},
- voucher_url = #{voucherUrl,jdbcType=VARCHAR},
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
- change_amount = #{changeAmount,jdbcType=DECIMAL},
- applicant = #{applicant,jdbcType=VARCHAR},
- dep_name = #{depName,jdbcType=VARCHAR},
- project_state = #{projectState,jdbcType=VARCHAR},
- zxs_cost = #{zxsCost,jdbcType=DECIMAL},
- zxs_remarks = #{zxsRemarks,jdbcType=VARCHAR},
- payment_time = #{paymentTime,jdbcType=TIMESTAMP},
- payment_amount = #{paymentAmount,jdbcType=DECIMAL},
- invoice_time = #{invoiceTime,jdbcType=TIMESTAMP},
- invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
- invoice_type = #{invoiceType,jdbcType=VARCHAR},
- cw_cost = #{cwCost,jdbcType=DECIMAL},
- refundable_amount = #{refundableAmount,jdbcType=DECIMAL},
- cw_remarks = #{cwRemarks,jdbcType=VARCHAR},
- estimate_cost = #{estimateCost,jdbcType=DECIMAL},
- estimate_refundable = #{estimateRefundable,jdbcType=DECIMAL},
- refund_Invoice = #{refundInvoice,jdbcType=DECIMAL}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByorderNo" resultType="com.goafanti.order.bo.NewOrderChangeBo">
- select
- a.id, a.order_no orderNo, a.process_state processState, a.status, a.`type`,a.refundable_amount refundableAmount,
- date_format(a.create_time, '%Y-%m-%d %H:%i:%S')createTimes, a.remarks, a.voucher_url voucherUrl,a.cw_cost cwCost,
- a.total_amount totalAmount, a.settlement_amount settlementAmount, (a.total_amount-a.settlement_amount) arrears,
- a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
- a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
- date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
- a.cw_remarks cwRemarks from new_order_change a where 1 = 1
- and a.order_no= #{orderNo}
- order by a.create_time desc
- limit 1
- </select>
-
- <select id="selectById" resultType="com.goafanti.order.bo.NewOrderChangeBo">
- select
- a.id, a.order_no orderNo, a.process_state processState, a.status, a.`type`,a.refundable_amount refundableAmount,
- date_format(a.create_time, '%Y-%m-%d %H:%i:%S')createTimes, a.remarks, a.voucher_url voucherUrl,a.cw_cost cwCost,
- a.total_amount totalAmount, a.settlement_amount settlementAmount, (a.total_amount-a.settlement_amount) arrears,
- a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
- a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
- date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
- a.cw_remarks cwRemarks,a.estimate_cost estimateCost,estimate_refundable estimateRefundable,refund_Invoice refundInvoice
- from new_order_change a where 1 = 1 and a.id= #{id}
- </select>
- <select id="checkOderNo" resultType="java.lang.Integer">
- select count(*) from new_order_change
- where status != 4 and order_no= #{orderNo}
- </select>
- <select id="selectOrderChangeList" resultType="com.goafanti.order.bo.NewOderCahngeListBo">
- select a.id,a.order_no orderNo,b.contract_no contractNo, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes,c.nickname,b.order_type orderType,
- date_format(b.create_time,'%Y-%m-%d %H:%i:%S')establishTimes, b.order_status orderStatus,b.total_amount totalAmount,a.status ,
- b.settlement_amount settlementAmount,(b.total_amount-b.settlement_amount) arrears,d.name salesmanName,e.name depName,a.`type`,
- a.process_state processState from new_order_change a left join t_order_new b on a.order_no=b.order_no
- left join user c on b.buyer_id=c.id left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
- <if test="processState==2 or processState==3 ">
- left join t_order_task x on a.order_no=x.order_no
- </if>
- where 1=1
- <if test="processState==0">
- and b.salesman_id= #{aid}
- </if>
- <if test="processState==1">
- and b.order_dep in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="processState==2 ">
- and x.consultant_id=#{aid} and process_state >= 2
- </if>
- <if test="processState==3 ">
- and x.manager_id=#{aid} and process_state >= 3
- </if>
- <if test="processState==5">
- and e.finance_id =#{aid}
- </if>
- <if test="userName !=null">
- and c.nickname like concat('%',#{userName},'%')
- </if>
- <if test="orderNo !=null">
- and a.order_no like concat('%',#{orderNo},'%')
- </if>
- <if test="contractNo !=null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="type !=null">
- and a.type = #{type}
- </if>
- <if test="timeType == 0 and startTime !=null and endTime !=null">
- and a.create_time between #{startTime} and #{endTime}
- </if>
- <if test="timeType == 1 and startTime !=null and endTime !=null">
- and b.create_time between #{startTime} and #{endTime}
- </if>
- <if test="depId !=null">
- and b.order_dep = #{depId}
- </if>
- <if test="salesmanName !=null">
- and d.name like concat('%',#{salesmanName},'%')
- </if>
- <if test="complete ==0 and processState != 8">
- and a.process_state >= #{processState}
- </if>
- <if test="complete ==0 and processState == 8">
- and a.process_state >= #{processState} and a.process_state < 9
- </if>
- <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
- and a.process_state = #{processState}
- </if>
- <if test="complete ==1 and processState == 5">
- and a.process_state in(5,9) and a.status !=4
- </if>
- <if test="complete ==1 and processState == 7">
- and a.process_state = 7 and a.status != 4 and a.status !=2
- </if>
- <if test="complete ==1 and processState == 8">
- and a.process_state = #{processState} and a.status != 4 and a.status !=2
- </if>
- <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
- and a.process_state > #{processState}
- </if>
- <if test="complete ==2 and processState == 5">
- and (a.process_state > 5 and a.process_state < 9) or (a.process_state =9 and a.status=4)
- </if>
- <if test="complete ==2 and processState == 7">
- and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state > 7)
- </if>
- <if test="complete ==2 and processState == 8">
- and a.process_state = 8 and (a.status = 4 or a.status = 2)
- </if>
- <if test="complete ==3">
- and a.status = 2
- </if>
- order by a.create_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectOrderChangeCount" resultType="java.lang.Integer">
- select count(*) from new_order_change a left join t_order_new b on a.order_no=b.order_no left join user c on b.buyer_id=c.id
- left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
- <if test="processState==2 or processState==3 ">
- left join t_order_task x on a.order_no=x.order_no
- </if>
- where 1=1
- <if test="processState==0">
- and b.salesman_id= #{aid}
- </if>
- <if test="processState==1">
- and b.order_dep in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="processState==2 ">
- and x.consultant_id=#{aid} and process_state >= 2
- </if>
- <if test="processState==3 ">
- and x.manager_id=#{aid} and process_state >= 3
- </if>
- <if test="processState==5">
- and e.finance_id =#{aid}
- </if>
- <if test="userName !=null">
- and c.nickname like concat('%',#{userName},'%')
- </if>
- <if test="timeType == 0 and startTime !=null and endTime !=null">
- and a.create_time between #{startTime} and #{endTime}
- </if>
- <if test="timeType == 1 and startTime !=null and endTime !=null">
- and b.create_time between #{startTime} and #{endTime}
- </if>
- <if test="depId !=null">
- and b.order_dep = #{depId}
- </if>
- <if test="orderNo !=null">
- and a.order_no like concat('%',#{orderNo},'%')
- </if>
- <if test="contractNo !=null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="type !=null">
- and a.type = #{type}
- </if>
- <if test="salesmanName !=null">
- and d.name like concat('%',#{salesmanName},'%')
- </if>
- <if test="complete ==0 and processState != 8">
- and a.process_state >= #{processState}
- </if>
- <if test="complete ==0 and processState == 8">
- and a.process_state >= #{processState} and a.process_state < 9
- </if>
- <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
- and a.process_state = #{processState}
- </if>
- <if test="complete ==1 and processState == 5">
- and a.process_state in(5,9) and a.status !=4
- </if>
- <if test="complete ==1 and processState == 7">
- and a.process_state = 7 and a.status != 4 and a.status !=2
- </if>
- <if test="complete ==1 and processState == 8">
- and a.process_state = #{processState} and a.status != 4 and a.status !=2
- </if>
- <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
- and a.process_state > #{processState}
- </if>
- <if test="complete ==2 and processState == 5">
- and (a.process_state > 5 and a.process_state < 9) or (a.process_state =9 and a.status=4)
- </if>
- <if test="complete ==2 and processState == 7">
- and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state > 7)
- </if>
- <if test="complete ==2 and processState == 8">
- and a.process_state = 8 and (a.status = 4 or a.status = 2)
- </if>
- <if test="complete ==3">
- and a.status = 2
- </if>
- </select>
- <update id="addRefundInvoice" >
- update new_order_change
- set `refund_Invoice`=ifnull(`refund_Invoice`,0)+ #{amount}
- where order_no= #{orderNo}
- </update>
- <update id="subtractRefundInvoice">
- update new_order_change
- set `refund_Invoice`=ifnull(`refund_Invoice`,0)- #{amount}
- where order_no= #{orderNo}
- </update>
- </mapper>
|