|
|
@@ -65,6 +65,8 @@
|
|
|
<result column="process_status" jdbcType="INTEGER" property="processStatus" />
|
|
|
<result column="member_type" jdbcType="INTEGER" property="memberType" />
|
|
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
|
|
|
+ <result column="satisfaction_degree" jdbcType="INTEGER" property="satisfactionDegree" />
|
|
|
+ <result column="satisfaction_degree_url" jdbcType="VARCHAR" property="satisfactionDegreeUrl" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
|
|
|
@@ -77,7 +79,7 @@
|
|
|
declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
|
|
|
high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
|
|
|
time_record, if_publicity, check_status, patent_type, pubicity_url, process_status,
|
|
|
- member_type, picture_url
|
|
|
+ member_type, picture_url, satisfaction_degree, satisfaction_degree_url
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -89,12 +91,11 @@
|
|
|
delete from t_order_task
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
-
|
|
|
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
|
|
|
- insert into t_order_task (id, order_no, main,
|
|
|
- super_id, commodity_id, commodity_name,
|
|
|
- commodity_quantity, commodity_mode, commodity_price,
|
|
|
- task_status, task_distribution_time, task_allocator,
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
|
|
|
+ insert into t_order_task (order_no, main, super_id,
|
|
|
+ commodity_id, commodity_name, commodity_quantity,
|
|
|
+ commodity_mode, commodity_price, task_status,
|
|
|
+ task_distribution_time, task_allocator,
|
|
|
task_receiver, task_comment, task_start_time,
|
|
|
task_end_time, attachment_url, project_status,
|
|
|
accept_time, review_time, publicity_time,
|
|
|
@@ -111,12 +112,13 @@
|
|
|
special_comment, if_certification_fee, certification_fee,
|
|
|
certification_corporate, time_record, if_publicity,
|
|
|
check_status, patent_type, pubicity_url,
|
|
|
- process_status, member_type, picture_url
|
|
|
+ process_status, member_type, picture_url,
|
|
|
+ satisfaction_degree, satisfaction_degree_url
|
|
|
)
|
|
|
- values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER},
|
|
|
- #{superId,jdbcType=VARCHAR}, #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR},
|
|
|
- #{commodityQuantity,jdbcType=INTEGER}, #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL},
|
|
|
- #{taskStatus,jdbcType=INTEGER}, #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR},
|
|
|
+ values (#{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{superId,jdbcType=VARCHAR},
|
|
|
+ #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER},
|
|
|
+ #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL}, #{taskStatus,jdbcType=INTEGER},
|
|
|
+ #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR},
|
|
|
#{taskReceiver,jdbcType=VARCHAR}, #{taskComment,jdbcType=VARCHAR}, #{taskStartTime,jdbcType=TIMESTAMP},
|
|
|
#{taskEndTime,jdbcType=TIMESTAMP}, #{attachmentUrl,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
|
|
|
#{acceptTime,jdbcType=DATE}, #{reviewTime,jdbcType=DATE}, #{publicityTime,jdbcType=DATE},
|
|
|
@@ -133,16 +135,13 @@
|
|
|
#{specialComment,jdbcType=VARCHAR}, #{ifCertificationFee,jdbcType=INTEGER}, #{certificationFee,jdbcType=DECIMAL},
|
|
|
#{certificationCorporate,jdbcType=VARCHAR}, #{timeRecord,jdbcType=VARCHAR}, #{ifPublicity,jdbcType=INTEGER},
|
|
|
#{checkStatus,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{pubicityUrl,jdbcType=VARCHAR},
|
|
|
- #{processStatus,jdbcType=INTEGER}, #{memberType,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR}
|
|
|
+ #{processStatus,jdbcType=INTEGER}, #{memberType,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR},
|
|
|
+ #{satisfactionDegree,jdbcType=INTEGER}, #{satisfactionDegreeUrl,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
-
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
|
|
|
insert into t_order_task
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
<if test="orderNo != null">
|
|
|
order_no,
|
|
|
</if>
|
|
|
@@ -329,11 +328,14 @@
|
|
|
<if test="pictureUrl != null">
|
|
|
picture_url,
|
|
|
</if>
|
|
|
+ <if test="satisfactionDegree != null">
|
|
|
+ satisfaction_degree,
|
|
|
+ </if>
|
|
|
+ <if test="satisfactionDegreeUrl != null">
|
|
|
+ satisfaction_degree_url,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
<if test="orderNo != null">
|
|
|
#{orderNo,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -520,6 +522,12 @@
|
|
|
<if test="pictureUrl != null">
|
|
|
#{pictureUrl,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="satisfactionDegree != null">
|
|
|
+ #{satisfactionDegree,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="satisfactionDegreeUrl != null">
|
|
|
+ #{satisfactionDegreeUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
|
|
|
@@ -711,6 +719,12 @@
|
|
|
<if test="pictureUrl != null">
|
|
|
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="satisfactionDegree != null">
|
|
|
+ satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="satisfactionDegreeUrl != null">
|
|
|
+ satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -777,11 +791,12 @@
|
|
|
pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
|
|
|
process_status = #{processStatus,jdbcType=INTEGER},
|
|
|
member_type = #{memberType,jdbcType=INTEGER},
|
|
|
- picture_url = #{pictureUrl,jdbcType=VARCHAR}
|
|
|
+ picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
+ satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
|
|
|
+ satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
-
|
|
|
<select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
|
|
|
select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
|
|
|
a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
|
|
|
@@ -800,9 +815,9 @@
|
|
|
left join admin d on a.task_receiver=d.id left join t_task_member j on a.id =j.tid
|
|
|
left join t_task_mid ttm on a.id=ttm.tid
|
|
|
where a.super_id is null and a.split_status in(0,1)
|
|
|
- <if test="orderNo != null">
|
|
|
+ <if test="orderNo != null">
|
|
|
and a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
<if test="type == 1">
|
|
|
and a.process_status in(0,3)
|
|
|
</if>
|
|
|
@@ -915,16 +930,16 @@
|
|
|
|
|
|
<select id="selectOrderTaskListCount" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_task a
|
|
|
- left join t_order_new e on a.order_no=e.order_no
|
|
|
+ left join t_order_new e on a.order_no=e.order_no
|
|
|
<if test="cid != null">
|
|
|
left join business_project b on a.commodity_id=b.id
|
|
|
left join business_category c on b.cid=c.id
|
|
|
</if>
|
|
|
<if test="name != null">
|
|
|
- left join user f on e.buyer_id=f.id
|
|
|
+ left join user f on e.buyer_id=f.id
|
|
|
</if>
|
|
|
<if test="outsourceStatus !=null">
|
|
|
- left join t_order_outsource l on a.id=l.tid
|
|
|
+ left join t_order_outsource l on a.id=l.tid
|
|
|
</if>
|
|
|
where e.delete_sign in (0,2,3) and e.order_status in (2,4)
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
@@ -1000,7 +1015,8 @@
|
|
|
a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
|
|
|
a.cost_reduction costReduction, a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
|
|
|
a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus,
|
|
|
- ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity
|
|
|
+ ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity,
|
|
|
+ a.satisfaction_degree satisfactionDegree,a.satisfaction_degree_url satisfactionDegreeUrl
|
|
|
from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
|
|
|
left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
|
|
|
left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id LEFT JOIN t_task_mid ttm ON a.id=ttm.tid
|
|
|
@@ -1032,7 +1048,7 @@
|
|
|
<if test="name != null">
|
|
|
and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
- <if test="thchId != null">
|
|
|
+ <if test="thchId != null">
|
|
|
and a.task_receiver = #{thchId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
|
|
|
@@ -1191,7 +1207,7 @@
|
|
|
update t_order_task a left join t_change_task b on a.id =b.tid
|
|
|
left join (select * from admin where id= #{transferId,jdbcType=VARCHAR})c on 1=1
|
|
|
set a.task_allocator= #{aid,jdbcType=VARCHAR},a.task_receiver= c.id,
|
|
|
- a.receiver_name=c.name,b.receiver_name=c.name
|
|
|
+ a.receiver_name=c.name,b.receiver_name=c.name
|
|
|
<if test="type==0">
|
|
|
,a.consultant_id=c.id
|
|
|
</if>
|
|
|
@@ -1239,16 +1255,16 @@
|
|
|
|
|
|
<select id="splitProjectList" resultType="com.goafanti.order.bo.TOrderTaskListBo">
|
|
|
select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.project_status as projectStatus,d.contact_mobile receiverMobile,
|
|
|
- e.contract_no contractNo,a.task_receiver taskReceiver, a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
|
|
|
- a.commodity_quantity as commodityQuantity,e.approval,l.refund_status outsourceStatus, ifnull(i.alreadyNumber,0) as alreadyNumber,a.task_comment taskComment ,
|
|
|
- f.nickname as userName,h.name as depName, j.name as outsourceName ,ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper,a.member_type memberType,
|
|
|
- date_format(a.split_time,'%Y-%m-%d %H:%i:%S') splitTimes,ad.name splitAname,a.split_id splitId,a.patent_type patentType,a.picture_url pictureUrl,
|
|
|
- ttm.service_life serviceLife,ttm.service_year serviceYear ,ttm.year_sum yearSum ,ttm.contract_term contractTerm,a.process_status processStatus
|
|
|
+ e.contract_no contractNo,a.task_receiver taskReceiver, a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
|
|
|
+ a.commodity_quantity as commodityQuantity,e.approval,l.refund_status outsourceStatus, ifnull(i.alreadyNumber,0) as alreadyNumber,a.task_comment taskComment ,
|
|
|
+ f.nickname as userName,h.name as depName, j.name as outsourceName ,ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper,a.member_type memberType,
|
|
|
+ date_format(a.split_time,'%Y-%m-%d %H:%i:%S') splitTimes,ad.name splitAname,a.split_id splitId,a.patent_type patentType,a.picture_url pictureUrl,
|
|
|
+ ttm.service_life serviceLife,ttm.service_year serviceYear ,ttm.year_sum yearSum ,ttm.contract_term contractTerm,a.process_status processStatus
|
|
|
from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
|
|
|
left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
|
|
|
left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber
|
|
|
- from task_progress group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name
|
|
|
- from outsource_organization group by order_no) j on a.order_no=j.order_no left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid
|
|
|
+ from task_progress group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name
|
|
|
+ from outsource_organization group by order_no) j on a.order_no=j.order_no left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid
|
|
|
left join t_order_outsource l on a.id=l.tid left join admin ad on ad.id=a.split_aid left join t_task_member ttm on a.id=ttm.tid
|
|
|
where e.order_status in (0,1,2,3,4,5)
|
|
|
and split_status =2 and a.split_super= #{tid}
|
|
|
@@ -1266,7 +1282,7 @@
|
|
|
</update>
|
|
|
<select id="getLockId" resultType="java.lang.String">
|
|
|
select id from user_lock_release a left join (select commodity_id from t_order_task
|
|
|
- where order_no = #{orderNo} GROUP by commodity_id ) b on a.business_project_id =b.commodity_id
|
|
|
+ where order_no = #{orderNo} GROUP by commodity_id ) b on a.business_project_id =b.commodity_id
|
|
|
where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
|
|
|
</select>
|
|
|
|
|
|
@@ -1282,7 +1298,7 @@
|
|
|
date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime , date_format(tp.authorize_time, '%Y-%m-%d ' ) authorizeTime, ttm.reject_count rejectCount ,
|
|
|
tm.service_life serviceLife,tm.service_year serviceyear, tm.year_sum yearsum,tm.contract_term contractTerm, a.commodity_price commodityPrice ,
|
|
|
a.special_comment specialComment,a.task_comment taskComment,ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,
|
|
|
- e.service_type serviceType,e.service_project serviceProject
|
|
|
+ e.service_type serviceType,e.service_project serviceProject, a.form_retrieve formRetrieve ,a.satisfaction_degree satisfactionDegree
|
|
|
from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id
|
|
|
left join district_glossory d on c.province=d.id left join task_progress tp on a.id=tp.task_id left join t_task_member tm on a.id=tm.tid
|
|
|
left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
|
|
|
@@ -1335,6 +1351,31 @@
|
|
|
<if test="projectId !=null">
|
|
|
and a.commodity_id = #{projectId}
|
|
|
</if>
|
|
|
+ <if test="sdStatus !=null">
|
|
|
+ <if test="sdStatus==0">
|
|
|
+ and a.form_retrieve=0
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==1">
|
|
|
+ and a.form_retrieve=1
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==2">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=0
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==3">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=1
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==4">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=2
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==5">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=3
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="deps != null">
|
|
|
and b.order_dep in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
@@ -1467,6 +1508,30 @@
|
|
|
<if test="projectStatus !=null">
|
|
|
and bp.cid= #{projectStatus}
|
|
|
</if>
|
|
|
+ <if test="sdStatus !=null">
|
|
|
+ <if test="sdStatus==0">
|
|
|
+ and a.form_retrieve=0
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==1">
|
|
|
+ and a.form_retrieve=1
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==2">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=0
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==3">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=1
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==4">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=2
|
|
|
+ </if>
|
|
|
+ <if test="sdStatus==5">
|
|
|
+ and a.form_retrieve=2
|
|
|
+ and a.satisfaction_degree=3
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
<if test="taskProjectStatus !=null">
|
|
|
and a.project_status= #{taskProjectStatus}
|
|
|
</if>
|
|
|
@@ -1506,38 +1571,38 @@
|
|
|
z.setUpCount,z.spotCheckCount,z.failCount,z.certificatesCount,z.acceptCount,z.endCount,z.authorizeCount,
|
|
|
z.rejectCount,z.applyCount,z.amountCount,z.costAmount,z.profit
|
|
|
from ( select y.dispatch_province, y.cid, y.duty_dep, sum(y.dispatch_count)distributeCount,
|
|
|
- sum(y.stock_count)stockCount, sum(y.complete_count)completeCount,sum(y.promulgate_count)publicityCount,
|
|
|
- sum(y.set_up_count)setUpCount,sum(y.spot_check_count)spotCheckCount,sum(y.fail_count)failCount,
|
|
|
- sum(y.certificates_count)certificatesCount,sum(y.accept_count)acceptCount,sum(y.end_count)endCount,
|
|
|
- sum(y.authorize_count)authorizeCount,sum(y.reject_count)rejectCount, sum(y.apply_count)applyCount,
|
|
|
- sum(y.commodity_price)amountCount,sum(y.cost_amount)costAmount, sum(y.commodity_price-y.cost_amount)profit
|
|
|
- from(select b.dispatch_province, bp.cid, b.duty_dep,
|
|
|
- b.stock_count,b.dispatch_count,b.promulgate_count, b.complete_count,b.set_up_count ,b.spot_check_count ,
|
|
|
- b.fail_count ,b.certificates_count, b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
|
|
|
- a.commodity_price ,b.cost_amount, a.task_distribution_time from t_order_task a
|
|
|
- left join t_task_mid b on a.id=b.tid left join business_project bp on a.commodity_id =bp.id
|
|
|
+ sum(y.stock_count)stockCount, sum(y.complete_count)completeCount,sum(y.promulgate_count)publicityCount,
|
|
|
+ sum(y.set_up_count)setUpCount,sum(y.spot_check_count)spotCheckCount,sum(y.fail_count)failCount,
|
|
|
+ sum(y.certificates_count)certificatesCount,sum(y.accept_count)acceptCount,sum(y.end_count)endCount,
|
|
|
+ sum(y.authorize_count)authorizeCount,sum(y.reject_count)rejectCount, sum(y.apply_count)applyCount,
|
|
|
+ sum(y.commodity_price)amountCount,sum(y.cost_amount)costAmount, sum(y.commodity_price-y.cost_amount)profit
|
|
|
+ from(select b.dispatch_province, bp.cid, b.duty_dep,
|
|
|
+ b.stock_count,b.dispatch_count,b.promulgate_count, b.complete_count,b.set_up_count ,b.spot_check_count ,
|
|
|
+ b.fail_count ,b.certificates_count, b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
|
|
|
+ a.commodity_price ,b.cost_amount, a.task_distribution_time from t_order_task a
|
|
|
+ left join t_task_mid b on a.id=b.tid left join business_project bp on a.commodity_id =bp.id
|
|
|
left join t_order_new ton on a.order_no =ton .order_no
|
|
|
where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
|
|
|
<if test="projectId !=null">
|
|
|
- and a.commodity_id = #{projectId}
|
|
|
+ and a.commodity_id = #{projectId}
|
|
|
</if>
|
|
|
<if test="province !=null">
|
|
|
- and b.dispatch_province = #{province}
|
|
|
+ and b.dispatch_province = #{province}
|
|
|
</if>
|
|
|
<if test="thchDeps !=null">
|
|
|
- and b.duty_dep in
|
|
|
+ and b.duty_dep in
|
|
|
<foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
|
|
|
#{depId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="projectType !=null">
|
|
|
- and bp.`type` = #{projectType}
|
|
|
+ and bp.`type` = #{projectType}
|
|
|
</if>
|
|
|
<if test="projectStatus !=null">
|
|
|
- and bp.cid= #{projectStatus}
|
|
|
+ and bp.cid= #{projectStatus}
|
|
|
</if>
|
|
|
<if test="startDate != null and endDate != null">
|
|
|
- and a.task_distribution_time between #{startDate} and #{endDate}
|
|
|
+ and a.task_distribution_time between #{startDate} and #{endDate}
|
|
|
</if>
|
|
|
)y
|
|
|
group by y.dispatch_province, y.cid, y.duty_dep )z
|
|
|
@@ -1783,7 +1848,7 @@
|
|
|
select a.id,a.order_no orderNo,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,
|
|
|
b.patent_name_type projectType, c.amount officialAmount,c.proportion85,b.patent_type outPatentType,d.type
|
|
|
from t_order_task a left join t_order_outsource b on a.id=b.tid left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
|
|
|
- left join business_project d on a.commodity_id=d.id
|
|
|
+ left join business_project d on a.commodity_id=d.id
|
|
|
where a.id= #{tid}
|
|
|
</select>
|
|
|
<select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
|
|
|
@@ -1855,7 +1920,7 @@
|
|
|
where b.delete_sign in (0,2)
|
|
|
and a.process_status in (1,2,3,4)
|
|
|
<if test="shiroType ==1">
|
|
|
- and b.salesman_id = #{aid}
|
|
|
+ and b.salesman_id = #{aid}
|
|
|
</if>
|
|
|
<if test="shiroType ==2">
|
|
|
and d.finance_id = #{aid}
|
|
|
@@ -1864,9 +1929,9 @@
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo}
|
|
|
</if>
|
|
|
- <if test="userName != null">
|
|
|
+ <if test="userName != null">
|
|
|
and c.buyer_name like concat('%',#{userName},'%')
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
<if test="deps != null">
|
|
|
and b.order_dep in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
@@ -1913,70 +1978,70 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="findMemberCount" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from t_order_task a left join t_order_new b on a.order_no =b.order_no
|
|
|
- left join t_order_mid c on a.order_no =c.order_no
|
|
|
- <if test="shiroType ==2">
|
|
|
- left join department d on b.order_dep =d.id
|
|
|
- </if>
|
|
|
- where b.delete_sign in (0,2)
|
|
|
- and a.process_status in (1,2,3,4)
|
|
|
- <if test="shiroType ==1">
|
|
|
- and b.salesman_id = #{aid}
|
|
|
- </if>
|
|
|
- <if test="shiroType ==2">
|
|
|
- and d.finance_id = #{aid}
|
|
|
- </if>
|
|
|
- <if test="orderNo != null">
|
|
|
- and a.order_no = #{orderNo}
|
|
|
- </if>
|
|
|
- <if test="userName != null">
|
|
|
- and c.buyer_name like concat('%',#{userName},'%')
|
|
|
- </if>
|
|
|
- <if test="deps != null">
|
|
|
- and b.order_dep in
|
|
|
- <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
- #{dep}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="contractNo != null">
|
|
|
- and b.contract_no =#{contractNo}
|
|
|
- </if>
|
|
|
- <if test="salesmanId != null">
|
|
|
- and b.salesman_id =#{salesmanId}
|
|
|
- </if>
|
|
|
- <if test="projectName != null">
|
|
|
- and a.commodity_name like concat('%',#{projectName},'%')
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 1">
|
|
|
- and b.total_amount between 10 and 20
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 2">
|
|
|
- and b.total_amount between 20 and 30
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 3">
|
|
|
- and b.total_amount between 30 and 40
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 4">
|
|
|
- and b.total_amount > 40
|
|
|
- </if>
|
|
|
- <if test="approval != null and approval < 3">
|
|
|
- and b.approval = #{approval}
|
|
|
- </if>
|
|
|
- <if test="approval != null and approval ==4">
|
|
|
- and b.approval in (1,2)
|
|
|
- </if>
|
|
|
- <if test="status != null and status !=5">
|
|
|
- and a.process_status = #{status}
|
|
|
- </if>
|
|
|
+ <select id="findMemberCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+ from t_order_task a left join t_order_new b on a.order_no =b.order_no
|
|
|
+ left join t_order_mid c on a.order_no =c.order_no
|
|
|
+ <if test="shiroType ==2">
|
|
|
+ left join department d on b.order_dep =d.id
|
|
|
+ </if>
|
|
|
+ where b.delete_sign in (0,2)
|
|
|
+ and a.process_status in (1,2,3,4)
|
|
|
+ <if test="shiroType ==1">
|
|
|
+ and b.salesman_id = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="shiroType ==2">
|
|
|
+ and d.finance_id = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ and c.buyer_name like concat('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="deps != null">
|
|
|
+ and b.order_dep in
|
|
|
+ <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="contractNo != null">
|
|
|
+ and b.contract_no =#{contractNo}
|
|
|
+ </if>
|
|
|
+ <if test="salesmanId != null">
|
|
|
+ and b.salesman_id =#{salesmanId}
|
|
|
+ </if>
|
|
|
+ <if test="projectName != null">
|
|
|
+ and a.commodity_name like concat('%',#{projectName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 1">
|
|
|
+ and b.total_amount between 10 and 20
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 2">
|
|
|
+ and b.total_amount between 20 and 30
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 3">
|
|
|
+ and b.total_amount between 30 and 40
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 4">
|
|
|
+ and b.total_amount > 40
|
|
|
+ </if>
|
|
|
+ <if test="approval != null and approval < 3">
|
|
|
+ and b.approval = #{approval}
|
|
|
+ </if>
|
|
|
+ <if test="approval != null and approval ==4">
|
|
|
+ and b.approval in (1,2)
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status !=5">
|
|
|
+ and a.process_status = #{status}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="selectByAid" resultType="com.goafanti.common.model.TChangeTask">
|
|
|
select b.id,b.cid from t_order_task a
|
|
|
- left join t_change_task b on a.id=b.tid
|
|
|
- left join new_order_change noc on b.cid =noc.id
|
|
|
+ left join t_change_task b on a.id=b.tid
|
|
|
+ left join new_order_change noc on b.cid =noc.id
|
|
|
where b.id is not null and noc.process_state < 4 and noc.status in (0,1,2)
|
|
|
- and a.task_receiver = #{aid}
|
|
|
+ and a.task_receiver = #{aid}
|
|
|
</select>
|
|
|
<select id="getSplitCount" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_task
|
|
|
@@ -1999,7 +2064,7 @@
|
|
|
and c.salesman_id =#{aid}
|
|
|
</if>
|
|
|
<if test="shiro ==2">
|
|
|
- and c.order_dep in
|
|
|
+ and c.order_dep in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
#{dep}
|
|
|
</foreach>
|
|
|
@@ -2061,7 +2126,7 @@
|
|
|
and c.salesman_id =#{aid}
|
|
|
</if>
|
|
|
<if test="shiro ==2">
|
|
|
- and c.order_dep in
|
|
|
+ and c.order_dep in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
#{dep}
|
|
|
</foreach>
|