| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616 |
- <?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 order_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and order_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 order_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id = #{uid,jdbcType=VARCHAR})
- </when>
- <otherwise>
- and order_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_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,
- 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="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.order_channel = #{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})
- </if>
- <!-- 特殊处理字段结束 -->
- <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="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.order_channel =#{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})
- </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.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.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.nickname as buyerName,
- c.name as salesmanName,
- a.finance_id as financeId,
- d.name as financeName,
- a.technician_id as technicianId,
- e.name as technicianName,
- a.delete_sign as deleteSign
- 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=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
- <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="buyerName != null and buyerName != ''">
- and b.nickname = #{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>
- <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
- <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="buyerName != null and buyerName != ''">
- and b.nickname = #{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>
- <if test="page_sql != null">
- ${page_sql}
- </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 1=1
- <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=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.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=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,
- 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
- 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.order_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="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
- d.department_id = f.id
- where a.order_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="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}
- </select>
- </mapper>
|