anderx 1 год назад
Родитель
Сommit
dbec311aba

+ 0 - 1
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -87,7 +87,6 @@ public interface TOrderTaskMapper {
      */
     int deleteById(Integer id);
 
-    int updateByPrimaryKeySelective(TOrderTask record);
 
     int insertSelective(TOrderTask record);
 

+ 117 - 2
src/main/java/com/goafanti/common/mapper/TChangeTaskMapper.xml

@@ -111,6 +111,118 @@ scheme = values(scheme),
 unilateral_service = values(unilateral_service)
     </insert>
 
+    <!--通过主键修改数据-->
+    <update id="update">
+        update t_change_task
+        <set>
+            <if test="tid != null">
+                tid = #{tid},
+            </if>
+            <if test="cid != null">
+                cid = #{cid},
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                order_no = #{orderNo},
+            </if>
+            <if test="main != null">
+                main = #{main},
+            </if>
+            <if test="commodityId != null and commodityId != ''">
+                commodity_id = #{commodityId},
+            </if>
+            <if test="commodityName != null and commodityName != ''">
+                commodity_name = #{commodityName},
+            </if>
+            <if test="commodityQuantity != null">
+                commodity_quantity = #{commodityQuantity},
+            </if>
+            <if test="commodityPrice != null">
+                commodity_price = #{commodityPrice},
+            </if>
+            <if test="taskComment != null and taskComment != ''">
+                task_comment = #{taskComment},
+            </if>
+            <if test="type != null">
+                type = #{type},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="splitStatus != null">
+                split_status = #{splitStatus},
+            </if>
+            <if test="splitSuper != null">
+                split_super = #{splitSuper},
+            </if>
+            <if test="receiverName != null and receiverName != ''">
+                receiver_name = #{receiverName},
+            </if>
+            <if test="officialCost != null">
+                official_cost = #{officialCost},
+            </if>
+            <if test="costReduction != null">
+                cost_reduction = #{costReduction},
+            </if>
+            <if test="serviceLife != null and serviceLife != ''">
+                service_life = #{serviceLife},
+            </if>
+            <if test="serviceYear != null and serviceYear != ''">
+                service_year = #{serviceYear},
+            </if>
+            <if test="yearSum != null">
+                year_sum = #{yearSum},
+            </if>
+            <if test="contractTerm != null and contractTerm != ''">
+                contract_term = #{contractTerm},
+            </if>
+            <if test="declarationBatch != null">
+                declaration_batch = #{declarationBatch},
+            </if>
+            <if test="patentType != null">
+                patent_type = #{patentType},
+            </if>
+            <if test="changeSplitSuper != null">
+                change_split_super = #{changeSplitSuper},
+            </if>
+            <if test="lastYear != null and lastYear != ''">
+                last_year = #{lastYear},
+            </if>
+            <if test="lastYearCapital != null">
+                last_year_capital = #{lastYearCapital},
+            </if>
+            <if test="lastYearIncome != null">
+                last_year_income = #{lastYearIncome},
+            </if>
+            <if test="htMember != null">
+                ht_member = #{htMember},
+            </if>
+            <if test="additionalDeduction != null">
+                additional_deduction = #{additionalDeduction},
+            </if>
+            <if test="rdAwardsubsidy != null">
+                rd_awardsubsidy = #{rdAwardsubsidy},
+            </if>
+            <if test="justForms != null">
+                just_forms = #{justForms},
+            </if>
+            <if test="technologyProjectType != null">
+                technology_project_Type = #{technologyProjectType},
+            </if>
+            <if test="ordinaryRisk != null">
+                ordinary_risk = #{ordinaryRisk},
+            </if>
+            <if test="days != null">
+                days = #{days},
+            </if>
+            <if test="scheme != null">
+                scheme = #{scheme},
+            </if>
+            <if test="unilateralService != null">
+                unilateral_service = #{unilateralService},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
     
     <!--查询指定行数据-->
     <select id="findTChangeTaskList" resultMap="TChangeTaskMap">
@@ -353,7 +465,6 @@ unilateral_service = values(unilateral_service)
     <delete id="deleteById">
         delete from t_change_task where id = #{id}
     </delete>
-
     <insert id="insertSelective">
         insert into t_change_task
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -579,7 +690,9 @@ unilateral_service = values(unilateral_service)
         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,i.patent_transfer patentTransfer,
         i.type taskType, a.declaration_batch declarationBatch,a.patent_type patentType,a.contract_term contractTerm,a.cost_reduction costReduction,
-        a.change_split_super changeSplitSuper,a.last_year lastYear,a.last_year_income lastYearIncome,a.last_year_capital lastYearCapital
+        a.change_split_super changeSplitSuper,a.last_year lastYear,a.last_year_income lastYearIncome,a.last_year_capital lastYearCapital,
+        a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy,a.just_forms justForms,
+        a.technology_project_Type technologyProjectType,a.ordinary_risk ordinaryRisk,a.days,a.scheme,a.unilateral_service unilateralService
         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 1=1
@@ -701,3 +814,5 @@ unilateral_service = values(unilateral_service)
 </mapper>
 
 
+
+

+ 18 - 7
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -1179,10 +1179,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 					ot.setSplitId(pushSplitId(ot.getSplitSuper()));
 					ot.setCommodityPrice(new BigDecimal(0));
 				}
-				if (cd.getDeclarationBatch()!=null)ot.setDeclarationBatch(cd.getDeclarationBatch());
-				if (cd.getPatentType()!=null)ot.setPatentType(cd.getPatentType());
-				if (cd.getOfficialCost()!=null) ot.setOfficialCost(cd.getOfficialCost());
-				if (cd.getCostReduction()!=null) ot.setCostReduction(cd.getCostReduction());
+				ChangeTaskParam(cd,ot);
 				tOrderTaskMapper.insertSelective(ot);
 				InputAddTask inMid=new InputAddTask();
 				inMid.setId(ot.getId());
@@ -1205,9 +1202,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				ot.setCommodityPrice(cd.getCommodityPrice());
 				ot.setCommodityQuantity(cd.getCommodityQuantity());
 				ot.setSplitStatus(cd.getSplitStatus());
-				if (ot.getSplitSuper()!=null)ot.setSplitId(pushSplitId(ot.getSplitSuper()));
-				if (cd.getDeclarationBatch()!=null)ot.setDeclarationBatch(cd.getDeclarationBatch());
-				if (cd.getPatentType()!=null)ot.setPatentType(cd.getPatentType());
+				ChangeTaskParam(cd,ot);
 				tOrderTaskMapper.update(ot);
 				if (cd.getServiceLife()!=null){
 					updateTaskMember(ot.getId(),cd.getServiceLife(),cd.getServiceYear(),cd.getYearSum(),cd.getContractTerm());
@@ -1222,6 +1217,22 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		return map;
 	}
 
+	private void ChangeTaskParam(TChangeTaskOut cd, TOrderTask ot) {
+		if (cd.getDeclarationBatch()!=null)ot.setDeclarationBatch(cd.getDeclarationBatch());
+		if (cd.getPatentType()!=null)ot.setPatentType(cd.getPatentType());
+		if (cd.getOfficialCost()!=null) ot.setOfficialCost(cd.getOfficialCost());
+		if (cd.getCostReduction()!=null) ot.setCostReduction(cd.getCostReduction());
+		if (cd.getHtMember() != null) ot.setHtMember(cd.getHtMember());
+		if (cd.getAdditionalDeduction()!=null) ot.setAdditionalDeduction(cd.getAdditionalDeduction());
+		if (cd.getRdAwardsubsidy()!=null) ot.setRdAwardsubsidy(cd.getRdAwardsubsidy());
+		if (cd.getJustForms()!=null) ot.setJustForms(cd.getJustForms());
+		if (cd.getTechnologyProjectType()!=null) ot.setTechnologyProjectType(cd.getTechnologyProjectType());
+		if (cd.getOrdinaryRisk()!=null) ot.setOrdinaryRisk(cd.getOrdinaryRisk());
+		if (cd.getDays()!=null) ot.setDays(cd.getDays());
+		if (cd.getScheme()!=null) ot.setScheme(cd.getScheme());
+		if (cd.getUnilateralService()!=null) ot.setUnilateralService(cd.getUnilateralService());
+	}
+
 	private Integer pushSplitId(Integer splitSuper) {
 		//计算出拆分编号
 		Integer i = tOrderTaskMapper.getSplitCount(splitSuper);