|
|
@@ -741,6 +741,91 @@
|
|
|
<delete id="deleteByChangeSplitSuper">
|
|
|
delete from t_change_task where change_split_super= #{tid};
|
|
|
</delete>
|
|
|
+ <update id="updateMemberByTid">
|
|
|
+ update t_change_task
|
|
|
+ <set>
|
|
|
+ <if test="type != null">
|
|
|
+ type= #{type},
|
|
|
+ </if>
|
|
|
+ <if test="serviceLife != null">
|
|
|
+ service_life= #{serviceLife},
|
|
|
+ </if>
|
|
|
+ <if test="serviceYear != null">
|
|
|
+ service_year= #{serviceYear},
|
|
|
+ </if>
|
|
|
+ <if test="yearSum != null">
|
|
|
+ year_sum= #{yearSum},
|
|
|
+ </if>
|
|
|
+ <if test="contractTerm != null">
|
|
|
+ contract_term= #{contractTerm},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where 1=1
|
|
|
+ <if test="cid !=null">
|
|
|
+ and cid= #{cid}
|
|
|
+ </if>
|
|
|
+ <if test="sid !=null">
|
|
|
+ and split_super= #{sid}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateTypeBatch">
|
|
|
+ update t_change_task set type= #{type}
|
|
|
+ where id in
|
|
|
+ <foreach close=")" collection="list" item="id" open="(" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectBySuper" resultType="com.goafanti.order.bo.TChangeTaskOut">
|
|
|
+ select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,
|
|
|
+ a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,a.receiver_name receiverName,
|
|
|
+ a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,a.split_super splitSuper,
|
|
|
+ a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum, a.declaration_batch declarationBatch,
|
|
|
+ a.patent_type patentType,a.contract_term contractTerm,a.change_split_super changeSplitSuper,
|
|
|
+ a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy
|
|
|
+ from t_change_task a left join business_project i on a.commodity_id=i.id
|
|
|
+ left join business_category c on i.cid=c.id
|
|
|
+ where a.split_status=2 and a.cid= #{cid}
|
|
|
+ <if test="splitSuper !=null">
|
|
|
+ and a.split_super= #{splitSuper}
|
|
|
+ </if>
|
|
|
+ <if test="changeSplitSuper !=null" >
|
|
|
+ and a.change_split_super= #{changeSplitSuper}
|
|
|
+ </if>
|
|
|
+ order by a.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectBytid" resultType="com.goafanti.common.model.TChangeTask">
|
|
|
+ select tct.id,tct.tid,tct.cid,tct.order_no orderNo
|
|
|
+ from t_change_task tct left join new_order_change noc on tct.cid =noc.id
|
|
|
+ where noc.process_state < 4 and noc.status in (0,1,2)
|
|
|
+ and tct.tid= #{tid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
|
|
|
+ update t_change_task a,(select a.split_super,GROUP_CONCAT(a.service_year) counts
|
|
|
+ from t_change_task a where a.split_status =2 and a.type in (0,1,2)
|
|
|
+ and a.split_super=#{splitSuper} and a.cid= #{cid} group by a.split_super)x
|
|
|
+ set a.service_year =x.counts
|
|
|
+ where a.tid =x.split_super and a.cid= #{cid};
|
|
|
+ </update>
|
|
|
+ <update id="updateChangeSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
|
|
|
+ update t_change_task a,(select a.change_split_super,GROUP_CONCAT(a.service_year) counts
|
|
|
+ from t_change_task a where a.split_status =2 and a.type in (0,1,2)
|
|
|
+ and a.change_split_super = #{changeSplitSuper} group by a.change_split_super)x
|
|
|
+ set a.service_year =x.counts
|
|
|
+ where a.id =x.change_split_super
|
|
|
+ </update>
|
|
|
+
|
|
|
|
|
|
</mapper>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|