Merge branch 'dev' of http://192.168.50.149:8085/r/aps-backend into dev
| | |
| | | /** çæ¥å½¢å¼(hup\lod) */ |
| | | @Excel(name = "çæ¥å½¢å¼") |
| | | private String type; |
| | | |
| | | /** éç¨å·¥å */ |
| | | @Excel(name = "éç¨å·¥å") |
| | | private String plant; |
| | | |
| | | /** æ¯å¦å é¤(0å¦ï¼1æ¯) */ |
| | | private Integer delFlag; |
| | |
| | | } |
| | | ApsGasPipingRouteStat queryStatParam = new ApsGasPipingRouteStat(); |
| | | BeanUtils.copyProperties(apsGasPipingRouteStat,queryStatParam); |
| | | queryStatParam.setMajor(""); |
| | | queryStatParam.setMajor(apsGasPipingRouteStat.getMajor()); |
| | | queryStatParam.setPlant(apsGasPipingRouteStat.getPlant()); |
| | | apsGasPipingRouteStats = apsGasPipingRouteStatMapper.selectApsGasPipingRouteStatList(queryStatParam); |
| | | //æ ¹æ®å¼å·¥æ¥è¿è¡ååºæåº |
| | | apsGasPipingRouteStats.sort((a, b)->a.getProcessPlanStartDay().compareTo(b.getProcessPlanStartDay())); |
| | |
| | | String dateKey = apsResourceDateStat.getPlanDay().toString(); |
| | | if(dayMap.containsKey(dateKey)){ |
| | | ApsResourceDateStat apsResourceDateStatTemp = dayMap.get(dateKey); |
| | | String capacityKey = processName + "-" + dateKey.substring(0,7); |
| | | String capacityKey = processName + "-"+ apsResourceDateStat.getPlant() + "-" + dateKey.substring(0,7); |
| | | apsResourceDateStatTemp.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getDayProduceAllNum():new BigDecimal(0)); |
| | | apsResourceDateStatTemp.setRequireTimes(apsResourceDateStatTemp.getRequireTimes().add(apsResourceDateStat.getRequireTimes())); |
| | | if(apsResourceDateStatTemp.getDesignTimes().compareTo(BigDecimal.ZERO) > 0){ |
| | |
| | | and process_name in (select process_name from aps_standard_process where major='æ°æ') |
| | | </if> |
| | | </if> |
| | | <if test="plant != null and plant != ''"> and plant = #{plant} </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | id,work_order_no, road_process_number, current_process_number, production_quantity, standard_time, |
| | | process_total_time, process_plan_start_day, design_times, del_flag, create_by, process_name, |
| | | create_time, item_number, standard_dosage, process_total_dosage, design_capacity, major, |
| | | plan_start_year, plan_start_month, plan_start_day,batch_number,process_plan_end_day,warning,order_plan_end_day |
| | | plan_start_year, plan_start_month, plan_start_day,batch_number,process_plan_end_day,warning,order_plan_end_day,plant |
| | | ) |
| | | VALUES |
| | | <foreach collection="apsGasPipingRouteStatList" item="stat" separator=","> |
| | |
| | | #{stat.standardTime}, #{stat.processTotalTime}, #{stat.processPlanStartDay}, #{stat.designTimes}, #{stat.delFlag}, |
| | | #{stat.createBy}, #{stat.processName}, #{stat.createTime}, #{stat.itemNumber}, #{stat.standardDosage}, |
| | | #{stat.processTotalDosage}, #{stat.designCapacity}, #{stat.major}, #{stat.planStartYear}, |
| | | #{stat.planStartMonth}, #{stat.planStartDay}, #{stat.batchNumber}, #{stat.processPlanEndDay},#{stat.warning},#{stat.orderPlanEndDay} |
| | | #{stat.planStartMonth}, #{stat.planStartDay}, #{stat.batchNumber}, #{stat.processPlanEndDay},#{stat.warning},#{stat.orderPlanEndDay},#{stat.plant} |
| | | ) |
| | | </foreach> |
| | | |
| | |
| | | |
| | | <select id="queryTempStat" resultMap="ApsGasPipingRouteStatResult" > |
| | | select row_number() over (partition by rt.work_order_no order by rt.process_number desc ) as num, |
| | | rt.work_order_no, |
| | | rt.work_order_no, |
| | | rt.process_name, |
| | | cast(rt.process_number as numeric(18, 2)) as road_process_number, |
| | | cast(rt.process_number as numeric(18, 2)) as route_process_number, |
| | |
| | | rt.process_plan_start_day, |
| | | rt.process_plan_end_day, |
| | | pl.plan_end_day as order_plan_end_day, |
| | | rt.item_no as item_number, |
| | | pl.plan_type as major, |
| | | false as warning |
| | | rt.item_no as item_number, |
| | | pl.plan_type as major, |
| | | false as warning, |
| | | pl.plant |
| | | from aps_gas_piping_plan as pl |
| | | left join aps_process_route as rt on pl.document_number = rt.work_order_no |
| | | where pl.document_number is not null and rt.work_order_no is not null and pl.plan_end_day is not null |
| | |
| | | <result property="hupQty" column="hup_qty" /> |
| | | <result property="lodQty" column="lod_qty" /> |
| | | <result property="type" column="type" /> |
| | | <result property="plant" column="plant" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWeldSeamStandardVo"> |
| | | select id, item_code, item_figure, item_figure_version, hup_qty, lod_qty, type, del_flag from aps_weld_seam_standard |
| | | select id, item_code, item_figure, item_figure_version, hup_qty, lod_qty, type, plant, del_flag from aps_weld_seam_standard |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamStandardList" parameterType="com.aps.core.domain.ApsWeldSeamStandard" resultMap="ApsWeldSeamStandardResult"> |
| | |
| | | <if test="hupQty != null "> and hup_qty = #{hupQty}</if> |
| | | <if test="lodQty != null "> and lod_qty = #{lodQty}</if> |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | <if test="plant != null and plant != ''"> and plant = #{plant}</if> |
| | | and del_flag = 0 |
| | | </where> |
| | | </select> |
| | |
| | | mgm.domain as ä¸ä¸ |
| | | FROM aps_gas_pipeline_mo mo |
| | | LEFT JOIN aps_weld_seam_standard ws ON mo.material_code = ws.item_code AND ws.del_flag = 0 |
| | | LEFT JOIN aps_material_product_group_management mgm ON mo.material_code = mgm.material_code |
| | | LEFT JOIN aps_material_product_group_management mgm ON mo.material_code = mgm.material_code AND mo.factory = mgm.factory |
| | | ), |
| | | 颿µçç¼è®¡ç® AS ( |
| | | -- 计ç®é¢æµççç¼æ°é |
| | |
| | | mgm.domain as ä¸ä¸ |
| | | FROM aps_gas_pipeline_prediction gp |
| | | LEFT JOIN aps_weld_seam_standard ws ON gp.material_code = ws.item_code AND ws.del_flag = 0 |
| | | LEFT JOIN aps_material_product_group_management mgm ON gp.material_code = mgm.material_code |
| | | LEFT JOIN aps_material_product_group_management mgm ON gp.material_code = mgm.material_code AND gp.factory = mgm.factory |
| | | ), |
| | | æ±æ»æ°æ® AS ( |
| | | SELECT |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.domain; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * çç¼æ å对象 aps_weld_seam_standard_job |
| | | * |
| | | * @author user |
| | | * @date 2023-11-05 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ApsWeldSeamStandardJob extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®ID */ |
| | | private Long id; |
| | | |
| | | /** æå·ï¼æ¥å£ä¸å¯¹åºplantCountæverIdï¼ */ |
| | | @Excel(name = "æå·") |
| | | private String itemCode; |
| | | |
| | | /** å¾å· */ |
| | | @Excel(name = "å¾å·") |
| | | private String itemFigure; |
| | | |
| | | /** çæ¬å· */ |
| | | @Excel(name = "çæ¬å·") |
| | | private String itemFigureVersion; |
| | | |
| | | /** åä»¶çç¼æ°ï¼Hupï¼ */ |
| | | @Excel(name = "åä»¶çç¼æ°ï¼Hupï¼") |
| | | private BigDecimal hupQty; |
| | | |
| | | /** åä»¶çç¼æ°ï¼LODï¼ */ |
| | | @Excel(name = "åä»¶çç¼æ°ï¼LODï¼") |
| | | private BigDecimal lodQty; |
| | | |
| | | /** çæ¥å½¢å¼(hup\lod) */ |
| | | @Excel(name = "çæ¥å½¢å¼") |
| | | private String type; |
| | | |
| | | /** æ¯å¦å é¤(0å¦ï¼1æ¯) */ |
| | | private Integer delFlag; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.mapper; |
| | | |
| | | import com.aps.job.domain.ApsWeldSeamStandardJob; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼æ åJob Mapperæ¥å£ |
| | | * |
| | | * @author user |
| | | * @date 2023-11-05 |
| | | */ |
| | | @Mapper |
| | | public interface ApsWeldSeamStandardJobMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢çç¼æ åå表 |
| | | * |
| | | * @param apsWeldSeamStandardJob çç¼æ å |
| | | * @return çç¼æ åéå |
| | | */ |
| | | public List<ApsWeldSeamStandardJob> selectApsWeldSeamStandardJobList(ApsWeldSeamStandardJob apsWeldSeamStandardJob); |
| | | |
| | | /** |
| | | * å 餿æçç¼æ åJobæ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteAllApsWeldSeamStandardJob(); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢çç¼æ åJob |
| | | * |
| | | * @param list çç¼æ åJobå表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchInsertApsWeldSeamStandardJob(List<ApsWeldSeamStandardJob> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.mapper; |
| | | |
| | | import com.aps.job.domain.ApsWeldSeamStandardJob; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼æ åä¸å¡è¡¨ Mapperæ¥å£ |
| | | * |
| | | * @author user |
| | | * @date 2023-11-05 |
| | | */ |
| | | @Mapper |
| | | public interface ApsWeldSeamStandardMapper |
| | | { |
| | | /** |
| | | * å 餿æçç¼æ åæ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteAllApsWeldSeamStandard(); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢çç¼æ å |
| | | * |
| | | * @param list çç¼æ åJobå表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchInsertApsWeldSeamStandard(List<ApsWeldSeamStandardJob> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service; |
| | | |
| | | import com.aps.job.domain.ApsWeldSeamStandardJob; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼æ åJob Serviceæ¥å£ |
| | | * |
| | | * @author user |
| | | * @date 2023-11-05 |
| | | */ |
| | | public interface IApsWeldSeamStandardJobService |
| | | { |
| | | /** |
| | | * æ¥è¯¢çç¼æ åå表 |
| | | * |
| | | * @param apsWeldSeamStandardJob çç¼æ å |
| | | * @return çç¼æ åéå |
| | | */ |
| | | public List<ApsWeldSeamStandardJob> selectApsWeldSeamStandardJobList(ApsWeldSeamStandardJob apsWeldSeamStandardJob); |
| | | |
| | | /** |
| | | * å 餿æçç¼æ åJobæ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteAllApsWeldSeamStandardJob(); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢çç¼æ åJob |
| | | * |
| | | * @param list çç¼æ åJobå表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchInsertApsWeldSeamStandardJob(List<ApsWeldSeamStandardJob> list); |
| | | |
| | | /** |
| | | * åæ¥ç©ææ åçç¼æ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public boolean syncWeldSeamStandardData(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.job.domain.ApsWeldSeamStandardJob; |
| | | import com.aps.job.mapper.ApsWeldSeamStandardMapper; |
| | | import com.aps.job.mapper.ApsWeldSeamStandardJobMapper; |
| | | import com.aps.job.service.IApsWeldSeamStandardJobService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | /** |
| | | * çç¼æ åJob Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author user |
| | | * @date 2023-11-05 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ApsWeldSeamStandardJobServiceImpl implements IApsWeldSeamStandardJobService |
| | | { |
| | | @Autowired |
| | | private ApsWeldSeamStandardJobMapper apsWeldSeamStandardJobMapper; |
| | | |
| | | @Autowired |
| | | private ApsWeldSeamStandardMapper apsWeldSeamStandardMapper; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Value("${pipingIntegrationplatform.apsWeldSeamStandard}") |
| | | private String apsWeldSeamStandardUrl; |
| | | |
| | | /** |
| | | * æ¥è¯¢çç¼æ åå表 |
| | | * |
| | | * @param apsWeldSeamStandardJob çç¼æ å |
| | | * @return çç¼æ åéå |
| | | */ |
| | | @Override |
| | | public List<ApsWeldSeamStandardJob> selectApsWeldSeamStandardJobList(ApsWeldSeamStandardJob apsWeldSeamStandardJob) |
| | | { |
| | | return apsWeldSeamStandardJobMapper.selectApsWeldSeamStandardJobList(apsWeldSeamStandardJob); |
| | | } |
| | | |
| | | /** |
| | | * å 餿æçç¼æ åJobæ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteAllApsWeldSeamStandardJob() |
| | | { |
| | | return apsWeldSeamStandardJobMapper.deleteAllApsWeldSeamStandardJob(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°å¢çç¼æ åJob |
| | | * |
| | | * @param list çç¼æ åJobå表 |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int batchInsertApsWeldSeamStandardJob(List<ApsWeldSeamStandardJob> list) |
| | | { |
| | | return apsWeldSeamStandardJobMapper.batchInsertApsWeldSeamStandardJob(list); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç©ææ åçç¼æ°æ® |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean syncWeldSeamStandardData() |
| | | { |
| | | try { |
| | | // 使ç¨POSTæ¹æ³è°ç¨æ¥å£ |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | |
| | | // åå¤è¯·æ±åæ° - ä¼ éå·¥å代ç å符串æ°ç»ï¼è®¾ç½®ä¸ºç©ºæ°ç» |
| | | String[] plantCodeArray = new String[0]; |
| | | |
| | | // ç´æ¥ä½¿ç¨å符串æ°ç»ä½ä¸ºè¯·æ±ä½ |
| | | HttpEntity<String[]> requestEntity = new HttpEntity<>(plantCodeArray, headers); |
| | | |
| | | ResponseEntity<String> responseEntity = restTemplate.postForEntity(apsWeldSeamStandardUrl, requestEntity, String.class); |
| | | if (!responseEntity.getStatusCode().is2xxSuccessful()) { |
| | | log.error("è·åç©ææ åçç¼æ°æ®å¤±è´¥"); |
| | | return false; |
| | | } |
| | | |
| | | String responseBody = responseEntity.getBody(); |
| | | if (StringUtils.isEmpty(responseBody)) { |
| | | return false; |
| | | } |
| | | |
| | | JSONObject responseJson = JSON.parseObject(responseBody); |
| | | |
| | | // æ£æ¥è¿åç |
| | | if (responseJson.getIntValue("code") != 0) { |
| | | return false; |
| | | } |
| | | |
| | | // è·åæ¥å£è¿åçæ°æ® |
| | | JSONArray weldSeamList = responseJson.getJSONArray("ok"); |
| | | if (weldSeamList == null || weldSeamList.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // è§£ææ°æ®å¹¶è½¬æ¢ä¸ºå®ä½å¯¹è±¡ |
| | | List<ApsWeldSeamStandardJob> jobList = new ArrayList<>(); |
| | | AtomicLong idCounter = new AtomicLong(System.currentTimeMillis()); // 使ç¨å½åæ¶é´æ³ä½ä¸ºèµ·å§ID |
| | | |
| | | for (int i = 0; i < weldSeamList.size(); i++) { |
| | | JSONObject item = weldSeamList.getJSONObject(i); |
| | | |
| | | // ä½¿ç¨æ£ç¡®çåæ®µåç§° plantCode |
| | | String plantCode = item.getString("plantCode"); |
| | | |
| | | // è·åUHPåLODæ°é |
| | | BigDecimal uhpCount = null; |
| | | BigDecimal lodCount = null; |
| | | |
| | | try { |
| | | uhpCount = item.getBigDecimal("uhpCount"); |
| | | } catch (Exception e) { |
| | | // 忽ç¥å¼å¸¸ |
| | | } |
| | | |
| | | try { |
| | | lodCount = item.getBigDecimal("lodCount"); |
| | | } catch (Exception e) { |
| | | // 忽ç¥å¼å¸¸ |
| | | } |
| | | |
| | | // å¤ææ°æ®æ¯å¦å®æ´ |
| | | if (StringUtils.isEmpty(plantCode)) { |
| | | continue; |
| | | } |
| | | |
| | | ApsWeldSeamStandardJob job = new ApsWeldSeamStandardJob(); |
| | | // 为idèµå¼ï¼ä½¿ç¨èªå¢é¿æ´å |
| | | job.setId(idCounter.incrementAndGet()); |
| | | job.setItemCode(plantCode); // æ å°å
³ç³»: plantCode -> itemCode |
| | | job.setHupQty(uhpCount); // æ å°å
³ç³»: uhpCount -> hupQty |
| | | job.setLodQty(lodCount); // æ å°å
³ç³»: lodCount -> lodQty |
| | | job.setDelFlag(0); |
| | | // ä¸å设置createByåcreateTime |
| | | jobList.add(job); |
| | | } |
| | | |
| | | if (jobList.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æ¸
ç©ºæ§æ°æ® |
| | | deleteAllApsWeldSeamStandardJob(); |
| | | |
| | | // æ¹éæå
¥æ°æ°æ® |
| | | batchInsertApsWeldSeamStandardJob(jobList); |
| | | |
| | | // åæ¥æ°æ®å°ä¸å¡è¡¨ |
| | | syncToBizTable(jobList); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("åæ¥ç©ææ åçç¼æ°æ®å¼å¸¸", e); |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åæ¥æ°æ®å°ä¸å¡è¡¨ |
| | | * |
| | | * @param jobList çç¼æ åJobæ°æ®å表 |
| | | */ |
| | | private void syncToBizTable(List<ApsWeldSeamStandardJob> jobList) { |
| | | try { |
| | | // å é¤ä¸å¡è¡¨æ°æ®ï¼å
¨éè¦çï¼ |
| | | apsWeldSeamStandardMapper.deleteAllApsWeldSeamStandard(); |
| | | |
| | | if (jobList == null || jobList.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | // æ¹éæå
¥æ°æ®å°ä¸å¡è¡¨ |
| | | apsWeldSeamStandardMapper.batchInsertApsWeldSeamStandard(jobList); |
| | | } catch (Exception e) { |
| | | log.error("åæ¥ç©ææ åçç¼æ°æ®å°ä¸å¡è¡¨å¼å¸¸", e); |
| | | throw e; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private IApsMaterialManagementJobService apsMaterialManagementJobService; |
| | | |
| | | @Autowired |
| | | private IApsWeldSeamStandardJobService apsWeldSeamStandardJobService; |
| | | |
| | | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) |
| | | { |
| | |
| | | public void setPlateSubPlansToRedis(){ |
| | | remoteCoreService.setPlateSubPlansToRedis(SecurityConstants.INNER); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç©ææ åçç¼æ°æ® |
| | | */ |
| | | public void syncWeldSeamStandardData() { |
| | | apsWeldSeamStandardJobService.syncWeldSeamStandardData(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.job.mapper.ApsWeldSeamStandardJobMapper"> |
| | | |
| | | <resultMap type="com.aps.job.domain.ApsWeldSeamStandardJob" id="ApsWeldSeamStandardJobResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | | <result property="itemFigure" column="item_figure" /> |
| | | <result property="itemFigureVersion" column="item_figure_version" /> |
| | | <result property="hupQty" column="hup_qty" /> |
| | | <result property="lodQty" column="lod_qty" /> |
| | | <result property="type" column="type" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWeldSeamStandardJobVo"> |
| | | select id, item_code, item_figure, item_figure_version, hup_qty, lod_qty, type, del_flag from aps_weld_seam_standard_job |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamStandardJobList" parameterType="com.aps.job.domain.ApsWeldSeamStandardJob" resultMap="ApsWeldSeamStandardJobResult"> |
| | | <include refid="selectApsWeldSeamStandardJobVo"/> |
| | | <where> |
| | | <if test="itemCode != null and itemCode != ''"> and item_code LIKE '%' || #{itemCode} || '%'</if> |
| | | <if test="itemFigure != null and itemFigure != ''"> and item_figure = #{itemFigure}</if> |
| | | <if test="itemFigureVersion != null and itemFigureVersion != ''"> and item_figure_version = #{itemFigureVersion}</if> |
| | | <if test="hupQty != null "> and hup_qty = #{hupQty}</if> |
| | | <if test="lodQty != null "> and lod_qty = #{lodQty}</if> |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | and del_flag = 0 |
| | | </where> |
| | | </select> |
| | | |
| | | <delete id="deleteAllApsWeldSeamStandardJob"> |
| | | delete from aps_weld_seam_standard_job |
| | | </delete> |
| | | |
| | | <insert id="batchInsertApsWeldSeamStandardJob" parameterType="java.util.List"> |
| | | insert into aps_weld_seam_standard_job( |
| | | id, |
| | | item_code, |
| | | item_figure, |
| | | item_figure_version, |
| | | hup_qty, |
| | | lod_qty, |
| | | type, |
| | | del_flag) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.itemCode}, |
| | | #{item.itemFigure}, |
| | | #{item.itemFigureVersion}, |
| | | #{item.hupQty}, |
| | | #{item.lodQty}, |
| | | #{item.type}, |
| | | 0 |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.job.mapper.ApsWeldSeamStandardMapper"> |
| | | |
| | | <delete id="deleteAllApsWeldSeamStandard"> |
| | | delete from aps_weld_seam_standard |
| | | </delete> |
| | | |
| | | <insert id="batchInsertApsWeldSeamStandard" parameterType="java.util.List"> |
| | | insert into aps_weld_seam_standard( |
| | | id, |
| | | item_code, |
| | | item_figure, |
| | | item_figure_version, |
| | | hup_qty, |
| | | lod_qty, |
| | | type, |
| | | del_flag) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.itemCode}, |
| | | #{item.itemFigure}, |
| | | #{item.itemFigureVersion}, |
| | | #{item.hupQty}, |
| | | #{item.lodQty}, |
| | | #{item.type}, |
| | | 0 |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |