| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777 |
- <?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.TOrderInvoiceMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderInvoice">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="reject_reason" jdbcType="VARCHAR" property="rejectReason" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
- <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
- <result column="tax_number" jdbcType="VARCHAR" property="taxNumber" />
- <result column="amount" jdbcType="DECIMAL" property="amount" />
- <result column="banks" jdbcType="VARCHAR" property="banks" />
- <result column="content" jdbcType="VARCHAR" property="content" />
- <result column="unit_address" jdbcType="VARCHAR" property="unitAddress" />
- <result column="invoice_remarks" jdbcType="VARCHAR" property="invoiceRemarks" />
- <result column="unit_mobile" jdbcType="VARCHAR" property="unitMobile" />
- <result column="voucher_url" jdbcType="VARCHAR" property="voucherUrl" />
- <result column="post" jdbcType="INTEGER" property="post" />
- <result column="addressee" jdbcType="VARCHAR" property="addressee" />
- <result column="addressee_mobile" jdbcType="VARCHAR" property="addresseeMobile" />
- <result column="addressee_province" jdbcType="INTEGER" property="addresseeProvince" />
- <result column="addressee_city" jdbcType="INTEGER" property="addresseeCity" />
- <result column="addressee_area" jdbcType="INTEGER" property="addresseeArea" />
- <result column="recipient_address" jdbcType="VARCHAR" property="recipientAddress" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="approval" jdbcType="INTEGER" property="approval" />
- <result column="already_amount" jdbcType="DECIMAL" property="alreadyAmount" />
- </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 Fri May 17 09:46:50 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 Fri May 17 09:46:50 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 Fri May 17 09:46:50 CST 2019.
- -->
- id, order_no, type, status, reject_reason, remarks, invoice_type, unit_name, tax_number,
- amount, banks, content, unit_address, invoice_remarks, unit_mobile, voucher_url,
- post, addressee, addressee_mobile, addressee_province, addressee_city, addressee_area,
- recipient_address, create_time, update_time, approval, already_amount
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_order_invoice
- <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 Fri May 17 09:46:50 CST 2019.
- -->
- select
- <include refid="Base_Column_List" />
- from t_order_invoice
- 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 Fri May 17 09:46:50 CST 2019.
- -->
- delete from t_order_invoice
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- delete from t_order_invoice
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrderInvoice">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- insert into t_order_invoice (id, order_no, type,
- status, reject_reason, remarks,
- invoice_type, unit_name, tax_number,
- amount, banks, content,
- unit_address, invoice_remarks, unit_mobile,
- voucher_url, post, addressee,
- addressee_mobile, addressee_province, addressee_city,
- addressee_area, recipient_address, create_time,
- update_time, approval, already_amount
- )
- values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
- #{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
- #{invoiceType,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
- #{amount,jdbcType=DECIMAL}, #{banks,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
- #{unitAddress,jdbcType=VARCHAR}, #{invoiceRemarks,jdbcType=VARCHAR}, #{unitMobile,jdbcType=VARCHAR},
- #{voucherUrl,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, #{addressee,jdbcType=VARCHAR},
- #{addresseeMobile,jdbcType=VARCHAR}, #{addresseeProvince,jdbcType=INTEGER}, #{addresseeCity,jdbcType=INTEGER},
- #{addresseeArea,jdbcType=INTEGER}, #{recipientAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{updateTime,jdbcType=TIMESTAMP}, #{approval,jdbcType=INTEGER}, #{alreadyAmount,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderInvoice">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- insert into t_order_invoice
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="rejectReason != null">
- reject_reason,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="invoiceType != null">
- invoice_type,
- </if>
- <if test="unitName != null">
- unit_name,
- </if>
- <if test="taxNumber != null">
- tax_number,
- </if>
- <if test="amount != null">
- amount,
- </if>
- <if test="banks != null">
- banks,
- </if>
- <if test="content != null">
- content,
- </if>
- <if test="unitAddress != null">
- unit_address,
- </if>
- <if test="invoiceRemarks != null">
- invoice_remarks,
- </if>
- <if test="unitMobile != null">
- unit_mobile,
- </if>
- <if test="voucherUrl != null">
- voucher_url,
- </if>
- <if test="post != null">
- post,
- </if>
- <if test="addressee != null">
- addressee,
- </if>
- <if test="addresseeMobile != null">
- addressee_mobile,
- </if>
- <if test="addresseeProvince != null">
- addressee_province,
- </if>
- <if test="addresseeCity != null">
- addressee_city,
- </if>
- <if test="addresseeArea != null">
- addressee_area,
- </if>
- <if test="recipientAddress != null">
- recipient_address,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="approval != null">
- approval,
- </if>
- <if test="alreadyAmount != null">
- already_amount,
- </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="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="rejectReason != null">
- #{rejectReason,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="invoiceType != null">
- #{invoiceType,jdbcType=INTEGER},
- </if>
- <if test="unitName != null">
- #{unitName,jdbcType=VARCHAR},
- </if>
- <if test="taxNumber != null">
- #{taxNumber,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DECIMAL},
- </if>
- <if test="banks != null">
- #{banks,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- #{content,jdbcType=VARCHAR},
- </if>
- <if test="unitAddress != null">
- #{unitAddress,jdbcType=VARCHAR},
- </if>
- <if test="invoiceRemarks != null">
- #{invoiceRemarks,jdbcType=VARCHAR},
- </if>
- <if test="unitMobile != null">
- #{unitMobile,jdbcType=VARCHAR},
- </if>
- <if test="voucherUrl != null">
- #{voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="post != null">
- #{post,jdbcType=INTEGER},
- </if>
- <if test="addressee != null">
- #{addressee,jdbcType=VARCHAR},
- </if>
- <if test="addresseeMobile != null">
- #{addresseeMobile,jdbcType=VARCHAR},
- </if>
- <if test="addresseeProvince != null">
- #{addresseeProvince,jdbcType=INTEGER},
- </if>
- <if test="addresseeCity != null">
- #{addresseeCity,jdbcType=INTEGER},
- </if>
- <if test="addresseeArea != null">
- #{addresseeArea,jdbcType=INTEGER},
- </if>
- <if test="recipientAddress != null">
- #{recipientAddress,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="approval != null">
- #{approval,jdbcType=INTEGER},
- </if>
- <if test="alreadyAmount != null">
- #{alreadyAmount,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- select count(*) from t_order_invoice
- <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 Fri May 17 09:46:50 CST 2019.
- -->
- update t_order_invoice
- <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.type != null">
- type = #{record.type,jdbcType=INTEGER},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=INTEGER},
- </if>
- <if test="record.rejectReason != null">
- reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
- </if>
- <if test="record.remarks != null">
- remarks = #{record.remarks,jdbcType=VARCHAR},
- </if>
- <if test="record.invoiceType != null">
- invoice_type = #{record.invoiceType,jdbcType=INTEGER},
- </if>
- <if test="record.unitName != null">
- unit_name = #{record.unitName,jdbcType=VARCHAR},
- </if>
- <if test="record.taxNumber != null">
- tax_number = #{record.taxNumber,jdbcType=VARCHAR},
- </if>
- <if test="record.amount != null">
- amount = #{record.amount,jdbcType=DECIMAL},
- </if>
- <if test="record.banks != null">
- banks = #{record.banks,jdbcType=VARCHAR},
- </if>
- <if test="record.content != null">
- content = #{record.content,jdbcType=VARCHAR},
- </if>
- <if test="record.unitAddress != null">
- unit_address = #{record.unitAddress,jdbcType=VARCHAR},
- </if>
- <if test="record.invoiceRemarks != null">
- invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
- </if>
- <if test="record.unitMobile != null">
- unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
- </if>
- <if test="record.voucherUrl != null">
- voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="record.post != null">
- post = #{record.post,jdbcType=INTEGER},
- </if>
- <if test="record.addressee != null">
- addressee = #{record.addressee,jdbcType=VARCHAR},
- </if>
- <if test="record.addresseeMobile != null">
- addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
- </if>
- <if test="record.addresseeProvince != null">
- addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
- </if>
- <if test="record.addresseeCity != null">
- addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
- </if>
- <if test="record.addresseeArea != null">
- addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
- </if>
- <if test="record.recipientAddress != null">
- recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.updateTime != null">
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.approval != null">
- approval = #{record.approval,jdbcType=INTEGER},
- </if>
- <if test="record.alreadyAmount != null">
- already_amount = #{record.alreadyAmount,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 Fri May 17 09:46:50 CST 2019.
- -->
- update t_order_invoice
- set id = #{record.id,jdbcType=INTEGER},
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- type = #{record.type,jdbcType=INTEGER},
- status = #{record.status,jdbcType=INTEGER},
- reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
- remarks = #{record.remarks,jdbcType=VARCHAR},
- invoice_type = #{record.invoiceType,jdbcType=INTEGER},
- unit_name = #{record.unitName,jdbcType=VARCHAR},
- tax_number = #{record.taxNumber,jdbcType=VARCHAR},
- amount = #{record.amount,jdbcType=DECIMAL},
- banks = #{record.banks,jdbcType=VARCHAR},
- content = #{record.content,jdbcType=VARCHAR},
- unit_address = #{record.unitAddress,jdbcType=VARCHAR},
- invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
- unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
- voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
- post = #{record.post,jdbcType=INTEGER},
- addressee = #{record.addressee,jdbcType=VARCHAR},
- addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
- addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
- addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
- addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
- recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- approval = #{record.approval,jdbcType=INTEGER},
- already_amount = #{record.alreadyAmount,jdbcType=DECIMAL}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderInvoice">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- update t_order_invoice
- <set>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="rejectReason != null">
- reject_reason = #{rejectReason,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="invoiceType != null">
- invoice_type = #{invoiceType,jdbcType=INTEGER},
- </if>
- <if test="unitName != null">
- unit_name = #{unitName,jdbcType=VARCHAR},
- </if>
- <if test="taxNumber != null">
- tax_number = #{taxNumber,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DECIMAL},
- </if>
- <if test="banks != null">
- banks = #{banks,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=VARCHAR},
- </if>
- <if test="unitAddress != null">
- unit_address = #{unitAddress,jdbcType=VARCHAR},
- </if>
- <if test="invoiceRemarks != null">
- invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
- </if>
- <if test="unitMobile != null">
- unit_mobile = #{unitMobile,jdbcType=VARCHAR},
- </if>
- <if test="voucherUrl != null">
- voucher_url = #{voucherUrl,jdbcType=VARCHAR},
- </if>
- <if test="post != null">
- post = #{post,jdbcType=INTEGER},
- </if>
- <if test="addressee != null">
- addressee = #{addressee,jdbcType=VARCHAR},
- </if>
- <if test="addresseeMobile != null">
- addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
- </if>
- <if test="addresseeProvince != null">
- addressee_province = #{addresseeProvince,jdbcType=INTEGER},
- </if>
- <if test="addresseeCity != null">
- addressee_city = #{addresseeCity,jdbcType=INTEGER},
- </if>
- <if test="addresseeArea != null">
- addressee_area = #{addresseeArea,jdbcType=INTEGER},
- </if>
- <if test="recipientAddress != null">
- recipient_address = #{recipientAddress,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="approval != null">
- approval = #{approval,jdbcType=INTEGER},
- </if>
- <if test="alreadyAmount != null">
- already_amount = #{alreadyAmount,jdbcType=DECIMAL},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderInvoice">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri May 17 09:46:50 CST 2019.
- -->
- update t_order_invoice
- set order_no = #{orderNo,jdbcType=VARCHAR},
- type = #{type,jdbcType=INTEGER},
- status = #{status,jdbcType=INTEGER},
- reject_reason = #{rejectReason,jdbcType=VARCHAR},
- remarks = #{remarks,jdbcType=VARCHAR},
- invoice_type = #{invoiceType,jdbcType=INTEGER},
- unit_name = #{unitName,jdbcType=VARCHAR},
- tax_number = #{taxNumber,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- banks = #{banks,jdbcType=VARCHAR},
- content = #{content,jdbcType=VARCHAR},
- unit_address = #{unitAddress,jdbcType=VARCHAR},
- invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
- unit_mobile = #{unitMobile,jdbcType=VARCHAR},
- voucher_url = #{voucherUrl,jdbcType=VARCHAR},
- post = #{post,jdbcType=INTEGER},
- addressee = #{addressee,jdbcType=VARCHAR},
- addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
- addressee_province = #{addresseeProvince,jdbcType=INTEGER},
- addressee_city = #{addresseeCity,jdbcType=INTEGER},
- addressee_area = #{addresseeArea,jdbcType=INTEGER},
- recipient_address = #{recipientAddress,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- approval = #{approval,jdbcType=INTEGER},
- already_amount = #{alreadyAmount,jdbcType=DECIMAL}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="checkApplyAmount" resultType="java.lang.Double">
- select ifnull(sum(amount),0) from t_order_invoice
- where order_no= #{orderNo,jdbcType=VARCHAR} and status !=4
- <if test="id != null">
- and id != #{id,jdbcType=INTEGER}
- </if>
- </select>
- <select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
- select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
- ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status,
- b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
- left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
- left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
- on a.order_no=d.order_no where a.status in (1,2) and a.approval in (0,2)
- <if test="type !=null">
- and a.`type`= #{type,jdbcType=INTEGER}
- </if>
- <if test="financeId !=null">
- and b.finance_id= #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="orderNo !=null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="name !=null">
- and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderDep !=null">
- and b.order_dep= #{orderDep,jdbcType=VARCHAR}
- </if>
- <if test="aDep !=null">
- and c.department_id=#{aDep,jdbcType=VARCHAR}
- </if>
- order by a.status ,a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="financeOrderInvoiceCount" resultType="java.lang.Integer">
- select count(*) from t_order_invoice a
- left join t_order_new b on a.order_no=b.order_no
- left join admin c on b.salesman_id=c.id
- where a.status in (1,2) and a.approval in (0,2)
- <if test="type !=null">
- and a.`type`= #{type,jdbcType=INTEGER}
- </if>
- <if test="financeId !=null">
- and b.finance_id= #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="orderNo !=null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="name !=null">
- and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderDep !=null">
- and b.order_dep= #{orderDep,jdbcType=VARCHAR}
- </if>
- <if test="aDep !=null">
- and c.department_id=#{aDep,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="salesmanOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
- select id ,order_no as orderNo,amount,date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- reject_reason as rejectReason,status from t_order_invoice
- where status !=4
- <if test="orderNo !=null">
- and order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- order by create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="salesmanOrderInvoiceCount" resultType="java.lang.Integer">
- select count(*) from t_order_invoice where status !=4
- <if test="orderNo !=null">
- and order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
- select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
- ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,
- b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
- left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
- left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
- on a.order_no=d.order_no where a.status =1 and a.approval =1
- <if test="type !=null">
- and a.type= #{type,jdbcType=INTEGER}
- </if>
- <if test="orderNo !=null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="name !=null">
- and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderDep !=null">
- and b.order_dep= #{orderDep,jdbcType=VARCHAR}
- </if>
- <if test="aDep !=null">
- and c.department_id= #{aDep,jdbcType=VARCHAR}
- </if>
- order by a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
- select count(*) from t_order_invoice a
- left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
- where a.status =1 and a.approval =1
- <if test="type !=null">
- and a.type= #{type,jdbcType=INTEGER}
- </if>
- <if test="orderNo !=null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="name !=null">
- and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderDep !=null">
- and b.order_dep= #{orderDep,jdbcType=VARCHAR}
- </if>
- <if test="aDep !=null">
- and c.department_id= #{aDep,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectByInvoiceDitails" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderInvoiceDetails">
- select a.id ,a.order_no as orderNo,a.`type`,a.status,a.reject_reason as rejectReason,a.remarks,a.invoice_type as invoiceType,
- a.unit_name as unitName,a.tax_number as taxNumber,a.amount,a.banks,a.content,a.unit_address as unitAddress,
- a.invoice_remarks as invoiceRemarks,a.unit_mobile as unitMobile,a.voucher_url as voucherUrl ,a.post,a.addressee,
- a.addressee_area as addresseeArea,a.addressee_city as addresseeCity,a.addressee_province as addresseeProvince,
- a.addressee_mobile as addresseeMobile,a.recipient_address as recipientAddress,a.create_time,a.update_time,a.approval,
- a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
- left join t_order_new b on a.order_no=b.order_no
- where id = #{id,jdbcType=INTEGER}
- </select>
- </mapper>
|