| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <?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.TOrderOutsourceMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="refund_status" jdbcType="INTEGER" property="refundStatus" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
- <result column="amount" jdbcType="DECIMAL" property="amount" />
- <result column="company_name" jdbcType="VARCHAR" property="companyName" />
- <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
- <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
- <result column="unit_number" jdbcType="INTEGER" property="unitNumber" />
- <result column="outsource_remarks" jdbcType="VARCHAR" property="outsourceRemarks" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="tid" jdbcType="INTEGER" property="tid" />
- <result column="start_type" jdbcType="INTEGER" property="startType" />
- <result column="patent_type" jdbcType="INTEGER" property="patentType" />
- <result column="patent_name_type" jdbcType="INTEGER" property="patentNameType" />
- <result column="patent_name" jdbcType="VARCHAR" property="patentName" />
- <result column="actual_official" jdbcType="INTEGER" property="actualOfficial" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- <result column="picture_url" jdbcType="LONGVARCHAR" property="pictureUrl" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- id, order_no, refund_status, create_time, remarks, attachment_url, amount, company_name,
- audit_time, unit_price, unit_number, outsource_remarks, `type`, tid, start_type,
- patent_type, patent_name_type, patent_name, actual_official
- </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 Thu Aug 05 11:38:34 CST 2021.
- -->
- picture_url
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from t_order_outsource
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- delete from t_order_outsource
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- insert into t_order_outsource (id, order_no, refund_status,
- create_time, remarks, attachment_url,
- amount, company_name, audit_time,
- unit_price, unit_number, outsource_remarks,
- `type`, tid, start_type,
- patent_type, patent_name_type, patent_name,
- actual_official, picture_url)
- values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
- #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}, #{auditTime,jdbcType=TIMESTAMP},
- #{unitPrice,jdbcType=DECIMAL}, #{unitNumber,jdbcType=INTEGER}, #{outsourceRemarks,jdbcType=VARCHAR},
- #{type,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{startType,jdbcType=INTEGER},
- #{patentType,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER}, #{patentName,jdbcType=VARCHAR},
- #{actualOfficial,jdbcType=INTEGER}, #{pictureUrl,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- insert into t_order_outsource
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="refundStatus != null">
- refund_status,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="attachmentUrl != null">
- attachment_url,
- </if>
- <if test="amount != null">
- amount,
- </if>
- <if test="companyName != null">
- company_name,
- </if>
- <if test="auditTime != null">
- audit_time,
- </if>
- <if test="unitPrice != null">
- unit_price,
- </if>
- <if test="unitNumber != null">
- unit_number,
- </if>
- <if test="outsourceRemarks != null">
- outsource_remarks,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="tid != null">
- tid,
- </if>
- <if test="startType != null">
- start_type,
- </if>
- <if test="patentType != null">
- patent_type,
- </if>
- <if test="patentNameType != null">
- patent_name_type,
- </if>
- <if test="patentName != null">
- patent_name,
- </if>
- <if test="actualOfficial != null">
- actual_official,
- </if>
- <if test="pictureUrl != null">
- picture_url,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="refundStatus != null">
- #{refundStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="attachmentUrl != null">
- #{attachmentUrl,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DECIMAL},
- </if>
- <if test="companyName != null">
- #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="auditTime != null">
- #{auditTime,jdbcType=TIMESTAMP},
- </if>
- <if test="unitPrice != null">
- #{unitPrice,jdbcType=DECIMAL},
- </if>
- <if test="unitNumber != null">
- #{unitNumber,jdbcType=INTEGER},
- </if>
- <if test="outsourceRemarks != null">
- #{outsourceRemarks,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- #{tid,jdbcType=INTEGER},
- </if>
- <if test="startType != null">
- #{startType,jdbcType=INTEGER},
- </if>
- <if test="patentType != null">
- #{patentType,jdbcType=INTEGER},
- </if>
- <if test="patentNameType != null">
- #{patentNameType,jdbcType=INTEGER},
- </if>
- <if test="patentName != null">
- #{patentName,jdbcType=VARCHAR},
- </if>
- <if test="actualOfficial != null">
- #{actualOfficial,jdbcType=INTEGER},
- </if>
- <if test="pictureUrl != null">
- #{pictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- update t_order_outsource
- <set>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="refundStatus != null">
- refund_status = #{refundStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="attachmentUrl != null">
- attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DECIMAL},
- </if>
- <if test="companyName != null">
- company_name = #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="auditTime != null">
- audit_time = #{auditTime,jdbcType=TIMESTAMP},
- </if>
- <if test="unitPrice != null">
- unit_price = #{unitPrice,jdbcType=DECIMAL},
- </if>
- <if test="unitNumber != null">
- unit_number = #{unitNumber,jdbcType=INTEGER},
- </if>
- <if test="outsourceRemarks != null">
- outsource_remarks = #{outsourceRemarks,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- tid = #{tid,jdbcType=INTEGER},
- </if>
- <if test="startType != null">
- start_type = #{startType,jdbcType=INTEGER},
- </if>
- <if test="patentType != null">
- patent_type = #{patentType,jdbcType=INTEGER},
- </if>
- <if test="patentNameType != null">
- patent_name_type = #{patentNameType,jdbcType=INTEGER},
- </if>
- <if test="patentName != null">
- patent_name = #{patentName,jdbcType=VARCHAR},
- </if>
- <if test="actualOfficial != null">
- actual_official = #{actualOfficial,jdbcType=INTEGER},
- </if>
- <if test="pictureUrl != null">
- picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- update t_order_outsource
- set order_no = #{orderNo,jdbcType=VARCHAR},
- refund_status = #{refundStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- remarks = #{remarks,jdbcType=VARCHAR},
- attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- company_name = #{companyName,jdbcType=VARCHAR},
- audit_time = #{auditTime,jdbcType=TIMESTAMP},
- unit_price = #{unitPrice,jdbcType=DECIMAL},
- unit_number = #{unitNumber,jdbcType=INTEGER},
- outsource_remarks = #{outsourceRemarks,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- tid = #{tid,jdbcType=INTEGER},
- start_type = #{startType,jdbcType=INTEGER},
- patent_type = #{patentType,jdbcType=INTEGER},
- patent_name_type = #{patentNameType,jdbcType=INTEGER},
- patent_name = #{patentName,jdbcType=VARCHAR},
- actual_official = #{actualOfficial,jdbcType=INTEGER},
- picture_url = #{pictureUrl,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderOutsource">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Aug 05 11:38:34 CST 2021.
- -->
- update t_order_outsource
- set order_no = #{orderNo,jdbcType=VARCHAR},
- refund_status = #{refundStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- remarks = #{remarks,jdbcType=VARCHAR},
- attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- company_name = #{companyName,jdbcType=VARCHAR},
- audit_time = #{auditTime,jdbcType=TIMESTAMP},
- unit_price = #{unitPrice,jdbcType=DECIMAL},
- unit_number = #{unitNumber,jdbcType=INTEGER},
- outsource_remarks = #{outsourceRemarks,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- tid = #{tid,jdbcType=INTEGER},
- start_type = #{startType,jdbcType=INTEGER},
- patent_type = #{patentType,jdbcType=INTEGER},
- patent_name_type = #{patentNameType,jdbcType=INTEGER},
- patent_name = #{patentName,jdbcType=VARCHAR},
- actual_official = #{actualOfficial,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByOrderNo" resultType="com.goafanti.order.bo.OrderOutsourceDtails">
- select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks,
- date_format(audit_time,'%Y-%m-%d %H:%i:%S') auditTimes,attachment_url attachmentUrl, picture_url pictureUrl, amount,
- company_name companyName ,unit_price unitPrice,unit_number unitNumber,outsource_remarks outsourceRemarks,start_type startType,
- patent_name patentName,patent_type patentType,patent_name_type patentNameType,actual_official actualOfficial
- from t_order_outsource
- where 1=1
- <if test="orderNo != null">
- and order_no = #{orderNo}
- </if>
- <if test="tid == null">
- and type=0
- </if>
- <if test="tid != null">
- and tid = #{tid}
- </if>
- </select>
- <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
- select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,a.type,a.tid,
- date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
- b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,g.name financeName
- <if test="type == 1">
- ,bc.cname,pa.name pname,bp.bname,h.split_id splitId,h.split_super splitSuper ,h.split_status splitStatus
- </if>
- from t_order_outsource 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 e on d.department_id=e.id
- left join department f on b.order_dep=f.id left join admin g on f.finance_id=g.id
- <if test="type == 1">
- left join t_order_task h on a.tid=h.id left join business_project bp on h.commodity_id=bp.id
- left join business_category bc on bp.cid=bc.id left join admin pa on h.task_receiver=pa.id
- </if>
- where b.approval !=3 and start_type=0
- <if test="type != null">
- and a.type = #{type}
- </if>
-
- <if test="type ==1 and tid !=null">
- and (h.id= #{tid} or h.split_super= #{tid})
- </if>
- <if test="refundStatus != null">
- and a.refund_status= #{refundStatus}
- </if>
- <if test="contractNo != null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="name != null">
- and c.nickname like concat('%',#{name},'%')
- </if>
- <if test="starTime != null and endTime != null">
- and b.create_time between #{starTime} and #{endTime}
- </if>
- order by a.refund_status,b.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="orderOutsourceCount" resultType="java.lang.Integer">
- select count(*) from t_order_outsource 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.approval !=3 and start_type=0
- <if test="type != null">
- and a.type = #{type}
- </if>
- <if test="type ==1 and tid !=null">
- and (h.id= #{tid} or h.split_super= #{tid})
- </if>
- <if test="refundStatus != null">
- and a.refund_status= #{refundStatus}
- </if>
- <if test="contractNo != null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="name != null">
- and c.nickname like concat('%',#{name},'%')
- </if>
- <if test="starTime != null and endTime != null">
- and b.create_time between #{starTime} and #{endTime}
- </if>
- </select>
- <select id="salesmanOrderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
- select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
- date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
- b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
- from t_order_outsource 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 e on b.order_dep=e.id
- left join admin f on e.finance_id=f.id
- where b.delete_sign !=1 and b.outsource=1
- and d.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- <if test="refundStatus != null">
- and a.refund_status= #{refundStatus}
- </if>
- <if test="contractNo != null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="name != null">
- and c.nickname like concat('%',#{name},'%')
- </if>
- <if test="starTime != null and endTime != null">
- and b.create_time between #{starTime} and #{endTime}
- </if>
- order by b.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="salesmanOrderOutsourceCount" resultType="java.lang.Integer">
- select count(*) from t_order_outsource 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
- where b.delete_sign !=1 and b.outsource=1
- and d.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- <if test="refundStatus != null">
- and a.refund_status= #{refundStatus}
- </if>
- <if test="contractNo != null">
- and b.contract_no like concat('%',#{contractNo},'%')
- </if>
- <if test="name != null">
- and c.nickname like concat('%',#{name},'%')
- </if>
- <if test="starTime != null and endTime != null">
- and b.create_time between #{starTime} and #{endTime}
- </if>
- </select>
- <select id="selectByTid" parameterType="java.lang.Integer" resultType="com.goafanti.organization.bo.outProjectBo">
- select a.id,a.start_type startType,a.patent_type patentType,c.`type` projectType
- from t_order_task b left join t_order_outsource a on a.tid=b.id
- left join business_project c on b.commodity_id=c.id
- where b.id = #{tid}
- </select>
- <update id="updateByidNull">
- update t_order_outsource
- set unit_number=null,unit_price=NULL
- where id= #{id}
- </update>
- </mapper>
|