| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447 |
- <?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.TOrderMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- <id column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="order_type" jdbcType="INTEGER" property="orderType" />
- <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="buyer_id" jdbcType="VARCHAR" property="buyerId" />
- <result column="seller_id" jdbcType="VARCHAR" property="sellerId" />
- <result column="first_payment" jdbcType="DECIMAL" property="firstPayment" />
- <result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
- <result column="brokerage_amount" jdbcType="DECIMAL" property="brokerageAmount" />
- <result column="sign_first_payment" jdbcType="DECIMAL" property="signFirstPayment" />
- <result column="actually_first_payment" jdbcType="DECIMAL" property="actuallyFirstPayment" />
- <result column="sign_total_amount" jdbcType="DECIMAL" property="signTotalAmount" />
- <result column="actually_total_amount" jdbcType="DECIMAL" property="actuallyTotalAmount" />
- <result column="sign_brokerage_amount" jdbcType="DECIMAL" property="signBrokerageAmount" />
- <result column="actually_brokerage_amount" jdbcType="DECIMAL" property="actuallyBrokerageAmount" />
- <result column="sign_withdraw_amount" jdbcType="DECIMAL" property="signWithdrawAmount" />
- <result column="actually_withdraw_amount" jdbcType="DECIMAL" property="actuallyWithdrawAmount" />
- <result column="order_stage" jdbcType="INTEGER" property="orderStage" />
- <result column="project_stage" jdbcType="INTEGER" property="projectStage" />
- <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
- <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
- <result column="order_channel" jdbcType="INTEGER" property="orderChannel" />
- <result column="approval" jdbcType="INTEGER" property="approval" />
- <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
- <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
- <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
- <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
- <result column="technician_id" jdbcType="VARCHAR" property="technicianId" />
- <result column="confirm_time" jdbcType="TIMESTAMP" property="confirmTime" />
- <result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
- <result column="set_up_time" jdbcType="TIMESTAMP" property="setUpTime" />
- <result column="settlement_time" jdbcType="TIMESTAMP" property="settlementTime" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- <result column="contract_picture_url" jdbcType="LONGVARCHAR" property="contractPictureUrl" />
- </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 Jan 22 19:15:05 CST 2018.
- -->
- <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 Jan 22 19:15:05 CST 2018.
- -->
- <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 Jan 22 19:15:05 CST 2018.
- -->
- order_no, order_type, creater, create_time, update_time, buyer_id, seller_id, first_payment,
- order_amount, brokerage_amount, sign_first_payment, actually_first_payment, sign_total_amount,
- actually_total_amount, sign_brokerage_amount, actually_brokerage_amount, sign_withdraw_amount,
- actually_withdraw_amount, order_stage, project_stage, order_status, liquidation_status,
- order_channel, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id,
- confirm_time, sign_time, set_up_time, settlement_time
- </sql>
- <sql id="Blob_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- contract_picture_url
- </sql>
- <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderExample" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from t_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_order
- <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="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from t_order
- where order_no = #{orderNo,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 Jan 22 19:15:05 CST 2018.
- -->
- delete from t_order
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- delete from t_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- insert into t_order (order_no, order_type, creater,
- create_time, update_time, buyer_id,
- seller_id, first_payment, order_amount,
- brokerage_amount, sign_first_payment, actually_first_payment,
- sign_total_amount, actually_total_amount, sign_brokerage_amount,
- actually_brokerage_amount, sign_withdraw_amount,
- actually_withdraw_amount, order_stage, project_stage,
- order_status, liquidation_status, order_channel,
- approval, order_remarks, delete_sign,
- salesman_id, finance_id, technician_id,
- confirm_time, sign_time, set_up_time,
- settlement_time, contract_picture_url
- )
- values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
- #{sellerId,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL},
- #{brokerageAmount,jdbcType=DECIMAL}, #{signFirstPayment,jdbcType=DECIMAL}, #{actuallyFirstPayment,jdbcType=DECIMAL},
- #{signTotalAmount,jdbcType=DECIMAL}, #{actuallyTotalAmount,jdbcType=DECIMAL}, #{signBrokerageAmount,jdbcType=DECIMAL},
- #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{signWithdrawAmount,jdbcType=DECIMAL},
- #{actuallyWithdrawAmount,jdbcType=DECIMAL}, #{orderStage,jdbcType=INTEGER}, #{projectStage,jdbcType=INTEGER},
- #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderChannel,jdbcType=INTEGER},
- #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER},
- #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR},
- #{confirmTime,jdbcType=TIMESTAMP}, #{signTime,jdbcType=TIMESTAMP}, #{setUpTime,jdbcType=TIMESTAMP},
- #{settlementTime,jdbcType=TIMESTAMP}, #{contractPictureUrl,jdbcType=LONGVARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- insert into t_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="orderType != null">
- order_type,
- </if>
- <if test="creater != null">
- creater,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="buyerId != null">
- buyer_id,
- </if>
- <if test="sellerId != null">
- seller_id,
- </if>
- <if test="firstPayment != null">
- first_payment,
- </if>
- <if test="orderAmount != null">
- order_amount,
- </if>
- <if test="brokerageAmount != null">
- brokerage_amount,
- </if>
- <if test="signFirstPayment != null">
- sign_first_payment,
- </if>
- <if test="actuallyFirstPayment != null">
- actually_first_payment,
- </if>
- <if test="signTotalAmount != null">
- sign_total_amount,
- </if>
- <if test="actuallyTotalAmount != null">
- actually_total_amount,
- </if>
- <if test="signBrokerageAmount != null">
- sign_brokerage_amount,
- </if>
- <if test="actuallyBrokerageAmount != null">
- actually_brokerage_amount,
- </if>
- <if test="signWithdrawAmount != null">
- sign_withdraw_amount,
- </if>
- <if test="actuallyWithdrawAmount != null">
- actually_withdraw_amount,
- </if>
- <if test="orderStage != null">
- order_stage,
- </if>
- <if test="projectStage != null">
- project_stage,
- </if>
- <if test="orderStatus != null">
- order_status,
- </if>
- <if test="liquidationStatus != null">
- liquidation_status,
- </if>
- <if test="orderChannel != null">
- order_channel,
- </if>
- <if test="approval != null">
- approval,
- </if>
- <if test="orderRemarks != null">
- order_remarks,
- </if>
- <if test="deleteSign != null">
- delete_sign,
- </if>
- <if test="salesmanId != null">
- salesman_id,
- </if>
- <if test="financeId != null">
- finance_id,
- </if>
- <if test="technicianId != null">
- technician_id,
- </if>
- <if test="confirmTime != null">
- confirm_time,
- </if>
- <if test="signTime != null">
- sign_time,
- </if>
- <if test="setUpTime != null">
- set_up_time,
- </if>
- <if test="settlementTime != null">
- settlement_time,
- </if>
- <if test="contractPictureUrl != null">
- contract_picture_url,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="orderType != null">
- #{orderType,jdbcType=INTEGER},
- </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="buyerId != null">
- #{buyerId,jdbcType=VARCHAR},
- </if>
- <if test="sellerId != null">
- #{sellerId,jdbcType=VARCHAR},
- </if>
- <if test="firstPayment != null">
- #{firstPayment,jdbcType=DECIMAL},
- </if>
- <if test="orderAmount != null">
- #{orderAmount,jdbcType=DECIMAL},
- </if>
- <if test="brokerageAmount != null">
- #{brokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="signFirstPayment != null">
- #{signFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="actuallyFirstPayment != null">
- #{actuallyFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="signTotalAmount != null">
- #{signTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyTotalAmount != null">
- #{actuallyTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="signBrokerageAmount != null">
- #{signBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyBrokerageAmount != null">
- #{actuallyBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="signWithdrawAmount != null">
- #{signWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyWithdrawAmount != null">
- #{actuallyWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="orderStage != null">
- #{orderStage,jdbcType=INTEGER},
- </if>
- <if test="projectStage != null">
- #{projectStage,jdbcType=INTEGER},
- </if>
- <if test="orderStatus != null">
- #{orderStatus,jdbcType=INTEGER},
- </if>
- <if test="liquidationStatus != null">
- #{liquidationStatus,jdbcType=INTEGER},
- </if>
- <if test="orderChannel != null">
- #{orderChannel,jdbcType=INTEGER},
- </if>
- <if test="approval != null">
- #{approval,jdbcType=INTEGER},
- </if>
- <if test="orderRemarks != null">
- #{orderRemarks,jdbcType=VARCHAR},
- </if>
- <if test="deleteSign != null">
- #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="salesmanId != null">
- #{salesmanId,jdbcType=VARCHAR},
- </if>
- <if test="financeId != null">
- #{financeId,jdbcType=VARCHAR},
- </if>
- <if test="technicianId != null">
- #{technicianId,jdbcType=VARCHAR},
- </if>
- <if test="confirmTime != null">
- #{confirmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="signTime != null">
- #{signTime,jdbcType=TIMESTAMP},
- </if>
- <if test="setUpTime != null">
- #{setUpTime,jdbcType=TIMESTAMP},
- </if>
- <if test="settlementTime != null">
- #{settlementTime,jdbcType=TIMESTAMP},
- </if>
- <if test="contractPictureUrl != null">
- #{contractPictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.TOrderExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- select count(*) from t_order
- <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 Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- <set>
- <if test="record.orderNo != null">
- order_no = #{record.orderNo,jdbcType=VARCHAR},
- </if>
- <if test="record.orderType != null">
- order_type = #{record.orderType,jdbcType=INTEGER},
- </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.buyerId != null">
- buyer_id = #{record.buyerId,jdbcType=VARCHAR},
- </if>
- <if test="record.sellerId != null">
- seller_id = #{record.sellerId,jdbcType=VARCHAR},
- </if>
- <if test="record.firstPayment != null">
- first_payment = #{record.firstPayment,jdbcType=DECIMAL},
- </if>
- <if test="record.orderAmount != null">
- order_amount = #{record.orderAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.brokerageAmount != null">
- brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.signFirstPayment != null">
- sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="record.actuallyFirstPayment != null">
- actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="record.signTotalAmount != null">
- sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.actuallyTotalAmount != null">
- actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.signBrokerageAmount != null">
- sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.actuallyBrokerageAmount != null">
- actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.signWithdrawAmount != null">
- sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.actuallyWithdrawAmount != null">
- actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.orderStage != null">
- order_stage = #{record.orderStage,jdbcType=INTEGER},
- </if>
- <if test="record.projectStage != null">
- project_stage = #{record.projectStage,jdbcType=INTEGER},
- </if>
- <if test="record.orderStatus != null">
- order_status = #{record.orderStatus,jdbcType=INTEGER},
- </if>
- <if test="record.liquidationStatus != null">
- liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
- </if>
- <if test="record.orderChannel != null">
- order_channel = #{record.orderChannel,jdbcType=INTEGER},
- </if>
- <if test="record.approval != null">
- approval = #{record.approval,jdbcType=INTEGER},
- </if>
- <if test="record.orderRemarks != null">
- order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
- </if>
- <if test="record.deleteSign != null">
- delete_sign = #{record.deleteSign,jdbcType=INTEGER},
- </if>
- <if test="record.salesmanId != null">
- salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
- </if>
- <if test="record.financeId != null">
- finance_id = #{record.financeId,jdbcType=VARCHAR},
- </if>
- <if test="record.technicianId != null">
- technician_id = #{record.technicianId,jdbcType=VARCHAR},
- </if>
- <if test="record.confirmTime != null">
- confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.signTime != null">
- sign_time = #{record.signTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.setUpTime != null">
- set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.settlementTime != null">
- settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.contractPictureUrl != null">
- contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExampleWithBLOBs" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- set order_no = #{record.orderNo,jdbcType=VARCHAR},
- order_type = #{record.orderType,jdbcType=INTEGER},
- creater = #{record.creater,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- buyer_id = #{record.buyerId,jdbcType=VARCHAR},
- seller_id = #{record.sellerId,jdbcType=VARCHAR},
- first_payment = #{record.firstPayment,jdbcType=DECIMAL},
- order_amount = #{record.orderAmount,jdbcType=DECIMAL},
- brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
- sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
- actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
- sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
- actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
- sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
- actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
- sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
- actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
- order_stage = #{record.orderStage,jdbcType=INTEGER},
- project_stage = #{record.projectStage,jdbcType=INTEGER},
- order_status = #{record.orderStatus,jdbcType=INTEGER},
- liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
- order_channel = #{record.orderChannel,jdbcType=INTEGER},
- approval = #{record.approval,jdbcType=INTEGER},
- order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
- delete_sign = #{record.deleteSign,jdbcType=INTEGER},
- salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
- finance_id = #{record.financeId,jdbcType=VARCHAR},
- technician_id = #{record.technicianId,jdbcType=VARCHAR},
- confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
- sign_time = #{record.signTime,jdbcType=TIMESTAMP},
- set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
- settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP},
- contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR}
- <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 Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- set order_no = #{record.orderNo,jdbcType=VARCHAR},
- order_type = #{record.orderType,jdbcType=INTEGER},
- creater = #{record.creater,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- buyer_id = #{record.buyerId,jdbcType=VARCHAR},
- seller_id = #{record.sellerId,jdbcType=VARCHAR},
- first_payment = #{record.firstPayment,jdbcType=DECIMAL},
- order_amount = #{record.orderAmount,jdbcType=DECIMAL},
- brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
- sign_first_payment = #{record.signFirstPayment,jdbcType=DECIMAL},
- actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
- sign_total_amount = #{record.signTotalAmount,jdbcType=DECIMAL},
- actually_total_amount = #{record.actuallyTotalAmount,jdbcType=DECIMAL},
- sign_brokerage_amount = #{record.signBrokerageAmount,jdbcType=DECIMAL},
- actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
- sign_withdraw_amount = #{record.signWithdrawAmount,jdbcType=DECIMAL},
- actually_withdraw_amount = #{record.actuallyWithdrawAmount,jdbcType=DECIMAL},
- order_stage = #{record.orderStage,jdbcType=INTEGER},
- project_stage = #{record.projectStage,jdbcType=INTEGER},
- order_status = #{record.orderStatus,jdbcType=INTEGER},
- liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
- order_channel = #{record.orderChannel,jdbcType=INTEGER},
- approval = #{record.approval,jdbcType=INTEGER},
- order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
- delete_sign = #{record.deleteSign,jdbcType=INTEGER},
- salesman_id = #{record.salesmanId,jdbcType=VARCHAR},
- finance_id = #{record.financeId,jdbcType=VARCHAR},
- technician_id = #{record.technicianId,jdbcType=VARCHAR},
- confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
- sign_time = #{record.signTime,jdbcType=TIMESTAMP},
- set_up_time = #{record.setUpTime,jdbcType=TIMESTAMP},
- settlement_time = #{record.settlementTime,jdbcType=TIMESTAMP}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- <set>
- <if test="orderType != null">
- order_type = #{orderType,jdbcType=INTEGER},
- </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="buyerId != null">
- buyer_id = #{buyerId,jdbcType=VARCHAR},
- </if>
- <if test="sellerId != null">
- seller_id = #{sellerId,jdbcType=VARCHAR},
- </if>
- <if test="firstPayment != null">
- first_payment = #{firstPayment,jdbcType=DECIMAL},
- </if>
- <if test="orderAmount != null">
- order_amount = #{orderAmount,jdbcType=DECIMAL},
- </if>
- <if test="brokerageAmount != null">
- brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="signFirstPayment != null">
- sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="actuallyFirstPayment != null">
- actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
- </if>
- <if test="signTotalAmount != null">
- sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyTotalAmount != null">
- actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
- </if>
- <if test="signBrokerageAmount != null">
- sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyBrokerageAmount != null">
- actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
- </if>
- <if test="signWithdrawAmount != null">
- sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="actuallyWithdrawAmount != null">
- actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
- </if>
- <if test="orderStage != null">
- order_stage = #{orderStage,jdbcType=INTEGER},
- </if>
- <if test="projectStage != null">
- project_stage = #{projectStage,jdbcType=INTEGER},
- </if>
- <if test="orderStatus != null">
- order_status = #{orderStatus,jdbcType=INTEGER},
- </if>
- <if test="liquidationStatus != null">
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- </if>
- <if test="orderChannel != null">
- order_channel = #{orderChannel,jdbcType=INTEGER},
- </if>
- <if test="approval != null">
- approval = #{approval,jdbcType=INTEGER},
- </if>
- <if test="orderRemarks != null">
- order_remarks = #{orderRemarks,jdbcType=VARCHAR},
- </if>
- <if test="deleteSign != null">
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="salesmanId != null">
- salesman_id = #{salesmanId,jdbcType=VARCHAR},
- </if>
- <if test="financeId != null">
- finance_id = #{financeId,jdbcType=VARCHAR},
- </if>
- <if test="technicianId != null">
- technician_id = #{technicianId,jdbcType=VARCHAR},
- </if>
- <if test="confirmTime != null">
- confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
- </if>
- <if test="signTime != null">
- sign_time = #{signTime,jdbcType=TIMESTAMP},
- </if>
- <if test="setUpTime != null">
- set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
- </if>
- <if test="settlementTime != null">
- settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
- </if>
- <if test="contractPictureUrl != null">
- contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- set order_type = #{orderType,jdbcType=INTEGER},
- creater = #{creater,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- buyer_id = #{buyerId,jdbcType=VARCHAR},
- seller_id = #{sellerId,jdbcType=VARCHAR},
- first_payment = #{firstPayment,jdbcType=DECIMAL},
- order_amount = #{orderAmount,jdbcType=DECIMAL},
- brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
- sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
- actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
- sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
- actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
- sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
- actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
- sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
- actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
- order_stage = #{orderStage,jdbcType=INTEGER},
- project_stage = #{projectStage,jdbcType=INTEGER},
- order_status = #{orderStatus,jdbcType=INTEGER},
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- order_channel = #{orderChannel,jdbcType=INTEGER},
- approval = #{approval,jdbcType=INTEGER},
- order_remarks = #{orderRemarks,jdbcType=VARCHAR},
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- salesman_id = #{salesmanId,jdbcType=VARCHAR},
- finance_id = #{financeId,jdbcType=VARCHAR},
- technician_id = #{technicianId,jdbcType=VARCHAR},
- confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
- sign_time = #{signTime,jdbcType=TIMESTAMP},
- set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
- settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
- contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrder">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jan 22 19:15:05 CST 2018.
- -->
- update t_order
- set order_type = #{orderType,jdbcType=INTEGER},
- creater = #{creater,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- buyer_id = #{buyerId,jdbcType=VARCHAR},
- seller_id = #{sellerId,jdbcType=VARCHAR},
- first_payment = #{firstPayment,jdbcType=DECIMAL},
- order_amount = #{orderAmount,jdbcType=DECIMAL},
- brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
- sign_first_payment = #{signFirstPayment,jdbcType=DECIMAL},
- actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
- sign_total_amount = #{signTotalAmount,jdbcType=DECIMAL},
- actually_total_amount = #{actuallyTotalAmount,jdbcType=DECIMAL},
- sign_brokerage_amount = #{signBrokerageAmount,jdbcType=DECIMAL},
- actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
- sign_withdraw_amount = #{signWithdrawAmount,jdbcType=DECIMAL},
- actually_withdraw_amount = #{actuallyWithdrawAmount,jdbcType=DECIMAL},
- order_stage = #{orderStage,jdbcType=INTEGER},
- project_stage = #{projectStage,jdbcType=INTEGER},
- order_status = #{orderStatus,jdbcType=INTEGER},
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- order_channel = #{orderChannel,jdbcType=INTEGER},
- approval = #{approval,jdbcType=INTEGER},
- order_remarks = #{orderRemarks,jdbcType=VARCHAR},
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- salesman_id = #{salesmanId,jdbcType=VARCHAR},
- finance_id = #{financeId,jdbcType=VARCHAR},
- technician_id = #{technicianId,jdbcType=VARCHAR},
- confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
- sign_time = #{signTime,jdbcType=TIMESTAMP},
- set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
- settlement_time = #{settlementTime,jdbcType=TIMESTAMP}
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </update>
-
- <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.CommodityDetailBo">
- <choose>
- <when test="commodityType == 0">
- select id as commodityId,bname as commodityName,ifnull(price,0) as commodityPrice,ifnull(first_payment,0) as commodityFirstPayment from business_project where id = #{commodityId,jdbcType=VARCHAR}
- </when>
- <when test="commodityType == 1">
- select id as commodityId,name as commodityName,introduction,ifnull(transfer_price,0) as commodityPrice,owner_id as sellerId from achievement where id = #{commodityId,jdbcType=VARCHAR}
- </when>
- <when test="commodityType == 2">
- select id as commodityId,name as commodityName,problem_des as introduction,ifnull(budget_cost,0) as commodityPrice,employer_id as sellerId from demand where id = #{commodityId,jdbcType=VARCHAR}
- </when>
- <when test="commodityType == 3">
- select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
- left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
- </when>
- <when test="commodityType == 4">
-
- </when>
- <when test="commodityType == 5">
-
- </when>
- <when test="commodityType == 6">
- select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
- left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
- </when>
- </choose>
- </select>
-
- <select id="selectOrderListByPage" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order where delete_sign = 0
- <choose>
- <when test="intentionStatus == 0"><!-- 意向订单 -->
- and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and intention_status != 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </otherwise>
- </choose>
- order by create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectOrderListCount" resultType="java.lang.Integer">
- select
- count(0)
- from t_order where delete_sign = 0
- <choose>
- <when test="intentionStatus == 0"><!-- 意向订单 -->
- and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and intention_status != 0 and buyer_id = #{uid,jdbcType=VARCHAR}
- </otherwise>
- </choose>
- </select>
-
- <select id="selectOrderBillByPage" resultType="com.goafanti.order.bo.BillListBo">
- select
- a.order_no as orderNo,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- a.transaction_subject as transactionSubject,
- a.transaction_amount as transactionAmount,
- a.confirm_sign as confirmSign
- from
- t_order_bill a
- where
- (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR})
- <if test="orderNo != null and orderNo != ''">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- order by a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectOrderBillCount" resultType="java.lang.Integer">
- select
- count(0)
- from
- t_order_bill a
- where
- (a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR})
- <if test="orderNo != null and orderNo != ''">
- a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectOrderCommodity" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderDetail">
- select
- id,
- order_no as orderNo,
- commodity_id as commodityId,
- commodity_name as commodityName,
- commodity_quantity as commodityQuantity,
- commodity_price as commodityPrice,
- commodity_type as commodityType,
- commodity_mode as commodityMode,
- discount_price as discountPrice
- from
- t_order_detail
- where
- order_no = #{orderNo,jdbcType=VARCHAR}
- </select>
-
- <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
- select
- a.order_no as orderNo,
- a.order_type as orderType,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- a.sign_total_amount as signTotalAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_channel as orderChannel,
- b.nickname as buyerName,
- c.name as salesmanName,
- d.name as financeName,
- e.name as technicianName,
- f.departmentName
- from
- t_order a left join user b on
- a.buyer_id = b.id left join admin c on
- a.salesman_id = c.id left join admin d on
- a.finance_id = d.id left join admin e on
- a.technician_id = e.id left join department_management f on
- d.department_id = f.id
- where a.type = 0
- <if test="salesmanId != null">
- and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="technicianId != null">
- and a.technician_id = #{technicianId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="projectStage != null">
- and a.project_stage = #{projectStage,jdbcType=INTEGER}
- </if>
- <if test="liquidationStatus != null">
- and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
- </if>
- <if test="orderChannel != null">
- and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <!-- 特殊处理字段 开始 -->
- <if test="intention == 1">
- and a.order_stage = 0
- </if>
- <if test="formal == 1">
- and a.order_stage != 0
- </if>
- <if test="approvalHistory == 0">
- and a.approval = 1
- </if>
- <if test="approvalHistory == 1">
- and a.approval != 0
- </if>
- <if test="depIds != null and depIds != ''">
- and f.id in #{depIds,jdbcType=VARCHAR}
- </if>
- <!-- 特殊处理字段结束 -->
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectServiceOrderByPage" resultType="java.lang.Integer">
- select
- count(0)
- from
- t_order a left join user b on
- a.buyer_id = b.id left join admin c on
- a.salesman_id = c.id left join admin d on
- a.finance_id = d.id left join admin e on
- a.technician_id = e.id left join department_management f on
- d.department_id = f.id
- where a.type = 0
- <if test="salesmanId != null">
- and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="technicianId != null">
- and a.technician_id = #{technicianId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=STRING}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=STRING}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="confirm == 0">
- and a.order_status = 0
- </if>
- <if test="confirm == 1">
- and a.order_status != 0
- </if>
- <if test="orderStage != null">
- and a.order_stage = #{orderStage,jdbcType=INTEGER}
- </if>
- <if test="liquidationStatus != null">
- and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
- </if>
- <if test="orderChannel != null">
- and.orderChannel =#{orderChannel,jdbcType=INTEGER}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <!-- 特殊处理字段 开始 -->
- <if test="intention == 1">
- and a.order_stage = 0
- </if>
- <if test="formal == 1">
- and a.order_stage != 0
- </if>
- <if test="approvalHistory == 0">
- and a.approval = 1
- </if>
- <if test="approvalHistory == 1">
- and a.approval != 0
- </if>
- <if test="depIds != null and depIds != ''">
- and f.id in #{depIds,jdbcType=VARCHAR}
- </if>
- <!-- 特殊处理字段结束 -->
- </select>
-
- <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
- select
- a.order_no as orderNo,
- a.order_type as orderType,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- date_format(a.sign_time,'%Y-%m-%d %H:%i:%S') as signTime,
- date_format(a.set_up_time,'%Y-%m-%d %H:%i:%S') as setUpTime,
- date_format(a.settlement_time,'%Y-%m-%d %H:%i:%S') as settlementTime,
- a.order_amount as orderAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_remarks as orderRemarks,
- a.order_channel as orderChannel,
- a.contract_picture_url as contractPictureUrl,
- b.nickname as buyerName,
- c.name as salesmanName,
- d.name as financeName,
- e.name as technicianName
- from
- t_order a left join user b on
- a.buyer_id = b.id left join admin c on
- a.salesman_id = c.id left join admin d on
- a.finance_id = d.id left join admin e on
- a.technician_id = e.id
- where a.order_no = #{orderNo,jdbcType=STRING}
- </select>
-
- <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
- select
- a.order_no as orderNo,
- a.order_type as orderType,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- a.order_amount as orderAmount,
- a.sign_total_amount as signTotalAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.liquidation_status as liquidationStatus,
- a.order_channel as orderChannel,
- b.nickname as buyerName
- from
- t_order a left join user b on
- a.buyer_id = b.id
- where a.salesman_id is null
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="orderChannel != null">
- and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectPublicOrderCount" resultType="java.lang.Integer">
- select
- count(0)
- from
- t_order a left join user b on
- a.buyer_id = b.id
- where a.salesman_id is null
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="orderChannel != null">
- and a.orderChannel = #{orderChannel,jdbcType=INTEGER}
- </if>
- </select>
- <select id="selectBillByPage" resultType="com.goafanti.order.bo.BillListBo">
- select
- a.bill_no as billNo,
- a.create_time as createTime,
- a.transaction_amount as transactionAmount,
- a.transaction_channel as transactionChannel,
- a.transaction_subject as transactionSubject,
- a.transaction_mode as transactionMode,
- a.financial_pay_no as financialPayNo,
- a.financial_pay_time as financialPayTime,
- a.confirm_sign as confirmSign,
- a.delete_sign as deleteSign,
- b.order_no as orderNo,
- c.name as payeeName,
- d.name as payerName,
- e.name as financeName,
- f.name as salesmanName,
- g.name as departmentName
- from
- t_order_bill a left join t_order b on
- a.order_no = b.order_no left join user c on
- a.payee_id = c.id left join user d on
- a.payer_id = d.id left join admin e on
- b.finance_id = e.id left join admin f on
- b.salesman_id = f.id left join department_management g on
- f.department_id = g.id
- where 1=1
- <if test="payeeName != null and payeeName != ''">
- and c.name = #{payeeName,jdbcType=VARCHAR}
- </if>
- <if test="payerName != null and payerName !=''">
- and d.name = #{payerName,jdbcType=VARCHAR}
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and f.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and e.name = #{financeName,jdbcType=VARCHAR}
- </if>
- <if test="confirmSign != null">
- and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
- </if>
- <if test="deleteSign != null">
- and a.delete_sign = #{deleteSign,jdbcType=VARCHAR}
- </if>
- <if test="depId != null and depId != ''">
- and f.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
- and
- (b.salesman_id = #{aid,jdbcType=VARCHAR}
- or
- b.finance_id = #{aid,jdbcType=VARCHAR}
- or
- b.technician_id = #{aid,jdbcType=VARCHAR})
- </if>
- <if test="isFinance == 1"> <!-- 我的结算流水 -->
- and b.finance_id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectBillCount" resultType="java.lang.Integer">
- select
- count(0)
- from
- t_order_bill a left join t_order b on
- a.order_no = b.order_no left join user c on
- a.payee_id = c.id left join user d on
- a.payer_id = d.id left join admin e on
- b.finance_id = e.id left join admin f on
- b.salesman_id = f.id left join department_management g on
- f.department_id = g.id
- where 1=1
- <if test="payeeName != null and payeeName != ''">
- and c.name = #{payeeName,jdbcType=VARCHAR}
- </if>
- <if test="payerName != null and payerName !=''">
- and d.name = #{payerName,jdbcType=VARCHAR}
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and f.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and e.name = #{financeName,jdbcType=VARCHAR}
- </if>
- <if test="confirmSign != null">
- and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
- </if>
- <if test="deleteSign != null">
- and a.delete_sign = #{deleteSign,jdbcType=VARCHAR}
- </if>
- <if test="depId != null and depId != ''">
- and f.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="isFinance == 0"> <!-- 我的订单流水查询 -->
- and
- (b.salesman_id = #{aid,jdbcType=VARCHAR}
- or
- b.finance_id = #{aid,jdbcType=VARCHAR}
- or
- b.technician_id = #{aid,jdbcType=VARCHAR})
- </if>
- <if test="isFinance == 1"> <!-- 我的结算流水 -->
- and b.finance_id = #{aid,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
- select
- a.bill_no as billNo,
- a.create_time as createTime,
- a.transaction_amount as transactionAmount,
- a.transaction_channel as transactionChannel,
- a.transaction_subject as transactionSubject,
- a.transaction_mode as transactionMode,
- a.financial_pay_no as financialPayNo,
- a.financial_pay_time as financialPayTime,
- a.confirm_sign as confirmSign,
- a.delete_sign as deleteSign,
- a.remarks,
- a.postscript,
- b.order_no as orderNo,
- c.name as payeeName,
- d.name as payerName,
- e.name as financeName,
- f.name as salesmanName,
- g.name as departmentName
- from
- t_order_bill a left join t_order b on
- a.order_no = b.order_no left join user c on
- a.payee_id = c.id left join user d on
- a.payer_id = d.id left join admin e on
- b.finance_id = e.id left join admin f on
- b.salesman_id = f.id left join department_management g on
- f.department_id = g.id
- where
- a.bill_no = #{billNo,jdbcType=VARCHAR}
- </select>
-
- <select id="selectSetUpProjectByPage" resultType="com.goafanti.order.bo.OrderListBo">
- select
- a.order_no as orderNo,
- a.order_type as orderType,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- a.order_status as orderStatus,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_channel as orderChannel,
- b.nickname as buyerName,
- c.name as salesmanName,
- d.name as financeName,
- e.name as technicianName,
- f.departmentName
- from
- t_order a left join user b on
- a.buyer_id = b.id left join admin c on
- a.salesman_id = c.id left join admin d on
- a.finance_id = d.id left join admin e on
- a.technician_id = e.id left join department_management f on
- d.department_id = f.id
- where a.type = 0 and a.order_status = 3
- and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
- <if test="salesmanId != null">
- and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="technicianId != null">
- and a.technician_id = #{technicianId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="depId != null and depId != ''">
- and f.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectSetUpProjectCount" resultType="java.lang.Integer">
- select
- count(0)
- from
- t_order a left join user b on
- a.buyer_id = b.id left join admin c on
- a.salesman_id = c.id left join admin d on
- a.finance_id = d.id left join admin e on
- a.technician_id = e.id left join department_management f on
- d.department_id = f.id
- where a.type = 0 and a.order_status = 3
- and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
- <if test="salesmanId != null">
- and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="technicianId != null">
- and a.technician_id = #{technicianId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname = #{buyerName,jdbcType=VARCHAR}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="depId != null and depId != ''">
- and f.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- </mapper>
|