id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, task_comment, `type`, create_time, split_status, split_super, receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type, change_split_super, last_year, last_year_capital, last_year_income delete from t_change_task where id = #{id,jdbcType=INTEGER} insert into t_change_task (tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, task_comment, `type`, create_time, split_status, split_super, receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type, change_split_super, last_year, last_year_capital, last_year_income) values (#{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL}, #{taskComment,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{splitStatus,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR}, #{officialCost,jdbcType=INTEGER}, #{costReduction,jdbcType=INTEGER}, #{serviceLife,jdbcType=VARCHAR}, #{serviceYear,jdbcType=VARCHAR}, #{yearSum,jdbcType=INTEGER}, #{contractTerm,jdbcType=VARCHAR}, #{declarationBatch,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{changeSplitSuper,jdbcType=INTEGER}, #{lastYear,jdbcType=VARCHAR}, #{lastYearCapital,jdbcType=DECIMAL}, #{lastYearIncome,jdbcType=DECIMAL}) insert into t_change_task tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, task_comment, `type`, create_time, split_status, split_super, receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type, change_split_super, last_year, last_year_capital, last_year_income, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL}, #{taskComment,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{splitStatus,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR}, #{officialCost,jdbcType=INTEGER}, #{costReduction,jdbcType=INTEGER}, #{serviceLife,jdbcType=VARCHAR}, #{serviceYear,jdbcType=VARCHAR}, #{yearSum,jdbcType=INTEGER}, #{contractTerm,jdbcType=VARCHAR}, #{declarationBatch,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{changeSplitSuper,jdbcType=INTEGER}, #{lastYear,jdbcType=VARCHAR}, #{lastYearCapital,jdbcType=DECIMAL}, #{lastYearIncome,jdbcType=DECIMAL}, update t_change_task tid = #{tid,jdbcType=INTEGER}, cid = #{cid,jdbcType=INTEGER}, order_no = #{orderNo,jdbcType=VARCHAR}, main = #{main,jdbcType=INTEGER}, commodity_id = #{commodityId,jdbcType=VARCHAR}, commodity_name = #{commodityName,jdbcType=VARCHAR}, commodity_quantity = #{commodityQuantity,jdbcType=INTEGER}, commodity_price = #{commodityPrice,jdbcType=DECIMAL}, task_comment = #{taskComment,jdbcType=VARCHAR}, `type` = #{type,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, split_status = #{splitStatus,jdbcType=INTEGER}, split_super = #{splitSuper,jdbcType=INTEGER}, receiver_name = #{receiverName,jdbcType=VARCHAR}, official_cost = #{officialCost,jdbcType=INTEGER}, cost_reduction = #{costReduction,jdbcType=INTEGER}, service_life = #{serviceLife,jdbcType=VARCHAR}, service_year = #{serviceYear,jdbcType=VARCHAR}, year_sum = #{yearSum,jdbcType=INTEGER}, contract_term = #{contractTerm,jdbcType=VARCHAR}, declaration_batch = #{declarationBatch,jdbcType=INTEGER}, patent_type = #{patentType,jdbcType=INTEGER}, change_split_super = #{changeSplitSuper,jdbcType=INTEGER}, last_year = #{lastYear,jdbcType=VARCHAR}, last_year_capital = #{lastYearCapital,jdbcType=DECIMAL}, last_year_income = #{lastYearIncome,jdbcType=DECIMAL}, where id = #{id,jdbcType=INTEGER} update t_change_task set tid = #{tid,jdbcType=INTEGER}, cid = #{cid,jdbcType=INTEGER}, order_no = #{orderNo,jdbcType=VARCHAR}, main = #{main,jdbcType=INTEGER}, commodity_id = #{commodityId,jdbcType=VARCHAR}, commodity_name = #{commodityName,jdbcType=VARCHAR}, commodity_quantity = #{commodityQuantity,jdbcType=INTEGER}, commodity_price = #{commodityPrice,jdbcType=DECIMAL}, task_comment = #{taskComment,jdbcType=VARCHAR}, `type` = #{type,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, split_status = #{splitStatus,jdbcType=INTEGER}, split_super = #{splitSuper,jdbcType=INTEGER}, receiver_name = #{receiverName,jdbcType=VARCHAR}, official_cost = #{officialCost,jdbcType=INTEGER}, cost_reduction = #{costReduction,jdbcType=INTEGER}, service_life = #{serviceLife,jdbcType=VARCHAR}, service_year = #{serviceYear,jdbcType=VARCHAR}, year_sum = #{yearSum,jdbcType=INTEGER}, contract_term = #{contractTerm,jdbcType=VARCHAR}, declaration_batch = #{declarationBatch,jdbcType=INTEGER}, patent_type = #{patentType,jdbcType=INTEGER}, change_split_super = #{changeSplitSuper,jdbcType=INTEGER}, last_year = #{lastYear,jdbcType=VARCHAR}, last_year_capital = #{lastYearCapital,jdbcType=DECIMAL}, last_year_income = #{lastYearIncome,jdbcType=DECIMAL} where id = #{id,jdbcType=INTEGER} insert into t_change_task ( tid, cid, split_status, order_no, commodity_id, commodity_name,main, commodity_quantity, commodity_price, task_comment, split_super , receiver_name, create_time,service_life, service_year, year_sum, contract_term,declaration_batch,patent_type, last_year,last_year_capital,last_year_income) values ( #{item.tid,jdbcType=INTEGER}, #{item.cid,jdbcType=INTEGER}, #{item.splitStatus,jdbcType=INTEGER}, #{item.orderNo,jdbcType=VARCHAR}, #{item.commodityId,jdbcType=VARCHAR}, #{item.commodityName,jdbcType=VARCHAR},#{item.main}, #{item.commodityQuantity,jdbcType=INTEGER}, #{item.commodityPrice,jdbcType=DECIMAL}, #{item.taskComment,jdbcType=VARCHAR}, #{item.splitSuper,jdbcType=INTEGER}, #{item.receiverName,jdbcType=VARCHAR}, now(), #{item.serviceLife,jdbcType=VARCHAR}, #{item.serviceYear,jdbcType=VARCHAR}, #{item.yearSum,jdbcType=INTEGER},#{item.contractTerm,jdbcType=VARCHAR}, #{item.declarationBatch,jdbcType=INTEGER},#{item.patentType,jdbcType=INTEGER}, #{item.lastYear,jdbcType=VARCHAR}, #{item.lastYearCapital,jdbcType=DECIMAL},#{item.lastYearIncome,jdbcType=DECIMAL}) update t_change_task type= #{type}, service_life=null,year_sum=null, where 1=1 and tid= #{tid} and cid= #{cid} and split_super= #{sid} delete from t_change_task where tid= #{tid}; delete from t_change_task where change_split_super= #{tid}; update t_change_task type= #{type}, service_life= #{serviceLife}, service_year= #{serviceYear}, year_sum= #{yearSum}, contract_term= #{contractTerm}, where 1=1 and cid= #{cid} and split_super= #{sid} update t_change_task set type= #{type} where id in #{id} 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 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