| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722 |
- <?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 Wed Apr 11 14:30:55 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" />
- <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
- <result column="contract_type" jdbcType="VARCHAR" property="contractType" />
- <result column="change_status" jdbcType="INTEGER" property="changeStatus" />
- </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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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, contract_no, contract_type,
- change_status
- </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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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_no, contract_type,
- change_status, 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}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
- #{changeStatus,jdbcType=INTEGER}, #{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 Wed Apr 11 14:30:55 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="contractNo != null">
- contract_no,
- </if>
- <if test="contractType != null">
- contract_type,
- </if>
- <if test="changeStatus != null">
- change_status,
- </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="contractNo != null">
- #{contractNo,jdbcType=VARCHAR},
- </if>
- <if test="contractType != null">
- #{contractType,jdbcType=VARCHAR},
- </if>
- <if test="changeStatus != null">
- #{changeStatus,jdbcType=INTEGER},
- </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 Wed Apr 11 14:30:55 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 Wed Apr 11 14:30:55 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.contractNo != null">
- contract_no = #{record.contractNo,jdbcType=VARCHAR},
- </if>
- <if test="record.contractType != null">
- contract_type = #{record.contractType,jdbcType=VARCHAR},
- </if>
- <if test="record.changeStatus != null">
- change_status = #{record.changeStatus,jdbcType=INTEGER},
- </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 Wed Apr 11 14:30:55 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_no = #{record.contractNo,jdbcType=VARCHAR},
- contract_type = #{record.contractType,jdbcType=VARCHAR},
- change_status = #{record.changeStatus,jdbcType=INTEGER},
- 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 Wed Apr 11 14:30:55 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_no = #{record.contractNo,jdbcType=VARCHAR},
- contract_type = #{record.contractType,jdbcType=VARCHAR},
- change_status = #{record.changeStatus,jdbcType=INTEGER}
- <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 Wed Apr 11 14:30:55 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="contractNo != null">
- contract_no = #{contractNo,jdbcType=VARCHAR},
- </if>
- <if test="contractType != null">
- contract_type = #{contractType,jdbcType=VARCHAR},
- </if>
- <if test="changeStatus != null">
- change_status = #{changeStatus,jdbcType=INTEGER},
- </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 Wed Apr 11 14:30:55 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_no = #{contractNo,jdbcType=VARCHAR},
- contract_type = #{contractType,jdbcType=VARCHAR},
- change_status = #{changeStatus,jdbcType=INTEGER},
- 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 Wed Apr 11 14:30:55 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_no = #{contractNo,jdbcType=VARCHAR},
- contract_type = #{contractType,jdbcType=VARCHAR},
- change_status = #{changeStatus,jdbcType=INTEGER}
- 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,cid as commodityClassify,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="orderStatus == 1"><!-- 意向订单 -->
- and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and order_status != 1 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="orderStatus == 0"><!-- 意向订单 -->
- and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and order_status != 1 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_first_payment as commodityFirstPayment,
- commodity_type as commodityType,
- commodity_mode as commodityMode,
- discount_price as discountPrice,
- discount_first_payment as discountFirstPayment,
- create_time as createTime,
- remarks
- 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,
- date_format(a.sign_time,'%Y-%m-%d') as signTime,
- a.sign_total_amount as signTotalAmount,
- a.actually_total_amount as actuallyTotalAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.project_stage as projectStage,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_channel as orderChannel,
- a.buyer_id as buyerId,
- a.seller_id as sellerId,
- a.delete_sign as deleteSign,
- b.nickname as buyerName,
- c.name as salesmanName,
- d.name as financeName,
- e.name as technicianName,
- f.name as 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
- c.department_id = f.id
- where a.order_type = 0
- <if test="salesmanId != null">
- and a.salesman_id = #{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 > #{startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{endDate,jdbcType=TIMESTAMP}
- </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.order_channel = #{orderChannel,jdbcType=INTEGER}
- </if>
- <if test="approval != null and approval !=4">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="approval ==4">
- and a.approval != 0
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%', #{buyerName},'%')
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </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})
- </if>
- order by a.create_time desc
- <!-- 特殊处理字段结束 -->
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectServiceOrderCount" 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
- c.department_id = f.id
- where a.order_type = 0
- <if test="salesmanId != null">
- and a.salesman_id = #{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 > #{startDate,jdbcType=VARCHAR}
- </if>
- <if test="endDate != null">
- and a.create_time < #{endDate,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 a.order_channel =#{orderChannel,jdbcType=INTEGER}
- </if>
- <if test="approval != null and approval !=4">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="approval ==4">
- and a.approval != 0
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%', #{buyerName},'%')
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </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})
- </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') 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.first_payment as firstPayment,
- a.sign_total_amount as signTotalAmount,
- a.sign_first_payment as signFirstPayment,
- a.actually_total_amount as actuallyTotalAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.project_stage as projectStage,
- a.delete_sign as deleteSign,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_remarks as orderRemarks,
- a.order_channel as orderChannel,
- a.contract_picture_url as contractPictureUrl,
- a.buyer_id as buyerId,
- a.seller_id as sellerId,
- a.buyer_id as buyerId,
- b.type as buyerType,
- b.nickname as buyerName,
- c.name as salesmanName,
- x.name as departmentName,
- a.finance_id as financeId,
- c.name as financeName,
- a.technician_id as technicianId,
- e.name as technicianName,
- a.delete_sign as deleteSign,
- a.contract_no as contractNo,
- f.cname as projectType,
- a.change_status as changeStatus
- 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 department_management x on
- c.department_id=x.id left join admin e on
- a.technician_id = e.id left join business_varieties f on
- a.contract_type = f.id
- where a.order_no = #{orderNo,jdbcType=VARCHAR}
- </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="orderType != null">
- and a.order_type = #{orderType,jdbcType=INTEGER}
- </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="selectSettlementByPage" 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.actually_total_amount as actuallyTotalAmount,
- a.order_status as orderStatus,
- a.order_stage as orderStage,
- a.project_stage as projectStage,
- a.liquidation_status as liquidationStatus,
- a.approval,
- a.order_channel as orderChannel,
- a.buyer_id as buyerId,
- a.seller_id as sellerId,
- b.nickname as buyerName,
- c.name as salesmanName,
- d.name as financeName,
- e.name as technicianName,
- f.name as 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
- c.department_id = f.id
- where a.order_type = 0 and order_status = 3 and delete_sign = 0
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="liquidationStatus != null">
- and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="isDistributionFinance == 0">
- and a.finance_id is null
- </if>
- <if test="isDistributionFinance == 1">
- and a.finance_id is not null
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
- </if>
- <if test="depId != null">
- and c.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and d.name = #{financeName,jdbcType=VARCHAR}
- </if>
- order by a.create_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectSettlementCount" 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
- c.department_id = f.id
- where a.order_type = 0 and order_status = 3 and delete_sign = 0
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and a.finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and a.create_time > #{startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and a.create_time < #{endDate,jdbcType=TIMESTAMP}
- </if>
- <if test="orderStatus != null">
- and a.order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="liquidationStatus != null">
- and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
- </if>
- <if test="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="isDistributionFinance == 0">
- and a.finance_id is null
- </if>
- <if test="isDistributionFinance == 1">
- and a.finance_id is not null
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
- </if>
- <if test="depId != null">
- and c.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and d.name = #{financeName,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="selectBillByPage" resultType="com.goafanti.order.bo.BillListBo">
- select
- a.bill_no as billNo,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') 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,
- date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
- a.confirm_sign as confirmSign,
- a.delete_sign as deleteSign,
- date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
- b.order_no as orderNo,
- c.nickname as payeeName,
- d.nickname 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.delete_sign = 0
- <if test="orderNo != null and orderNo != ''">
- and b.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="payeeName != null and payeeName != ''">
- and c.nickname = #{payeeName,jdbcType=VARCHAR}
- </if>
- <if test="payerName != null and payerName !=''">
- and d.nickname = #{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=INTEGER}
- </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>
- order by a.create_time desc
- <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 a.delete_sign = 0
- <if test="orderNo != null and orderNo != ''">
- and b.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="payeeName != null and payeeName != ''">
- and c.nickname = #{payeeName,jdbcType=VARCHAR}
- </if>
- <if test="payerName != null and payerName !=''">
- and d.nickname = #{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=INTEGER}
- </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,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') 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,
- date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
- date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
- a.confirm_sign as confirmSign,
- a.delete_sign as deleteSign,
- a.remarks,
- a.postscript,
- b.order_no as orderNo,
- c.nickname as payeeName,
- d.nickname 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="selectSetUpServiceOrderByPage" 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.project_stage as projectStage,
- 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.name as departmentName,
- g.cname as projectType
- 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
- c.department_id = f.id left join business_varieties g on
- a.contract_type = g.id
- where a.order_type = 0 and a.order_status = 3 and project_stage = 1
- and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
- and a.delete_sign=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="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="depId != null and depId != ''">
- and f.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and d.name = #{financeName,jdbcType=VARCHAR}
- </if>
- order by a.create_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectSetUpServiceOrderCount" 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
- c.department_id = f.id left join business_varieties g on
- a.contract_type = g.id
- where a.order_type = 0 and a.order_status = 3 and project_stage = 1
- 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="approval != null">
- and a.approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="depId != null and depId != ''">
- and f.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="buyerName != null and buyerName != ''">
- and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
- </if>
- <if test="salesmanName != null and salesmanName != ''">
- and c.name = #{salesmanName,jdbcType=VARCHAR}
- </if>
- <if test="financeName != null and financeName != ''">
- and d.name = #{financeName,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
- select
- a.bill_no as billNo,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') 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,
- date_format(a.financial_pay_time,'%Y-%m-%d %H:%i:%S') as financialPayTime,
- a.confirm_sign as confirmSign,
- a.delete_sign as deleteSign,
- date_format(a.confirm_time,'%Y-%m-%d %H:%i:%S') as confirmTime,
- b.order_no as orderNo,
- c.nickname as payeeName,
- d.nickname 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.order_no = #{orderNo,jdbcType=VARCHAR} and a.delete_sign = 0
- order by a.create_time desc
- </select>
- </mapper>
|