| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465 |
- <?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.TOrderNewMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- <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="first_amount" jdbcType="DECIMAL" property="firstAmount" />
- <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
- <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
- <result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
- <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
- <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
- <result column="process_status" jdbcType="INTEGER" property="processStatus" />
- <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
- <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="sign_time" jdbcType="DATE" property="signTime" />
- <result column="settlement_time" jdbcType="DATE" property="settlementTime" />
- <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
- <result column="contract_type" jdbcType="VARCHAR" property="contractType" />
- <result column="contacts" jdbcType="VARCHAR" property="contacts" />
- <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
- <result column="legal_person" jdbcType="VARCHAR" property="legalPerson" />
- <result column="legal_person_tel" jdbcType="VARCHAR" property="legalPersonTel" />
- <result column="proof_count" jdbcType="REAL" property="proofCount" />
- <result column="proof_aid" jdbcType="VARCHAR" property="proofAid" />
- <result column="proof_time" jdbcType="TIMESTAMP" property="proofTime" />
- <result column="proof_status" jdbcType="INTEGER" property="proofStatus" />
- <result column="order_dep" jdbcType="VARCHAR" property="orderDep" />
- <result column="outsource" jdbcType="INTEGER" property="outsource" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- <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 Jun 17 11:48:15 CST 2019.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- order_no, order_type, creater, create_time, update_time, buyer_id, first_amount,
- total_amount, settlement_amount, refund_amount, order_status, liquidation_status,
- process_status, project_status, approval, order_remarks, delete_sign, salesman_id,
- finance_id, technician_id, sign_time, settlement_time, contract_no, contract_type,
- contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
- proof_time, proof_status, order_dep, outsource
- </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 Jun 17 11:48:15 CST 2019.
- -->
- contract_picture_url
- </sql>
- <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from t_order_new
- <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.TOrderNewExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_order_new
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from t_order_new
- 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 Jun 17 11:48:15 CST 2019.
- -->
- delete from t_order_new
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderNewExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- delete from t_order_new
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- insert into t_order_new (order_no, order_type, creater,
- create_time, update_time, buyer_id,
- first_amount, total_amount, settlement_amount,
- refund_amount, order_status, liquidation_status,
- process_status, project_status, approval,
- order_remarks, delete_sign, salesman_id,
- finance_id, technician_id, sign_time,
- settlement_time, contract_no, contract_type,
- contacts, contact_mobile, legal_person,
- legal_person_tel, proof_count, proof_aid,
- proof_time, proof_status, order_dep,
- outsource, contract_picture_url)
- values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
- #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL},
- #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
- #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER},
- #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR},
- #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE},
- #{settlementTime,jdbcType=DATE}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
- #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
- #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=REAL}, #{proofAid,jdbcType=VARCHAR},
- #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR},
- #{outsource,jdbcType=INTEGER}, #{contractPictureUrl,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- insert into t_order_new
- <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="firstAmount != null">
- first_amount,
- </if>
- <if test="totalAmount != null">
- total_amount,
- </if>
- <if test="settlementAmount != null">
- settlement_amount,
- </if>
- <if test="refundAmount != null">
- refund_amount,
- </if>
- <if test="orderStatus != null">
- order_status,
- </if>
- <if test="liquidationStatus != null">
- liquidation_status,
- </if>
- <if test="processStatus != null">
- process_status,
- </if>
- <if test="projectStatus != null">
- project_status,
- </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="signTime != null">
- sign_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="contacts != null">
- contacts,
- </if>
- <if test="contactMobile != null">
- contact_mobile,
- </if>
- <if test="legalPerson != null">
- legal_person,
- </if>
- <if test="legalPersonTel != null">
- legal_person_tel,
- </if>
- <if test="proofCount != null">
- proof_count,
- </if>
- <if test="proofAid != null">
- proof_aid,
- </if>
- <if test="proofTime != null">
- proof_time,
- </if>
- <if test="proofStatus != null">
- proof_status,
- </if>
- <if test="orderDep != null">
- order_dep,
- </if>
- <if test="outsource != null">
- outsource,
- </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="firstAmount != null">
- #{firstAmount,jdbcType=DECIMAL},
- </if>
- <if test="totalAmount != null">
- #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="settlementAmount != null">
- #{settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="refundAmount != null">
- #{refundAmount,jdbcType=DECIMAL},
- </if>
- <if test="orderStatus != null">
- #{orderStatus,jdbcType=INTEGER},
- </if>
- <if test="liquidationStatus != null">
- #{liquidationStatus,jdbcType=INTEGER},
- </if>
- <if test="processStatus != null">
- #{processStatus,jdbcType=INTEGER},
- </if>
- <if test="projectStatus != null">
- #{projectStatus,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="signTime != null">
- #{signTime,jdbcType=DATE},
- </if>
- <if test="settlementTime != null">
- #{settlementTime,jdbcType=DATE},
- </if>
- <if test="contractNo != null">
- #{contractNo,jdbcType=VARCHAR},
- </if>
- <if test="contractType != null">
- #{contractType,jdbcType=VARCHAR},
- </if>
- <if test="contacts != null">
- #{contacts,jdbcType=VARCHAR},
- </if>
- <if test="contactMobile != null">
- #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="legalPerson != null">
- #{legalPerson,jdbcType=VARCHAR},
- </if>
- <if test="legalPersonTel != null">
- #{legalPersonTel,jdbcType=VARCHAR},
- </if>
- <if test="proofCount != null">
- #{proofCount,jdbcType=REAL},
- </if>
- <if test="proofAid != null">
- #{proofAid,jdbcType=VARCHAR},
- </if>
- <if test="proofTime != null">
- #{proofTime,jdbcType=TIMESTAMP},
- </if>
- <if test="proofStatus != null">
- #{proofStatus,jdbcType=INTEGER},
- </if>
- <if test="orderDep != null">
- #{orderDep,jdbcType=VARCHAR},
- </if>
- <if test="outsource != null">
- #{outsource,jdbcType=INTEGER},
- </if>
- <if test="contractPictureUrl != null">
- #{contractPictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- select count(*) from t_order_new
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- <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.firstAmount != null">
- first_amount = #{record.firstAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.totalAmount != null">
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.settlementAmount != null">
- settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="record.refundAmount != null">
- refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
- </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.processStatus != null">
- process_status = #{record.processStatus,jdbcType=INTEGER},
- </if>
- <if test="record.projectStatus != null">
- project_status = #{record.projectStatus,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.signTime != null">
- sign_time = #{record.signTime,jdbcType=DATE},
- </if>
- <if test="record.settlementTime != null">
- settlement_time = #{record.settlementTime,jdbcType=DATE},
- </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.contacts != null">
- contacts = #{record.contacts,jdbcType=VARCHAR},
- </if>
- <if test="record.contactMobile != null">
- contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="record.legalPerson != null">
- legal_person = #{record.legalPerson,jdbcType=VARCHAR},
- </if>
- <if test="record.legalPersonTel != null">
- legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
- </if>
- <if test="record.proofCount != null">
- proof_count = #{record.proofCount,jdbcType=REAL},
- </if>
- <if test="record.proofAid != null">
- proof_aid = #{record.proofAid,jdbcType=VARCHAR},
- </if>
- <if test="record.proofTime != null">
- proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.proofStatus != null">
- proof_status = #{record.proofStatus,jdbcType=INTEGER},
- </if>
- <if test="record.orderDep != null">
- order_dep = #{record.orderDep,jdbcType=VARCHAR},
- </if>
- <if test="record.outsource != null">
- outsource = #{record.outsource,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 Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- 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},
- first_amount = #{record.firstAmount,jdbcType=DECIMAL},
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
- refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
- order_status = #{record.orderStatus,jdbcType=INTEGER},
- liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
- process_status = #{record.processStatus,jdbcType=INTEGER},
- project_status = #{record.projectStatus,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},
- sign_time = #{record.signTime,jdbcType=DATE},
- settlement_time = #{record.settlementTime,jdbcType=DATE},
- contract_no = #{record.contractNo,jdbcType=VARCHAR},
- contract_type = #{record.contractType,jdbcType=VARCHAR},
- contacts = #{record.contacts,jdbcType=VARCHAR},
- contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
- legal_person = #{record.legalPerson,jdbcType=VARCHAR},
- legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
- proof_count = #{record.proofCount,jdbcType=REAL},
- proof_aid = #{record.proofAid,jdbcType=VARCHAR},
- proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
- proof_status = #{record.proofStatus,jdbcType=INTEGER},
- order_dep = #{record.orderDep,jdbcType=VARCHAR},
- outsource = #{record.outsource,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 Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- 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},
- first_amount = #{record.firstAmount,jdbcType=DECIMAL},
- total_amount = #{record.totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL},
- refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
- order_status = #{record.orderStatus,jdbcType=INTEGER},
- liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
- process_status = #{record.processStatus,jdbcType=INTEGER},
- project_status = #{record.projectStatus,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},
- sign_time = #{record.signTime,jdbcType=DATE},
- settlement_time = #{record.settlementTime,jdbcType=DATE},
- contract_no = #{record.contractNo,jdbcType=VARCHAR},
- contract_type = #{record.contractType,jdbcType=VARCHAR},
- contacts = #{record.contacts,jdbcType=VARCHAR},
- contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
- legal_person = #{record.legalPerson,jdbcType=VARCHAR},
- legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
- proof_count = #{record.proofCount,jdbcType=REAL},
- proof_aid = #{record.proofAid,jdbcType=VARCHAR},
- proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
- proof_status = #{record.proofStatus,jdbcType=INTEGER},
- order_dep = #{record.orderDep,jdbcType=VARCHAR},
- outsource = #{record.outsource,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- <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="firstAmount != null">
- first_amount = #{firstAmount,jdbcType=DECIMAL},
- </if>
- <if test="totalAmount != null">
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="settlementAmount != null">
- settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
- </if>
- <if test="refundAmount != null">
- refund_amount = #{refundAmount,jdbcType=DECIMAL},
- </if>
- <if test="orderStatus != null">
- order_status = #{orderStatus,jdbcType=INTEGER},
- </if>
- <if test="liquidationStatus != null">
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- </if>
- <if test="processStatus != null">
- process_status = #{processStatus,jdbcType=INTEGER},
- </if>
- <if test="projectStatus != null">
- project_status = #{projectStatus,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="signTime != null">
- sign_time = #{signTime,jdbcType=DATE},
- </if>
- <if test="settlementTime != null">
- settlement_time = #{settlementTime,jdbcType=DATE},
- </if>
- <if test="contractNo != null">
- contract_no = #{contractNo,jdbcType=VARCHAR},
- </if>
- <if test="contractType != null">
- contract_type = #{contractType,jdbcType=VARCHAR},
- </if>
- <if test="contacts != null">
- contacts = #{contacts,jdbcType=VARCHAR},
- </if>
- <if test="contactMobile != null">
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="legalPerson != null">
- legal_person = #{legalPerson,jdbcType=VARCHAR},
- </if>
- <if test="legalPersonTel != null">
- legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
- </if>
- <if test="proofCount != null">
- proof_count = #{proofCount,jdbcType=REAL},
- </if>
- <if test="proofAid != null">
- proof_aid = #{proofAid,jdbcType=VARCHAR},
- </if>
- <if test="proofTime != null">
- proof_time = #{proofTime,jdbcType=TIMESTAMP},
- </if>
- <if test="proofStatus != null">
- proof_status = #{proofStatus,jdbcType=INTEGER},
- </if>
- <if test="orderDep != null">
- order_dep = #{orderDep,jdbcType=VARCHAR},
- </if>
- <if test="outsource != null">
- outsource = #{outsource,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.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- 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},
- first_amount = #{firstAmount,jdbcType=DECIMAL},
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
- refund_amount = #{refundAmount,jdbcType=DECIMAL},
- order_status = #{orderStatus,jdbcType=INTEGER},
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- process_status = #{processStatus,jdbcType=INTEGER},
- project_status = #{projectStatus,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},
- sign_time = #{signTime,jdbcType=DATE},
- settlement_time = #{settlementTime,jdbcType=DATE},
- contract_no = #{contractNo,jdbcType=VARCHAR},
- contract_type = #{contractType,jdbcType=VARCHAR},
- contacts = #{contacts,jdbcType=VARCHAR},
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- legal_person = #{legalPerson,jdbcType=VARCHAR},
- legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
- proof_count = #{proofCount,jdbcType=REAL},
- proof_aid = #{proofAid,jdbcType=VARCHAR},
- proof_time = #{proofTime,jdbcType=TIMESTAMP},
- proof_status = #{proofStatus,jdbcType=INTEGER},
- order_dep = #{orderDep,jdbcType=VARCHAR},
- outsource = #{outsource,jdbcType=INTEGER},
- contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Jun 17 11:48:15 CST 2019.
- -->
- update t_order_new
- 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},
- first_amount = #{firstAmount,jdbcType=DECIMAL},
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
- refund_amount = #{refundAmount,jdbcType=DECIMAL},
- order_status = #{orderStatus,jdbcType=INTEGER},
- liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
- process_status = #{processStatus,jdbcType=INTEGER},
- project_status = #{projectStatus,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},
- sign_time = #{signTime,jdbcType=DATE},
- settlement_time = #{settlementTime,jdbcType=DATE},
- contract_no = #{contractNo,jdbcType=VARCHAR},
- contract_type = #{contractType,jdbcType=VARCHAR},
- contacts = #{contacts,jdbcType=VARCHAR},
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- legal_person = #{legalPerson,jdbcType=VARCHAR},
- legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
- proof_count = #{proofCount,jdbcType=REAL},
- proof_aid = #{proofAid,jdbcType=VARCHAR},
- proof_time = #{proofTime,jdbcType=TIMESTAMP},
- proof_status = #{proofStatus,jdbcType=INTEGER},
- order_dep = #{orderDep,jdbcType=VARCHAR},
- outsource = #{outsource,jdbcType=INTEGER}
- where order_no = #{orderNo,jdbcType=VARCHAR}
- </update>
-
- <!-- 查看所有待财务管理员分配的订单数据 -->
- <select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
- select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
- o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
- ,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
- from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
- left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
- on o.order_no=e.order_no left join t_order_outsource f on f.order_no=o.order_no where delete_sign = 0
- and approval in (0,2)
- <if test="o.outsource != null">
- and o.outsource=#{o.outsource,jdbcType=INTEGER}
- </if>
- <if test="o.outsource == 1">
- and f.refund_status=1
- </if>
- and process_status >= 2 and process_status < 7
- <if test="o.processStatus == 2">
- and (o.finance_id is null or o.finance_id='')
- </if>
- <if test="o.processStatus == 3">
- and o.finance_id is not null
- and o.finance_id != ''
- </if>
- <if test="o.departmentId != null and o.departmentId != """>
- and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="o.orderNo != null and o.orderNo != """>
- and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="o.financeId != null and o.financeId != """>
- and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
- </if>
- <if test="o.contractNo != null and o.contractNo != """>
- and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
- </if>
-
- <if test="o.buyerName != null and o.buyerName != """>
- <bind name="n" value="'%' + o.buyerName + '%'" />
- and u.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
- <bind name="a" value="o.startTime + ' 00:00:00'" />
- <bind name="b" value="o.endTime + ' 23:59:59'" />
- and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
- </if>
- order by o.process_status,o.create_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
- select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
- left join t_order_outsource f on f.order_no=o.order_no where delete_sign = 0 and approval in (0,2)
- <if test="o.outsource != null">
- and o.outsource=#{o.outsource,jdbcType=INTEGER}
- </if>
- <if test="o.outsource == 1">
- and f.refund_status=1
- </if>
- and process_status >= 2 and process_status < 7
- <if test="o.processStatus == 2">
- and (o.finance_id is null or o.finance_id='')
- </if>
- <if test="o.processStatus == 3">
- and o.finance_id is not null and o.finance_id != ''
- </if>
- <if test="o.departmentId != null and o.departmentId != """>
- and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
- </if>
- <if test="o.orderNo != null and o.orderNo != """>
- and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="o.financeId != null and o.financeId != """>
- and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
- </if>
- <if test="o.contractNo != null and o.contractNo != """>
- and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
- </if>
- <if test="o.buyerName != null and o.buyerName != """>
- <bind name="n" value="'%' + o.buyerName + '%'" />
- and u.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
- <bind name="a" value="o.startTime + ' 00:00:00'" />
- <bind name="b" value="o.endTime + ' 23:59:59'" />
- and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 查看某订单状态是否符合要求 -->
- <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
- select count(*) from t_order_new
- where order_no = #{orderNo,jdbcType=VARCHAR}
- <if test="orderType != null">
- and order_type = #{orderType,jdbcType=INTEGER}
- </if>
- <if test="creater != null">
- and creater = #{creater,jdbcType=VARCHAR}
- </if>
- <if test="buyerId != null">
- and buyer_id = #{buyerId,jdbcType=VARCHAR}
- </if>
- <if test="firstAmount != null">
- and first_amount = #{firstAmount,jdbcType=DECIMAL}
- </if>
- <if test="totalAmount != null">
- and total_amount = #{totalAmount,jdbcType=DECIMAL}
- </if>
- <if test="settlementAmount != null">
- and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
- </if>
- <if test="orderStatus != null">
- and order_status = #{orderStatus,jdbcType=INTEGER}
- </if>
- <if test="liquidationStatus == 1">
- and liquidation_status between 1 and 2
- </if>
- <if test="processStatus != null">
- and process_status = #{processStatus,jdbcType=INTEGER}
- </if>
- <if test="projectStatus != null">
- and project_status = #{projectStatus,jdbcType=INTEGER}
- </if>
- <if test="approval != null">
- and approval = #{approval,jdbcType=INTEGER}
- </if>
- <if test="orderRemarks != null">
- and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
- </if>
- <if test="deleteSign != null">
- and delete_sign = #{deleteSign,jdbcType=INTEGER}
- </if>
- <if test="salesmanId != null">
- and salesman_id = #{salesmanId,jdbcType=VARCHAR}
- </if>
- <if test="financeId != null">
- and finance_id = #{financeId,jdbcType=VARCHAR}
- </if>
- <if test="technicianId != null">
- and technician_id = #{technicianId,jdbcType=VARCHAR}
- </if>
- <if test="contractNo != null">
- and contract_no = #{contractNo,jdbcType=VARCHAR}
- </if>
- <if test="contractType != null">
- and contract_type = #{contractType,jdbcType=VARCHAR}
- </if>
- <if test="contacts != null">
- and contacts = #{contacts,jdbcType=VARCHAR}
- </if>
- <if test="contactMobile != null">
- and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
- </if>
- <if test="legalPerson != null">
- and legal_person = #{legalPerson,jdbcType=VARCHAR}
- </if>
- <if test="legalPersonTel != null">
- and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 财务专员查看需要待收款的数据 -->
- <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
- select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
- o.process_status as processStatus,ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,o.approval,
- a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
- o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,o.create_time as createTime,e.name as outsourceName,
- 0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName from t_order_new o left join department d
- on o.order_dep=d.id left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id left join
- (select sum(transaction_amount) as amount ,order_no from t_order_bill_new group by order_no ) b on b.order_no = o.order_no
- left join (select order_no,max(name) as name from outsource_organization group by order_no) e
- on o.order_no=e.order_no where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
- <if test="o.processStatus == 3">
- and process_status = #{o.processStatus,jdbcType=INTEGER}
- </if>
- <if test="o.processStatus == 4">
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
- </if>
- and process_status
- and (approval = 0 or approval = 2)
- and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
- <if test="o.orderStatus != null and o.orderStatus != """>
- and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
- </if>
- <if test="o.departmentId != null and o.departmentId != """>
- and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
- </if>
- <if test="o.contractNo != null and o.contractNo != """>
- and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
- </if>
- <if test="o.liquidationStatus != null and o.liquidationStatus != """>
- and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
- </if>
-
- <if test="o.orderNo != null and o.orderNo != """>
- and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="o.buyerName != null and o.buyerName != """>
- <bind name="n" value="'%' + o.buyerName + '%'" />
- and u.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
- <bind name="a" value="o.startTime + ' 00:00:00'" />
- <bind name="b" value="o.endTime + ' 23:59:59'" />
- and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
- </if>
- order by o.liquidation_status, o.sign_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
- select count(*)
- from t_order_new o
- left join `user` u on o.buyer_id = u.id
- left join admin a on o.salesman_id = a.id
- left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
- group by order_no ) b on b.order_no = o.order_no
- where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
- <if test="o.processStatus == 3">
- and process_status = #{o.processStatus,jdbcType=INTEGER}
- </if>
- <if test="o.processStatus == 4">
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
- </if>
- and (approval = 0 or approval = 2)
- and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
- <if test="o.orderStatus != null and o.orderStatus != """>
- and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
- </if>
- <if test="o.departmentId != null and o.departmentId != """>
- and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
- </if>
- <if test="o.contractNo != null and o.contractNo != """>
- and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
- </if>
- <if test="o.liquidationStatus != null and o.liquidationStatus != """>
- and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
- </if>
- <if test="o.orderNo != null and o.orderNo != """>
- and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
- </if>
- <if test="o.buyerName != null and o.buyerName != """>
- <bind name="n" value="'%' + o.buyerName + '%'" />
- and u.nickname like #{n,jdbcType=VARCHAR}
- </if>
- <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
- <bind name="a" value="o.startTime + ' 00:00:00'" />
- <bind name="b" value="o.endTime + ' 23:59:59'" />
- and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 通过订单编号获得订单的负责人(营销员) -->
- <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
- select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
- from t_order_new o
- left join admin a on o.salesman_id = a.id
- left join `user` u on u.id = o.buyer_id
- where order_no = #{_parameter,jdbcType=VARCHAR}
- </select>
- <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
- select
- a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.contract_no as contractNo,
- b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
- a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,dep.name as depName,d.name as financeName
- <if test="specially == 2">
- ,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
- </if>
- <if test="specially == 4">
- ,f.name as consultantName,a.settlement_amount as settlementAmount
- </if>
- from t_order_new a left join `user` b on a.buyer_id=b.id
- left join admin c on a.salesman_id=c.id
- left join department dep on a.order_dep=dep.id
- left join admin d on a.finance_id=d.id
- <if test="specially == 2">
- left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
- left join admin f on e.initiate=f.id
- </if>
- <if test="specially == 4">
- left join (select * from t_order_task
- where super_id is null ) e on e.order_no=a.order_no
- left join admin f on e.task_receiver=f.id
- </if>
- where a.delete_sign = 0
- <if test="outsource != null">
- and a.outsource= #{outsource,jdbcType=INTEGER}
- </if>
- <if test="specially == 0">
- and a.order_status not in(3,5,6,7) and a.approval !=3
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="specially == 1">
- and a.process_status = 1 and a.order_status = 1
- <!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="specially == 2">
- and a.order_status in(3,5)
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="specially == 3">
- and a.approval = 1 and a.order_status=2
- </if>
- <if test="specially == 4">
- and e.main=1
- and a.process_status in (4,5,6,99)
- and a.order_status not in(5,7)
- </if>
- <if test="specially == 5">
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="distribution == 0">
- and a.process_status < 5
- </if>
- <if test="distribution == 1">
- and a.process_status = 5
- </if>
- <if test="distribution == 2">
- and a.process_status = 6
- </if>
- <if test="name != null">
- and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="depId != null">
- and dep.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- order by
- <if test="specially == 4">
- a.process_status,
- </if>
- <if test="specially != 4">
- a.order_status,
- </if>
- a.create_time
- <if test="specially != 4">
- desc
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectOrderNewListCount" resultType="java.lang.Integer">
- select
- count(*)
- from t_order_new a left join `user` b on a.buyer_id=b.id
- left join admin c on a.salesman_id=c.id
- left join department dep on a.order_dep=dep.id
- left join admin d on a.finance_id=d.id
- <if test="specially == 2">
- left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
- left join admin f on e.initiate=f.id
- </if>
- <if test="specially == 4">
- left join (select * from t_order_task
- where super_id is null ) e on e.order_no=a.order_no
- left join admin f on e.task_receiver=f.id
- </if>
- where a.delete_sign = 0
- <if test="outsource != null">
- and a.outsource= #{outsource,jdbcType=INTEGER}
- </if>
- <if test="specially == 0">
- and a.order_status not in(3,5,6,7) and a.approval !=3
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="specially == 1">
- and a.process_status =1 and a.order_status=1
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="specially == 2">
- and a.order_status in(3,5)
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="specially == 3">
- and a.approval = 1 and a.order_status=2
- </if>
- <if test="specially == 4">
- and e.main=1
- and a.process_status in (4,5,6,99)
- and a.order_status not in(5,7)
- </if>
- <if test="specially == 5">
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="distribution == 0">
- and a.process_status < 5
- </if>
- <if test="distribution == 1">
- and a.process_status = 5
- </if>
- <if test="distribution == 2">
- and a.process_status = 6
- </if>
- <if test="name != null">
- and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="depId != null">
- and dep.id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
- select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
- c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
- b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
- b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
- date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,
- a.money as accountsReceivable,if((a.money-b.settlement_amount) < 1,0,(a.money-b.settlement_amount)) as uncollectedAmount
- from t_order_dun a left join t_order_new b on a.order_no=b.order_no
- left join `user` c on b.buyer_id=c.id
- left join admin d on b.salesman_id=d.id
- left join department dep on d.department_id=dep.id
- where a.start_time is not null and b.delete_sign = 0
- <if test="name != null">
- and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="adminName != null">
- and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
- </if>
-
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="depId != null">
- and dep.id= #{depId,jdbcType=VARCHAR}
- </if>
- <if test="aid != null">
- and c.aid= #{aid,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- order by b.sign_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
- select
- count(*)
- from t_order_dun a left join t_order_new b on a.order_no=b.order_no
- left join `user` c on b.buyer_id=c.id
- where a.start_time is not null and b.delete_sign = 0
- <if test="name != null">
- and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="adminName != null">
- and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
- </if>
- <if test="depId != null">
- and dep.id= #{depId,jdbcType=VARCHAR}
- </if>
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="aid != null">
- and c.aid= #{aid,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
- select
- a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount,
- a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
- a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId,
- a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile,
- a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
- c.name as salesmanName,dep.name as depName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
- ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid,a.order_dep as orderDep,
- g.location_province as locationProvince,g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource
- from t_order_new a left join `user` b on a.buyer_id=b.id left join admin c on a.salesman_id=c.id
- left join department dep on a.order_dep=dep.id left join admin d on a.finance_id=d.id
- left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
- left join admin f on e.initiate=f.id left join organization_identity g on a.buyer_id=g.uid
- where a.order_no = #{orderNo,jdbcType=VARCHAR}
- </select>
-
- <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
- select a.id, date_format(a.create_time,'%Y-%m-%d') as createDate,a.order_no as orderNo,
- c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
- a.reason,b.liquidation_status as liquidationStatus
- from t_order_refund a left join t_order_new b on a.order_no=b.order_no
- left join `user` c on b.buyer_id=c.id
- where b.delete_sign = 0
- <if test="name != null">
- and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="aid != null">
- and a.initiate = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- order by a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
- select
- count(*)
- from t_order_refund a left join t_order_new b on a.order_no=b.order_no
- left join `user` c on b.buyer_id=c.id
- where b.delete_sign = 0
- <if test="name != null">
- and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="aid != null">
- and a.initiate = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="orderNo != null">
- and a.order_no = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="starTime !=null and endTime !=null">
- and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- </select>
-
- <!-- 财务同意退款邮件通知需要的数据 -->
- <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
- select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId, o.technician_id as technicianId,
- concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
- from t_order_refund r
- left join t_order_new o on r.order_no = o.order_no
- left join admin a on a.id = o.salesman_id
- left join admin t on t.id = o.technician_id
- left join `user` u on u.id = o.buyer_id
- where r.id = #{id,jdbcType=INTEGER}
- </select>
- <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
- select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
- b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
- a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
- from t_order_refund a
- left join t_order_new b on a.order_no=b.order_no
- where a.id= #{id,jdbcType=INTEGER}
- </select>
- <update id="updateFinance" parameterType="string">
- update t_order_new set finance_id= #{newFinance,jdbcType=VARCHAR}
- where order_no= #{orderNo,jdbcType=VARCHAR}
- and finance_id= #{aid,jdbcType=VARCHAR}
- </update>
- <select id="checkContractNo" resultType="java.lang.Integer">
- select count(contract_no) from t_order_new
- where contract_no= #{0}
- </select>
- </mapper>
|