| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <?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.TOrderBillNewMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderBillNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- <id column="bill_no" jdbcType="VARCHAR" property="billNo" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="creater" jdbcType="VARCHAR" property="creater" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="payee_id" jdbcType="VARCHAR" property="payeeId" />
- <result column="payer_id" jdbcType="VARCHAR" property="payerId" />
- <result column="transaction_amount" jdbcType="DECIMAL" property="transactionAmount" />
- <result column="transaction_subject" jdbcType="INTEGER" property="transactionSubject" />
- <result column="transaction_channel" jdbcType="INTEGER" property="transactionChannel" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="confirm_sign" jdbcType="INTEGER" property="confirmSign" />
- <result column="delete_sign" jdbcType="TINYINT" property="deleteSign" />
- <result column="financial_pay_no" jdbcType="VARCHAR" property="financialPayNo" />
- <result column="financial_pay_time" jdbcType="TIMESTAMP" property="financialPayTime" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
- </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 Mon Feb 17 11:41:23 CST 2020.
- -->
- <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 Mon Feb 17 11:41:23 CST 2020.
- -->
- <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 Mon Feb 17 11:41:23 CST 2020.
- -->
- bill_no, order_no, creater, create_time, update_time, payee_id, payer_id, transaction_amount,
- transaction_subject, transaction_channel, remarks, confirm_sign, delete_sign, financial_pay_no,
- financial_pay_time, type, delete_time
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_order_bill_new
- <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.String" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- select
- <include refid="Base_Column_List" />
- from t_order_bill_new
- where bill_no = #{billNo,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- delete from t_order_bill_new
- where bill_no = #{billNo,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- delete from t_order_bill_new
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrderBillNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- insert into t_order_bill_new (bill_no, order_no, creater,
- create_time, update_time, payee_id,
- payer_id, transaction_amount, transaction_subject,
- transaction_channel, remarks, confirm_sign,
- delete_sign, financial_pay_no, financial_pay_time,
- type, delete_time)
- values (#{billNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{payeeId,jdbcType=VARCHAR},
- #{payerId,jdbcType=VARCHAR}, #{transactionAmount,jdbcType=DECIMAL}, #{transactionSubject,jdbcType=INTEGER},
- #{transactionChannel,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{confirmSign,jdbcType=INTEGER},
- #{deleteSign,jdbcType=TINYINT}, #{financialPayNo,jdbcType=VARCHAR}, #{financialPayTime,jdbcType=TIMESTAMP},
- #{type,jdbcType=INTEGER}, #{deleteTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderBillNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- insert into t_order_bill_new
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="billNo != null">
- bill_no,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="creater != null">
- creater,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="payeeId != null">
- payee_id,
- </if>
- <if test="payerId != null">
- payer_id,
- </if>
- <if test="transactionAmount != null">
- transaction_amount,
- </if>
- <if test="transactionSubject != null">
- transaction_subject,
- </if>
- <if test="transactionChannel != null">
- transaction_channel,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="confirmSign != null">
- confirm_sign,
- </if>
- <if test="deleteSign != null">
- delete_sign,
- </if>
- <if test="financialPayNo != null">
- financial_pay_no,
- </if>
- <if test="financialPayTime != null">
- financial_pay_time,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="deleteTime != null">
- delete_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="billNo != null">
- #{billNo,jdbcType=VARCHAR},
- </if>
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="creater != null">
- #{creater,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="payeeId != null">
- #{payeeId,jdbcType=VARCHAR},
- </if>
- <if test="payerId != null">
- #{payerId,jdbcType=VARCHAR},
- </if>
- <if test="transactionAmount != null">
- #{transactionAmount,jdbcType=DECIMAL},
- </if>
- <if test="transactionSubject != null">
- #{transactionSubject,jdbcType=INTEGER},
- </if>
- <if test="transactionChannel != null">
- #{transactionChannel,jdbcType=INTEGER},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="confirmSign != null">
- #{confirmSign,jdbcType=INTEGER},
- </if>
- <if test="deleteSign != null">
- #{deleteSign,jdbcType=TINYINT},
- </if>
- <if test="financialPayNo != null">
- #{financialPayNo,jdbcType=VARCHAR},
- </if>
- <if test="financialPayTime != null">
- #{financialPayTime,jdbcType=TIMESTAMP},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- select count(*) from t_order_bill_new
- <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 Mon Feb 17 11:41:23 CST 2020.
- -->
- update t_order_bill_new
- <set>
- <if test="record.billNo != null">
- bill_no = #{record.billNo,jdbcType=VARCHAR},
- </if>
- <if test="record.orderNo != null">
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- </if>
- <if test="record.creater != null">
- creater = #{record.creater,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.payeeId != null">
- payee_id = #{record.payeeId,jdbcType=VARCHAR},
- </if>
- <if test="record.payerId != null">
- payer_id = #{record.payerId,jdbcType=VARCHAR},
- </if>
- <if test="record.transactionAmount != null">
- transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.transactionSubject != null">
- transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
- </if>
- <if test="record.transactionChannel != null">
- transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
- </if>
- <if test="record.remarks != null">
- remarks = #{record.remarks,jdbcType=VARCHAR},
- </if>
- <if test="record.confirmSign != null">
- confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
- </if>
- <if test="record.deleteSign != null">
- delete_sign = #{record.deleteSign,jdbcType=TINYINT},
- </if>
- <if test="record.financialPayNo != null">
- financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR},
- </if>
- <if test="record.financialPayTime != null">
- financial_pay_time = #{record.financialPayTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.type != null">
- type = #{record.type,jdbcType=INTEGER},
- </if>
- <if test="record.deleteTime != null">
- delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
- </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 Mon Feb 17 11:41:23 CST 2020.
- -->
- update t_order_bill_new
- set bill_no = #{record.billNo,jdbcType=VARCHAR},
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- creater = #{record.creater,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- payee_id = #{record.payeeId,jdbcType=VARCHAR},
- payer_id = #{record.payerId,jdbcType=VARCHAR},
- transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
- transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
- transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
- remarks = #{record.remarks,jdbcType=VARCHAR},
- confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
- delete_sign = #{record.deleteSign,jdbcType=TINYINT},
- financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR},
- financial_pay_time = #{record.financialPayTime,jdbcType=TIMESTAMP},
- type = #{record.type,jdbcType=INTEGER},
- delete_time = #{record.deleteTime,jdbcType=TIMESTAMP}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderBillNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- update t_order_bill_new
- <set>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="creater != null">
- creater = #{creater,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="payeeId != null">
- payee_id = #{payeeId,jdbcType=VARCHAR},
- </if>
- <if test="payerId != null">
- payer_id = #{payerId,jdbcType=VARCHAR},
- </if>
- <if test="transactionAmount != null">
- transaction_amount = #{transactionAmount,jdbcType=DECIMAL},
- </if>
- <if test="transactionSubject != null">
- transaction_subject = #{transactionSubject,jdbcType=INTEGER},
- </if>
- <if test="transactionChannel != null">
- transaction_channel = #{transactionChannel,jdbcType=INTEGER},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="confirmSign != null">
- confirm_sign = #{confirmSign,jdbcType=INTEGER},
- </if>
- <if test="deleteSign != null">
- delete_sign = #{deleteSign,jdbcType=TINYINT},
- </if>
- <if test="financialPayNo != null">
- financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
- </if>
- <if test="financialPayTime != null">
- financial_pay_time = #{financialPayTime,jdbcType=TIMESTAMP},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="deleteTime != null">
- delete_time = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where bill_no = #{billNo,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderBillNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Feb 17 11:41:23 CST 2020.
- -->
- update t_order_bill_new
- set order_no = #{orderNo,jdbcType=VARCHAR},
- creater = #{creater,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- payee_id = #{payeeId,jdbcType=VARCHAR},
- payer_id = #{payerId,jdbcType=VARCHAR},
- transaction_amount = #{transactionAmount,jdbcType=DECIMAL},
- transaction_subject = #{transactionSubject,jdbcType=INTEGER},
- transaction_channel = #{transactionChannel,jdbcType=INTEGER},
- remarks = #{remarks,jdbcType=VARCHAR},
- confirm_sign = #{confirmSign,jdbcType=INTEGER},
- delete_sign = #{deleteSign,jdbcType=TINYINT},
- financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
- financial_pay_time = #{financialPayTime,jdbcType=TIMESTAMP},
- type = #{type,jdbcType=INTEGER},
- delete_time = #{deleteTime,jdbcType=TIMESTAMP}
- where bill_no = #{billNo,jdbcType=VARCHAR}
- </update>
- <!-- 根据订单编号获得已交款 -->
- <select id="getAmountByOid" parameterType="java.lang.String" resultType="java.math.BigDecimal">
- select ifnull(sum(transaction_amount),0) amout from t_order_bill_new
- where delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
- </select>
- <!-- 根据流水编号获得流水详情 -->
- <select id="getOneRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
- select
- b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime,
- b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount,
- b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
- b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo,
- b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- where b.delete_sign = 0 and bill_no = #{_parameter,jdbcType=VARCHAR}
- </select>
- <!-- 根据订单编号查看该订单相关的所有流水 -->
- <select id="getOneOrderAllRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
- select
- b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime,
- b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount,
- b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
- b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo,
- b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- where b.delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
- </select>
- <!-- 查看自己创建的流水数据 -->
- <select id="myBillList" parameterType="Map" resultType="com.goafanti.common.model.TOrderBillNew">
- select
- b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,date_format(b.create_time,'%Y-%m-%d %H:%I:%S') as createTimes,
- b.payer_id as payerId, b.payee_id as payeeId, u.nickname as payerName, a.nickname as payeeName, b.remarks,o.contract_no contractNo,
- b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel, b.delete_sign deleteSign,
- date_format(b.financial_pay_time,'%Y-%m-%d') as financialPayTimes,b.financial_pay_no as financialPayNo,
- b.creater, ad.name as createrName, o.salesman_id as saleId, oa.name as saleName,b.type
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- left join admin ad on b.creater = ad.id
- left join t_order_new o on o.order_no = b.order_no
- left join admin oa on oa.id = o.salesman_id
- where 1=1
- <if test="b.orderNo != null and b.orderNo != """>
- and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="b.departmentId != null and b.departmentId != """>
- and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="b.creater != null and b.creater != """>
- and b.creater = #{b.creater,jdbcType=VARCHAR}
- </if>
- <if test="b.payerName != null and b.payerName != """>
- <bind name="nn" value="'%' + b.payerName + '%'" />
- and u.nickname like #{nn,jdbcType=VARCHAR}
- </if>
- <if test="b.payeeName != null and b.payeeName != """>
- <bind name="n" value="'%' + b.payeeName + '%'" />
- and a.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="b.departmentId != null and b.departmentId != "" ">
- and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != """>
- <bind name="a" value="b.startTime + ' 00:00:00'" />
- <bind name="e" value="b.endTime + ' 23:59:59'" />
- and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
- </if>
- order by b.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="myBillCount" parameterType="Map" resultType="java.lang.Integer">
- select count(*)
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- left join t_order_new o on o.order_no = b.order_no
- left join admin oa on oa.id = o.salesman_id
- where 1=1
- <if test="b.orderNo != null and b.orderNo != """>
- and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="b.creater != null and b.creater != """>
- and b.creater = #{b.creater,jdbcType=VARCHAR}
- </if>
- <if test="b.departmentId != null and b.departmentId != """>
- and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="b.payerName != null and b.payerName != """>
- <bind name="nn" value="'%' + b.payerName + '%'" />
- and u.nickname like #{nn,jdbcType=VARCHAR}
- </if>
- <if test="b.payeeName != null and b.payeeName != """>
- <bind name="n" value="'%' + b.payeeName + '%'" />
- and a.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="b.departmentId != null and b.departmentId != "" ">
- and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != """>
- <bind name="a" value="b.startTime + ' 00:00:00'" />
- <bind name="e" value="b.endTime + ' 23:59:59'" />
- and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 带条件的流水部门 -->
- <select id="getDeptBySome" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
- select distinct
- d.id as departmentId, d.name as departmentName
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- left join t_order_new o on o.order_no = b.order_no
- left join admin oa on oa.id = o.salesman_id
- left join department d on oa.department_id = d.id
- where
- b.delete_sign = 0
- <if test="payerName != null and payerName != """>
- <bind name="nn" value="'%' + payerName + '%'" />
- and u.nickname like #{nn,jdbcType=VARCHAR}
- </if>
- <if test="payeeName != null and payeeName != """>
- <bind name="n" value="'%' + payeeName + '%'" />
- and a.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="startTime != null and startTime != "" and endTime != null and endTime != """>
- <bind name="a" value="startTime + ' 00:00:00'" />
- <bind name="e" value="endTime + ' 23:59:59'" />
- and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 获得流水记录 -->
- <select id="getBillData" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
- select
- b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
- u.nickname as payerName, a.nickname as payeeName,
- b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
- b.financial_pay_time as financialPayTimes,b.financial_pay_no as financialPayNo,
- b.creater, ad.name as createrName, oa.name as saleName, b.create_time as createTime
- from t_order_bill_new b
- left join `user` u on b.payer_id = u.id
- left join `user` a on b.payee_id = a.id
- left join admin ad on b.creater = ad.id
- left join t_order_new o on o.order_no = b.order_no
- left join admin oa on oa.id = o.salesman_id
- where b.delete_sign = 0
- <if test="payerName != null and payerName != """>
- <bind name="nn" value="'%' + payerName + '%'" />
- and u.nickname like #{nn,jdbcType=VARCHAR}
- </if>
- <if test="payeeName != null and payeeName != """>
- <bind name="n" value="'%' + payeeName + '%'" />
- and a.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="departmentId != null and departmentId != "" ">
- and oa.department_id = #{departmentId,jdbcType=VARCHAR}
- </if>
- <if test="startTime != null and startTime != "" and endTime != null and endTime != """>
- <bind name="a" value="startTime + ' 00:00:00'" />
- <bind name="e" value="endTime + ' 23:59:59'" />
- and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
- </if>
- order by b.order_no, b.creater , b.financial_pay_time
- </select>
- <select id="conutAmountByOrderNo" resultType="java.math.BigDecimal">
- select ifnull(sum(a.transaction_amount),0) amount from t_order_bill_new a
- where a.order_no= #{orderNo,jdbcType=VARCHAR};
- </select>
- <select id="selectByOrderNo" resultType="com.goafanti.order.bo.BillBo">
- select date_format(a.financial_pay_time,'%Y-%m-%d') payTime,a.transaction_amount transactionAmount,b.name aName from t_order_bill_new a
- left join admin b on a.creater=b.id
- where order_no= #{orderNo,jdbcType=VARCHAR};
- </select>
- <insert id="insertBatch" parameterType="com.goafanti.common.model.TOrderBillNew">
- insert into t_order_bill_new (bill_no, order_no, creater,
- create_time, update_time, payee_id,
- payer_id, transaction_amount, transaction_subject,
- transaction_channel, remarks, confirm_sign,
- delete_sign, financial_pay_no, financial_pay_time,
- type)values
- <foreach collection="list" index="index" item="item" separator=",">
- (#{item.billNo,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.creater,jdbcType=VARCHAR},
- #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.payeeId,jdbcType=VARCHAR},
- #{item.payerId,jdbcType=VARCHAR}, #{item.transactionAmount,jdbcType=DECIMAL}, #{item.transactionSubject,jdbcType=INTEGER},
- #{item.transactionChannel,jdbcType=INTEGER}, #{item.remarks,jdbcType=VARCHAR}, #{item.confirmSign,jdbcType=INTEGER},
- #{item.deleteSign,jdbcType=TINYINT}, #{item.financialPayNo,jdbcType=VARCHAR}, #{item.financialPayTime,jdbcType=TIMESTAMP},
- #{item.type,jdbcType=INTEGER})
- </foreach>
- </insert>
- </mapper>
|