Merge branch 'master' of http://8.140.179.55:20000/r/pms-SV
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <exclusions> |
| | | <!-- å¼å
¥log4j2æ¥å¿æ¶é廿é»è®¤çlogback --> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | pms-commonçpomæç®¡ææpms-*çæ¨¡åçpomçä¾èµ |
| | | pms-commonçpomæç®¡ææpms-*çæ¨¡åçpomçä¾èµ |
| | |
| | | <artifactId>pms-common</artifactId> |
| | | <version>1.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>alibaba-dingtalk-service-sdk</artifactId> |
| | | <version>2.0.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
| | |
| | | |
| | | BaUser login(Map<String, Object> params) ; |
| | | |
| | | List<BaUser> getUserList() ; |
| | | |
| | | Long selectSomeCount(Map<String, Object> params) ; |
| | | |
| | | List<BaUser> selectSome(Map<String, Object> params) ; |
| | |
| | | |
| | | List<PltProduct> selectAll(Map<String, Object> params); |
| | | |
| | | List<PltProduct> selectByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | String selectMaxCode(); |
| | | |
| | | boolean exists(@Param("name") String name, @Param("id") Long id); |
| | | boolean exists(@Param("name") String name, @Param("type") String type , @Param("id") Long id); |
| | | |
| | | PltProduct selectByCode(String productCode); |
| | | } |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | PrAssemblyPlan selectByDeviceNo(@Param("proCode") String proCode,@Param("batchNumber") String batchNumber); |
| | | |
| | | Long countByPlanIdAndNodeId(@Param("planId") Long planId,@Param("nodeId") Long nodeId); |
| | | |
| | | List<JSONObject> selectByPlanName(@Param("planName") String planName); |
| | | |
| | | PrAssemblyPlan selectByBatchId(@Param("batchId") Long batchId); |
| | | |
| | | List<JSONObject> queryPlanList(); |
| | | |
| | | List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params); |
| | | |
| | | List<PrAssemblyPlan> selectAssyPlanSimplify(PrAssemblyPlan params); |
| New file |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPr.PrBillOfMaterial; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface PrBillOfMaterialMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrBillOfMaterial record); |
| | | |
| | | int insertSelective(PrBillOfMaterial record); |
| | | |
| | | PrBillOfMaterial selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrBillOfMaterial record); |
| | | |
| | | int updateByPrimaryKey(PrBillOfMaterial record); |
| | | |
| | | int insertMany(List<PrBillOfMaterial> records); |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductParams; |
| | | import com.dy.pmsGlobal.pojoPr.PrOrderItem; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author User |
| | | * @description é对表ãpr_order_itemãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-08-19 14:41:42 |
| | | * @Entity com.dy.pmsGlobal.pojoPr.PrOrderItem |
| | | */ |
| | | @Mapper |
| | | public interface PrOrderItemMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrOrderItem record); |
| | | |
| | | int insertSelective(PrOrderItem record); |
| | | |
| | | PrOrderItem selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrOrderItem record); |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPlt.PltProduct; |
| | | import com.dy.pmsGlobal.pojoPr.PrOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author User |
| | | * @description é对表ãpr_orderãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-08-19 14:38:52 |
| | | * @Entity com.dy.pmsGlobal.pojoPr.PrOrder |
| | | */ |
| | | @Mapper |
| | | public interface PrOrderMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int deleteLogicById(Long id); |
| | | |
| | | int insertSelective(PrOrder record); |
| | | |
| | | PrOrder selectByPrimaryKey(Long id); |
| | | |
| | | Long selectSomeCount(Map<String, Object> params); |
| | | |
| | | List<PrOrder> selectSome(Map<String, Object> params); |
| | | |
| | | List<PrOrder> selectAll(Map<String, Object> params); |
| | | |
| | | boolean exists(@Param("name") String name, @Param("id") Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrOrder record); |
| | | } |
| | |
| | | |
| | | PrProductionNode selectByPrimaryKey(Long id); |
| | | |
| | | PrProductionNode selectNodeBySort(@Param("processId") Long processId , @Param("sort") Integer sort); |
| | | |
| | | int updateByPrimaryKeySelective(PrProductionNode record); |
| | | |
| | | List<PrProductionNode> selectByProcess(@Param("processId") Long processId); |
| New file |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPr.PrSchedule; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface PrScheduleMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrSchedule record); |
| | | |
| | | int insertSelective(PrSchedule record); |
| | | |
| | | PrSchedule selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrSchedule record); |
| | | |
| | | int updateByPrimaryKey(PrSchedule record); |
| | | |
| | | Long selectSomeCount(Map<String, Object> params); |
| | | |
| | | List<PrSchedule> selectSome(Map<String, Object> params); |
| | | |
| | | List<PrSchedule> selectAll(@Param("scheduleDate") String scheduleDate,@Param("userId") Long userId); |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPr.PrScheduleRel; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface PrScheduleRelMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrScheduleRel record); |
| | | |
| | | int insertSelective(PrScheduleRel record); |
| | | |
| | | PrScheduleRel selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrScheduleRel record); |
| | | |
| | | int updateByPrimaryKey(PrScheduleRel record); |
| | | |
| | | void deleteByScheduleId(Long scheduleId); |
| | | |
| | | List<PrScheduleRel> selectByScheduleId(Long scheduleId); |
| | | } |
| | |
| | | |
| | | StaDeviceProductionLogPast selectByPrimaryKey(Long id); |
| | | |
| | | Long countLastDayLogs(); |
| | | |
| | | // void createNewTable(String newTableName); |
| | | } |
| | |
| | | /** |
| | | * å¯ç ,MD5å å¯ |
| | | */ |
| | | @NotEmpty(message = "å¯ç ä¸è½ä¸ºç©º") //ä¸è½ä¸ºç©ºä¹ä¸è½ä¸ºnull |
| | | // @NotEmpty(message = "å¯ç ä¸è½ä¸ºç©º") //ä¸è½ä¸ºç©ºä¹ä¸è½ä¸ºnull |
| | | @Length(message = "å¯ç å¿
é¡»{max}使°æ®", min = 6, max = 6) |
| | | @JSONField(serialize = false) |
| | | public String password; |
| | |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * åæ£é¡¹ç® |
| | | */ |
| | |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * æåº(ä»å¤§å°å°) |
| | | */ |
| | |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * æåº(ä»å¤§å°å°) |
| | | */ |
| | |
| | | public Long proId; |
| | | |
| | | /** |
| | | * 产åå®ä½ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long orderId; |
| | | |
| | | @TableField(exist = false) |
| | | public String orderName; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å®ä½ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | @TableField(exist = false) |
| | | public String batchNo; |
| | | @TableField(exist = false) |
| | | public String processName; |
| New file |
| | |
| | | package com.dy.pmsGlobal.pojoPr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * èç¹-ç©ææ¸
åå
³è表 |
| | | */ |
| | | @TableName(value="pr_bill_of_material", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class PrBillOfMaterial implements BaseEntity { |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | |
| | | /** |
| | | * èç¹å®ä½ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long nodeId; |
| | | |
| | | /** |
| | | * æä»¶ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long fileId; |
| | | |
| | | /** |
| | | * æä»¶ä¸è½½å°å |
| | | */ |
| | | @TableField(exist = false) |
| | | public String webUrl; |
| | | |
| | | @TableField(exist = false) |
| | | public String orgName; |
| | | @TableField(exist = false) |
| | | public String extName; |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.pojoPr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @TableName pr_order |
| | | */ |
| | | @TableName(value="pr_order", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class PrOrder implements BaseEntity { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | public Long id; |
| | | /** |
| | | * åç§° |
| | | */ |
| | | @NotEmpty(message = "åç§°ä¸è½ä¸ºç©º") |
| | | public String name; |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | public String customerName; |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | public String projectName; |
| | | /** |
| | | * 订åè´è´£äºº |
| | | */ |
| | | public String director; |
| | | /** |
| | | * è´è´£äººææºå· |
| | | */ |
| | | public String dMobile; |
| | | /** |
| | | * äº¤ä»æ¥æ |
| | | */ |
| | | public String deliveryDate; |
| | | /** |
| | | * 交ä»å°å |
| | | */ |
| | | public String deliveryAddress; |
| | | |
| | | /** |
| | | * æ¶è´§äºº |
| | | */ |
| | | public String recipient; |
| | | /** |
| | | * æ¶è´§äººææºå· |
| | | */ |
| | | public String rMobile; |
| | | |
| | | /** |
| | | * ç¶æ:æ£å¸¸(1)ãæå(0)ãç»æ(-1) |
| | | */ |
| | | public Integer status; |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long creator; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | public Date dt; |
| | | /** |
| | | * æ¯å¦å é¤ï¼1æ¯ï¼0å¦ |
| | | */ |
| | | @JSONField(serialize = false) |
| | | public Boolean deleted; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | public String remark; |
| | | |
| | | @NotNull(message = "订å项ä¸è½ä¸ºç©º") |
| | | public List<PrOrderItem> items; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.pojoPr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * |
| | | * @TableName pr_order_item |
| | | */ |
| | | @TableName(value="pr_order_item", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class PrOrderItem implements BaseEntity { |
| | | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | /** |
| | | * 订åç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long orderId; |
| | | /** |
| | | * 产åå®ä½ç¼å· |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long proId; |
| | | |
| | | @TableField(exist = false) |
| | | public String name; |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * ç产æ°é |
| | | */ |
| | | public Integer number; |
| | | /** |
| | | * 宿æ°é |
| | | */ |
| | | public Integer completeNumber; |
| | | |
| | | @JSONField(serialize = false) |
| | | public Boolean deleted; |
| | | |
| | | @TableField(exist = false) |
| | | public String completeRate; |
| | | |
| | | } |
| | |
| | | |
| | | @TableField(exist = false) |
| | | public PrWorkingInstruction instruction; |
| | | @TableField(exist = false) |
| | | public PrBillOfMaterial bill; |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField(exist = false) |
| | | public String proName; |
| | | /** |
| | | * 产åç±»å |
| | | */ |
| | | @TableField(exist = false) |
| | | public String proType; |
| | | |
| | | /** |
| | | * åç§° |
| New file |
| | |
| | | package com.dy.pmsGlobal.pojoPr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.Valid; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æç表 |
| | | */ |
| | | @TableName(value="pr_schedule", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class PrSchedule implements BaseEntity { |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | |
| | | /** |
| | | * ç¨æ·id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message="ç¨æ·idä¸è½ä¸ºç©º") |
| | | public Long userId; |
| | | @TableField(exist = false) |
| | | public String userName; |
| | | |
| | | |
| | | /** |
| | | * æçæ¥æ |
| | | */ |
| | | @NotEmpty(message="æçæ¥æä¸è½ä¸ºç©º") |
| | | public String scheduleDate; |
| | | |
| | | /** |
| | | * æ¯å¦å é¤ï¼1æ¯ï¼0å¦ |
| | | */ |
| | | @JSONField(serialize = false) |
| | | public Byte deleted; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | @Valid |
| | | @NotEmpty(message = "æçå
容ä¸è½ä¸ºç©º") |
| | | public List<PrScheduleRel> relList; |
| | | } |
| New file |
| | |
| | | package com.dy.pmsGlobal.pojoPr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * æçå表 |
| | | */ |
| | | @TableName(value="pr_schedule_rel", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class PrScheduleRel implements BaseEntity { |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | |
| | | /** |
| | | * æçid |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long scheduleId; |
| | | |
| | | /** |
| | | * ä»»å¡è®¡åid |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long planId; |
| | | @TableField(exist = false) |
| | | public String planName; |
| | | |
| | | /** |
| | | * èç¹id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long nodeId; |
| | | @TableField(exist = false) |
| | | public String nodeName; |
| | | |
| | | /** |
| | | * å·¥ç«id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long stationId; |
| | | @TableField(exist = false) |
| | | public String stationName; |
| | | |
| | | /** |
| | | * å·¥ä½å
容 |
| | | */ |
| | | @NotEmpty(message="å·¥ä½å
容ä¸è½ä¸ºç©º") |
| | | public String workDetails; |
| | | |
| | | } |
| | |
| | | */ |
| | | public String nodeContent; |
| | | /** |
| | | * ä¸ä¸ä¸ªèç¹id |
| | | */ |
| | | public Long nextNode; |
| | | |
| | | /** |
| | | * ä¸ä¸ä¸ªèç¹ä½ä¸å
容 |
| | | */ |
| | | public String nextNodeContent; |
| | | /** |
| | | * è®°å½è®¾å¤å¨æå
容 |
| | | */ |
| | | public String deviceCycleContent; |
| New file |
| | |
| | | package com.dy.pmsGlobal.util; |
| | | |
| | | import com.dingtalk.api.DefaultDingTalkClient; |
| | | import com.dingtalk.api.DingTalkClient; |
| | | import com.dingtalk.api.request.OapiRobotSendRequest; |
| | | import com.dingtalk.api.response.OapiRobotSendResponse; |
| | | import com.taobao.api.ApiException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.crypto.Mac; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class DingDingUtils { |
| | | |
| | | @Value("${dingtalk.robot.access-token}") |
| | | private String custom_robot_token; |
| | | |
| | | // public static final String USER_ID= "<you need @ group user's userId>"; |
| | | @Value("${dingtalk.at-all}") |
| | | private boolean at_all; |
| | | |
| | | @Value("${dingtalk.robot.secret}") |
| | | private String secret; |
| | | |
| | | @Value("${dingtalk.robot.url}") |
| | | private String url; |
| | | |
| | | public OapiRobotSendResponse send(String msg) { |
| | | try { |
| | | Long timestamp = System.currentTimeMillis(); |
| | | String sign = sign(timestamp, secret); |
| | | System.out.println(sign); |
| | | //signåæ®µåtimestampåæ®µå¿
é¡»æ¼æ¥å°è¯·æ±URLä¸ï¼å¦åä¼åºç° 310000 çéè¯¯ä¿¡æ¯ |
| | | DingTalkClient client = new DefaultDingTalkClient(url+"?sign="+sign+"×tamp="+timestamp); |
| | | OapiRobotSendRequest req = new OapiRobotSendRequest(); |
| | | /** |
| | | * åéææ¬æ¶æ¯ |
| | | */ |
| | | //å®ä¹ææ¬å
容 |
| | | OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); |
| | | text.setContent(msg); |
| | | //å®ä¹ @ 对象 |
| | | OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); |
| | | if(at_all) { |
| | | at.setIsAtAll(true); |
| | | } |
| | | //è®¾ç½®æ¶æ¯ç±»å |
| | | req.setMsgtype("text"); |
| | | req.setText(text); |
| | | req.setAt(at); |
| | | OapiRobotSendResponse rsp = client.execute(req, custom_robot_token); |
| | | log.error("ééååº:"+rsp); |
| | | return rsp; |
| | | } catch (ApiException e) { |
| | | e.printStackTrace(); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (InvalidKeyException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String sign(Long timestamp, String secret) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { |
| | | String stringToSign = timestamp + "\n" + secret; |
| | | Mac mac = Mac.getInstance("HmacSHA256"); |
| | | mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); |
| | | byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); |
| | | String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); |
| | | return sign; |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String MarkLogout = "102007" ; //注éï¼ç产ä½ä¸äººåå¨çäº§åæ³¨éå·¥ç«ç»å® |
| | | public static final String MarkQualified = "102008" ; //åæ ¼ï¼è®¾å¤ç产è¿ç¨ä¸æ¬å·¥ç«çäº§åæ ¼ |
| | | public static final String MarkReset = "102009" ; //éç½®ï¼å端æ¸
ç¼åä½¿ç¨ |
| | | public static final String MarkSchedule = "102010" ; //æçè¡¨ï¼æ«æåºæç表 |
| | | |
| | | public static final int MarkQrCodeWidth = 300 ; |
| | | public static final int MarkQrCodeHeight = 300 ; |
| | |
| | | {MarkWaste, "åºå"}, |
| | | {MarkLogout, "注é"}, |
| | | {MarkQualified, "åæ ¼"}, |
| | | {MarkReset, "éç½®"}} ; |
| | | {MarkReset, "éç½®"}, |
| | | {MarkSchedule, "æç表"}} ; |
| | | } |
| | | |
| | | } |
| | |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导åºäº§åä¿¡æ¯å¼å¸¸", e); |
| | | log.error("导åº{}å¼å¸¸",sheetName,e); |
| | | } |
| | | } |
| | | public static void downloadExcelSheets(HttpServletResponse response, String fileName, String sheetName, List<Converter> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | | } |
| | | /*try(ExcelWriter excelWriter = EasyExcel.write(file).build()) { |
| | | WriteSheet writeSheet; |
| | | for (SheetInfoBean bean : sheetInfoList) { |
| | | // æå»ºsheet对象 |
| | | writeSheet = EasyExcel.writerSheet(bean.getSheetName()).head(bean.getHeadClass()).build(); |
| | | // ååºsheetæ°æ® |
| | | excelWriter.write(bean.getDataList(), writeSheet); |
| | | } |
| | | // å
³æµ |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | // do something you want |
| | | }*/ |
| | | try{ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导åº{}å¼å¸¸",sheetName,e); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | cache-enabled: true #æå¼å
¨å±ç¼åå¼å
³ï¼äºçº§ç¯å¢ï¼ï¼é»è®¤å¼æ¯true |
| | | #default-enum-type-handler: com.dy.common.mybatis.envm.EnumCodeTypeHandler |
| | | |
| | | |
| | | dingtalk: |
| | | robot: |
| | | url: https://oapi.dingtalk.com/robot/send |
| | | access-token: 5004482dce6b24d0e1e655b8e4376a6418cfcebce17ff792d0e68cbb63d6eb5b |
| | | secret: SEC985ad412f35ece68bb239cad88b6fba59b19461dd8d067e80fafa1270d6ab465 |
| | | at-all: true |
| | | #ä¸è¿è¡userTokenè¿æ»¤çURLï¼@ConfigurationPropertiesè¦æ±tokennofilter䏿æåæ¯é½å°å |
| | | tokennofilter: |
| | | urls: |
| | |
| | | <if test="userId != null"> |
| | | user_id, |
| | | </if> |
| | | <if test="userName != null"> |
| | | <if test="userName != null and userName !=''"> |
| | | user_name, |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content, |
| | | </if> |
| | | <if test="code != null"> |
| | | <if test="code != null and code !=''"> |
| | | code, |
| | | </if> |
| | | <if test="msg != null"> |
| | | <if test="msg != null and msg !=''"> |
| | | msg, |
| | | </if> |
| | | <if test="ip != null"> |
| | | <if test="ip != null and ip !=''"> |
| | | ip, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="userId != null"> |
| | | #{userId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="userName != null"> |
| | | <if test="userName != null and userName !=''"> |
| | | #{userName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="code != null"> |
| | | <if test="code != null and code !=''"> |
| | | #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="msg != null"> |
| | | <if test="msg != null and msg !=''"> |
| | | #{msg,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="ip != null"> |
| | | <if test="ip != null and ip !=''"> |
| | | #{ip,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from ba_log r |
| | | <trim prefix="where " suffixOverrides="and"> |
| | | <if test="userId != null and userId != ''"> |
| | | <if test="userId != null"> |
| | | user_id = #{userId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | |
| | | <if test="content != null and content != '' "> |
| | | content like concat('%', #{content}, '%') and |
| | | </if> |
| | | <if test="dt != null and dt != '' "> |
| | | <if test="dt != null"> |
| | | DATE_FORMAT(dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="ip != null and ip != '' "> |
| | |
| | | select count(1) |
| | | from ba_log r |
| | | <trim prefix="where " suffixOverrides="and"> |
| | | <if test="userId != null and userId != ''"> |
| | | <if test="userId != null"> |
| | | user_id = #{userId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | |
| | | <if test="content != null and content != '' "> |
| | | content like concat('%', #{content}, '%') and |
| | | </if> |
| | | <if test="dt != null and dt != '' "> |
| | | <if test="dt != null"> |
| | | DATE_FORMAT(dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="ip != null and ip != '' "> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="num != null"> |
| | | <if test="num != null and num !=''"> |
| | | num, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name`, |
| | | </if> |
| | | <if test="type != null"> |
| | | `type`, |
| | | </if> |
| | | <if test="typeName != null"> |
| | | <if test="typeName!= null and typeName !=''"> |
| | | type_name, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="num != null"> |
| | | #{num}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | #{name}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | #{type}, |
| | | </if> |
| | | <if test="typeName != null"> |
| | | <if test="typeName!= null and typeName !=''"> |
| | | #{typeName}, |
| | | </if> |
| | | </trim> |
| | |
| | | <!--@mbg.generated--> |
| | | update ba_privilege |
| | | <set> |
| | | <if test="num != null"> |
| | | <if test="num != null and num !=''"> |
| | | num = #{num}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name` = #{name}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | `type` = #{type}, |
| | | </if> |
| | | <if test="typeName != null"> |
| | | <if test="typeName!= null and typeName !=''"> |
| | | type_name = #{typeName}, |
| | | </if> |
| | | </set> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name`, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | #{name}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <!--@mbg.generated--> |
| | | update ba_role |
| | | <set> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name` = #{name}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="name != null and name != ''"> |
| | | r.name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | r.disabled =#{disabled,jdbcType=BOOLEAN} and |
| | | </if> |
| | | <if test="dt != null and dt != ''"> |
| | | <if test="dt != null"> |
| | | DATE_FORMAT(r.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="name != null and name != ''"> |
| | | r.name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | r.disabled =#{disabled,jdbcType=BOOLEAN} and |
| | | </if> |
| | | <if test="dt != null and dt != ''"> |
| | | <if test="dt != null"> |
| | | DATE_FORMAT(r.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="roleId != null"> |
| | | role_id, |
| | | </if> |
| | | <if test="privilegeId != null"> |
| | | <if test="privilegeId!= null"> |
| | | privilege_id, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="roleId != null"> |
| | | #{roleId}, |
| | | </if> |
| | | <if test="privilegeId != null"> |
| | | <if test="privilegeId!= null"> |
| | | #{privilegeId}, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="sysName != null"> |
| | | <if test="sysName != null and sysName !=''"> |
| | | sys_name, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="sysName != null"> |
| | | <if test="sysName != null and sysName !=''"> |
| | | #{sysName}, |
| | | </if> |
| | | </trim> |
| | |
| | | where disabled!=1 and deleted!=1 and phone=#{phone} and password=#{password} |
| | | </select> |
| | | |
| | | <select id="getUserList" resultMap="loginResultMap" > |
| | | select |
| | | <include refid="Login_Column_List" /> |
| | | from ba_user |
| | | where disabled!=1 and deleted!=1 |
| | | </select> |
| | | |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="oneResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | <if test="phone != null and phone !=''"> |
| | | bu.phone = #{phone,jdbcType=VARCHAR} and |
| | | </if> |
| | | <!-- <if test="roleId != null">--> |
| | | <!-- <if test="roleId != null and roleId !=''">--> |
| | | <!-- ur.role_id=#{roleId,jdbcType=BIGINT} and--> |
| | | <!-- </if>--> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="phone != null and phone !=''"> |
| | | bu.phone = #{phone,jdbcType=VARCHAR} and |
| | | </if> |
| | | <!-- <if test="roleId != null">--> |
| | | <!-- <if test="roleId != null and roleId !=''">--> |
| | | <!-- ur.role_id=#{roleId,jdbcType=BIGINT} and--> |
| | | <!-- </if>--> |
| | | <if test="disabled != null"> |
| | |
| | | </select> |
| | | <select id="selectNamesByAssistants" parameterType="java.lang.String" resultType="java.lang.String"> |
| | | SELECT GROUP_CONCAT(name) AS assistantNames FROM ba_user WHERE id IN |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | <foreach collection="assistants.split(',')" item="item" separator="," open="(" close=")"> |
| | | #{item,jdbcType=BIGINT} |
| | | </foreach> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name`, |
| | | </if> |
| | | <if test="phone != null"> |
| | | <if test="phone!= null and phone !=''"> |
| | | phone, |
| | | </if> |
| | | <if test="password != null"> |
| | | <if test="password!= null and password !=''"> |
| | | `password`, |
| | | </if> |
| | | <if test="supperAdmin != null"> |
| | | <if test="supperAdmin!= null"> |
| | | supper_admin, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | #{name}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | <if test="phone!= null and phone !=''"> |
| | | #{phone}, |
| | | </if> |
| | | <if test="password != null"> |
| | | <if test="password!= null and password !=''"> |
| | | #{password}, |
| | | </if> |
| | | <if test="supperAdmin != null"> |
| | | <if test="supperAdmin!= null"> |
| | | #{supperAdmin}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <!--@mbg.generated--> |
| | | update ba_user |
| | | <set> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name` = #{name}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | <if test="phone!= null and phone !=''"> |
| | | phone = #{phone}, |
| | | </if> |
| | | <if test="password != null"> |
| | | <if test="password!= null and password !=''"> |
| | | `password` = #{password}, |
| | | </if> |
| | | <if test="supperAdmin != null"> |
| | | <if test="supperAdmin!= null"> |
| | | supper_admin = #{supperAdmin}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="userId != null"> |
| | | user_id, |
| | | </if> |
| | | <if test="roleId != null"> |
| | | <if test="roleId != null and roleId !=''"> |
| | | role_id, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="userId != null"> |
| | | #{userId}, |
| | | </if> |
| | | <if test="roleId != null"> |
| | | <if test="roleId != null and roleId !=''"> |
| | | #{roleId}, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="orgName != null"> |
| | | <if test="orgName!= null and orgName !=''"> |
| | | org_name, |
| | | </if> |
| | | <if test="extName != null"> |
| | | <if test="extName!= null and extName !=''"> |
| | | ext_name, |
| | | </if> |
| | | <if test="newName != null"> |
| | | <if test="newName!= null and newName !=''"> |
| | | new_name, |
| | | </if> |
| | | <if test="hash != null"> |
| | | <if test="hash!= null"> |
| | | hash, |
| | | </if> |
| | | <if test="filePath != null"> |
| | | <if test="filePath!= null and filePath !=''"> |
| | | file_path, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="orgName != null"> |
| | | <if test="orgName!= null and orgName !=''"> |
| | | #{orgName}, |
| | | </if> |
| | | <if test="extName != null"> |
| | | <if test="extName!= null and extName !=''"> |
| | | #{extName}, |
| | | </if> |
| | | <if test="newName != null"> |
| | | <if test="newName!= null and newName !=''"> |
| | | #{newName}, |
| | | </if> |
| | | <if test="hash != null"> |
| | | <if test="hash!= null"> |
| | | #{hash}, |
| | | </if> |
| | | <if test="filePath != null"> |
| | | <if test="filePath!= null and filePath !=''"> |
| | | #{filePath}, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <!--@mbg.generated--> |
| | | update oth_file |
| | | <set> |
| | | <if test="orgName != null"> |
| | | <if test="orgName!= null and orgName !=''"> |
| | | org_name = #{orgName}, |
| | | </if> |
| | | <if test="extName != null"> |
| | | <if test="extName!= null and extName !=''"> |
| | | ext_name = #{extName}, |
| | | </if> |
| | | <if test="newName != null"> |
| | | <if test="newName!= null and newName !=''"> |
| | | new_name = #{newName}, |
| | | </if> |
| | | <if test="hash != null"> |
| | | <if test="hash!= null"> |
| | | hash = #{hash}, |
| | | </if> |
| | | <if test="filePath != null"> |
| | | <if test="filePath!= null and filePath !=''"> |
| | | file_path = #{filePath}, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="length != null">length,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="type != null and type !=''">type,</if> |
| | | <if test="length!= null and length !=''">length,</if> |
| | | <if test="factory != null and factory !=''">factory,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=INTEGER},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="length != null">#{length,jdbcType=VARCHAR},</if> |
| | | <if test="factory != null">#{factory,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="type != null and type !=''">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="length!= null and length !=''">#{length,jdbcType=VARCHAR},</if> |
| | | <if test="factory != null and factory !=''">#{factory,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltMaterial"> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | type = #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="length != null"> |
| | | <if test="length!= null and length !=''"> |
| | | length = #{length,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="factory != null"> |
| | | <if test="factory != null and factory !=''"> |
| | | factory = #{factory,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <if test="proId != null"> |
| | | pro_id, |
| | | </if> |
| | | <if test="paramName != null"> |
| | | <if test="paramName!= null and paramName !=''"> |
| | | param_name, |
| | | </if> |
| | | <if test="paramValue != null"> |
| | | <if test="paramValue!= null and paramValue !=''"> |
| | | param_value, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="proId != null"> |
| | | #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="paramName != null"> |
| | | <if test="paramName!= null and paramName !=''"> |
| | | #{paramName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="paramValue != null"> |
| | | <if test="paramValue!= null and paramValue !=''"> |
| | | #{paramValue,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="paramName != null"> |
| | | <if test="paramName!= null and paramName !=''"> |
| | | param_name = #{paramName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="paramValue != null"> |
| | | <if test="paramValue!= null and paramValue !=''"> |
| | | param_value = #{paramValue,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="fileId != null">file_id,</if> |
| | | <if test="fileType != null">file_type,</if> |
| | | <if test="fileType != null and fileType !=''">file_type,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="fileId != null">#{fileId,jdbcType=BIGINT},</if> |
| | | <if test="fileType != null">#{fileType,jdbcType=VARCHAR},</if> |
| | | <if test="fileType != null and fileType !=''">#{fileType,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductFile"> |
| | |
| | | <if test="fileId != null"> |
| | | file_id = #{fileId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="fileType != null"> |
| | | <if test="fileType != null and fileType !=''"> |
| | | file_type = #{fileType,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <select id="selectProNameById" parameterType="java.lang.Long" resultType="java.lang.String"> |
| | | select name proName from plt_product where id=#{proId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectProTypeById" parameterType="java.lang.Long" resultType="java.lang.String"> |
| | | select type proName from plt_product where id=#{proId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap2"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="code != null"> |
| | | <if test="code != null and code !=''"> |
| | | `code`, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name`, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | `type`, |
| | | </if> |
| | | <if test="image != null"> |
| | | <if test="image!= null and image !=''"> |
| | | image, |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | director, |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="code != null"> |
| | | <if test="code != null and code !=''"> |
| | | #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="image != null"> |
| | | <if test="image!= null and image !=''"> |
| | | #{image,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | #{director,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | |
| | | <!--@mbg.generated--> |
| | | update plt_product |
| | | <set> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | `type` = #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="image != null"> |
| | | <if test="image!= null and image !=''"> |
| | | image = #{image,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | director = #{director,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | </trim> |
| | | order by id desc |
| | | </select> |
| | | <select id="selectByOrderId" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct"> |
| | | SELECT |
| | | <include refid="Join_Column_List"> |
| | | <property name="alias" value="p"/> |
| | | </include> |
| | | FROM |
| | | <if test="orderId != null and orderId != ''"> |
| | | (select distinct(pro_id) as pro_id from pr_order_item WHERE deleted!=1 AND order_id = #{orderId,jdbcType=BIGINT}) poi, |
| | | </if> |
| | | (select * from plt_product where deleted!=1) p |
| | | <if test="orderId != null and orderId != ''"> |
| | | WHERE poi.pro_id = p.id |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | <select id="selectMaxCode" resultType="java.lang.String"> |
| | | select max(code) from plt_product |
| | | </select> |
| | | <select id="exists" resultType="java.lang.Boolean"> |
| | | select count(1) from plt_product where name = #{name} |
| | | select count(1) from plt_product where name = #{name} and type = #{type} |
| | | <if test="id != null"> |
| | | and id != #{id} |
| | | </if> |
| | |
| | | <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" /> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="item != null">item,</if> |
| | | <if test="item != null and item !=''">item,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="item != null">#{item,jdbcType=VARCHAR},</if> |
| | | <if test="item != null and item !=''">#{item,jdbcType=VARCHAR},</if> |
| | | <if test="sort != null">#{sort,jdbcType=INTEGER},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | |
| | | <if test="disabled != null"> |
| | | disabled = #{disabled,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="item != null"> |
| | | <if test="item != null and item !=''"> |
| | | item = #{item,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="sort != null"> |
| | |
| | | <if test="item != null and item != ''"> |
| | | t.item like concat('%', #{item}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | <!--FIND_IN_SET(t.disabled, #{disabled}) and--> |
| | | </if> |
| | |
| | | <if test="item != null and item != ''"> |
| | | t.item like concat('%', #{item}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | |
| | | <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" /> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | insert into plt_product_scrapping_reason |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="reason != null">reason,</if> |
| | | <if test="reason != null and reason !=''">reason,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="reason != null and reason !=''">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="proId != null">#{proId,jdbcType=VARCHAR},</if> |
| | | <if test="sort != null">#{sort,jdbcType=INTEGER},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductScrappingReason"> |
| | | update plt_product_scrapping_reason |
| | | <set> |
| | | <if test="reason != null"> |
| | | <if test="reason != null and reason !=''"> |
| | | reason = #{reason,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proId != null"> |
| | |
| | | from plt_product_scrapping_reason t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="reason != null and reason != ''"> |
| | | t.reason like concat('%', #{reason}, '%') and |
| | | </if> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | | order by sort desc |
| | |
| | | from plt_product_scrapping_reason t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="reason != null and reason != ''"> |
| | | t.reason like concat('%', #{reason}, '%') and |
| | | </if> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | |
| | | <result property="sort" column="sort" jdbcType="INTEGER"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" /> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | from plt_product_test_inspection_items t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | <if test="proId != null"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="item != null and item != ''"> |
| | | t.item like concat('%', #{item}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | <!--FIND_IN_SET(t.disabled, #{disabled}) and--> |
| | | </if> |
| | |
| | | from plt_product_test_inspection_items t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | <if test="proId != null"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="item != null and item != ''"> |
| | | t.item like concat('%', #{item}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled != ''"> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="item != null">item,</if> |
| | | <if test="item != null and item !=''">item,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="sort != null">sort,</if> |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="item != null">#{item,jdbcType=VARCHAR},</if> |
| | | <if test="item != null and item !=''">#{item,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="sort != null">#{sort,jdbcType=INTEGER},</if> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="item != null"> |
| | | <if test="item != null and item !=''"> |
| | | item = #{item,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" /> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | insert into plt_product_unqualified_reason |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="reason != null">reason,</if> |
| | | <if test="reason != null and reason !=''">reason,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="reason != null and reason !=''">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="proId != null">#{proId,jdbcType=VARCHAR},</if> |
| | | <if test="sort != null">#{sort,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | |
| | | <if test="disabled != null"> |
| | | disabled = #{disabled,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="reason != null"> |
| | | <if test="reason != null and reason !=''"> |
| | | reason = #{reason,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proId != null"> |
| | |
| | | from plt_product_unqualified_reason t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="reason != null and reason != ''"> |
| | | t.reason like concat('%', #{reason}, '%') and |
| | | </if> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | | order by sort desc |
| | |
| | | from plt_product_unqualified_reason t |
| | | where t.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="proId != null and proId != ''"> |
| | | t.pro_id=#{proId} and |
| | | </if> |
| | | <if test="reason != null and reason != ''"> |
| | | t.reason like concat('%', #{reason}, '%') and |
| | | </if> |
| | | <if test="disabled != null"> |
| | | t.disabled != 1 and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | |
| | | insert into plt_production_line |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="director != null">director,</if> |
| | | <if test="dMobile != null">d_mobile,</if> |
| | | <if test="installTime != null">install_time,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="type != null and type !=''">type,</if> |
| | | <if test="factory != null and factory !=''">factory,</if> |
| | | <if test="director != null and director !=''">director,</if> |
| | | <if test="dMobile != null and dMobile !=''">d_mobile,</if> |
| | | <if test="installTime != null and installTime !=''">install_time,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="factory != null">#{factory,jdbcType=VARCHAR},</if> |
| | | <if test="director != null">#{director,jdbcType=VARCHAR},</if> |
| | | <if test="dMobile != null">#{dMobile,jdbcType=VARCHAR},</if> |
| | | <if test="installTime != null">#{installTime,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="type != null and type !=''">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="factory != null and factory !=''">#{factory,jdbcType=VARCHAR},</if> |
| | | <if test="director != null and director !=''">#{director,jdbcType=VARCHAR},</if> |
| | | <if test="dMobile != null and dMobile !=''">#{dMobile,jdbcType=VARCHAR},</if> |
| | | <if test="installTime != null and installTime !=''">#{installTime,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductionLine"> |
| | | update plt_production_line |
| | | <set> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null"> |
| | | <if test="type != null and type !=''"> |
| | | type = #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="factory != null"> |
| | | <if test="factory != null and factory !=''"> |
| | | factory = #{factory,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | director = #{director,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="installTime != null"> |
| | | <if test="installTime != null and installTime !=''"> |
| | | install_time = #{installTime,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from plt_production_line where deleted != 1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="factory != null"> |
| | | <if test="factory != null and factory !=''"> |
| | | factory like concat('%', #{factory}, '%') and |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | |
| | | select count(1) |
| | | from plt_production_line where deleted != 1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="factory != null"> |
| | | <if test="factory != null and factory !=''"> |
| | | factory like concat('%', #{factory}, '%') and |
| | | </if> |
| | | <if test="director != null"> |
| | | <if test="director != null and director !=''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="dMobile != null"> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="lineId != null">line_id,</if> |
| | | <if test="code != null">code,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="code != null and code !=''">code,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="lineId != null">#{lineId,jdbcType=VARCHAR},</if> |
| | | <if test="code != null">#{code,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="code != null and code !=''">#{code,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | </trim> |
| | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation"> |
| | | update plt_station |
| | | <set> |
| | | <if test="code != null"> |
| | | <if test="code != null and code !=''"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="lineId != null"> |
| | | line_id = #{lineId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from plt_station where deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="id != null and id !=''"> |
| | | <if test="id != null"> |
| | | id = #{id,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="code != null and code !=''"> |
| | |
| | | <if test="name != null and name !=''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="disabled != null and disabled !=''"> |
| | | <if test="disabled != null"> |
| | | disabled = #{disabled,jdbcType=TINYINT} and |
| | | </if> |
| | | <if test="lineId != null and lineId !=''"> |
| | | <if test="lineId != null"> |
| | | line_id = #{lineId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="orderId" column="order_id" jdbcType="BIGINT"/> |
| | | <result property="proId" column="pro_id" jdbcType="BIGINT"/> |
| | | <result property="batchId" column="batch_id" jdbcType="BIGINT"/> |
| | | <result property="processId" column="process_id" jdbcType="BIGINT"/> |
| | |
| | | <result property="outputNumber" column="output_number" jdbcType="INTEGER"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager"/> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | <association property="creatorName" column="creator" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager"/> |
| | | <association property="batchNo" column="batch_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPr.PrBatchNumberMapper.selectBatchNoById" fetchType="eager"/> |
| | | <association property="processName" column="process_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager"/> |
| | | <association property="orderName" column="order_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPr.PrOrderMapper.selectOrderNameById" fetchType="eager" /> |
| | | <collection property="process" ofType="com.dy.pmsGlobal.pojoPr.PrProductionProcess" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByPrimaryKey" fetchType="eager" |
| | | column="process_id"/> |
| | |
| | | |
| | | <resultMap id="PlanResultMap" type="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="orderId" column="order_id" jdbcType="BIGINT"/> |
| | | <result property="proId" column="pro_id" jdbcType="BIGINT"/> |
| | | <result property="batchId" column="batch_id" jdbcType="BIGINT"/> |
| | | <result property="processId" column="process_id" jdbcType="BIGINT"/> |
| | |
| | | column="process_id"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id |
| | | id,order_id |
| | | ,pro_id,batch_id, |
| | | process_id,name,number, |
| | | status,creator, |
| | |
| | | </sql> |
| | | <sql id="part_Column_List" > |
| | | ${alias}.id, |
| | | ${alias}.order_id, |
| | | ${alias}.pro_id, |
| | | ${alias}.batch_id, |
| | | ${alias}.process_id, |
| | |
| | | from pr_assembly_plan |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectByBatchId" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from pr_assembly_plan |
| | | where batch_id = #{batchId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from pr_assembly_plan |
| | | <trim prefix="where" suffixOverrides="and"> |
| | | <if test="orderId != null"> |
| | | order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="number != null"> |
| | |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT} and |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="startDate != null"> |
| | | <if test="startDate != null and startDate !=''"> |
| | | start_date = #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null"> |
| | | <if test="endDate != null and endDate !=''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT} and |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content = #{content,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from pr_assembly_plan |
| | | <trim prefix="where" suffixOverrides="and"> |
| | | <if test="orderId != null"> |
| | | order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="number != null"> |
| | |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT} and |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="startDate != null"> |
| | | <if test="startDate != null and startDate !=''"> |
| | | start_date = #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null"> |
| | | <if test="endDate != null and endDate !=''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT} and |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content = #{content,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" |
| | | useGeneratedKeys="true"> |
| | | insert into pr_assembly_plan |
| | | ( id, pro_id, batch_id |
| | | ( id,order_id, pro_id, batch_id |
| | | , process_id, name, number |
| | | , status, creator |
| | | , dt, start_date, end_date |
| | | , deleted, content, input_number, output_number) |
| | | values ( #{id,jdbcType=BIGINT}, #{proId,jdbcType=BIGINT}, #{batchId,jdbcType=BIGINT} |
| | | values ( #{id,jdbcType=BIGINT},#{orderId,jdbcType=BIGINT}, #{proId,jdbcType=BIGINT}, #{batchId,jdbcType=BIGINT} |
| | | , #{processId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER} |
| | | , #{status,jdbcType=TINYINT}, #{creator,jdbcType=VARCHAR} |
| | | , #{dt,jdbcType=TIMESTAMP}, #{startDate,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR} |
| | |
| | | insert into pr_assembly_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="orderId != null">order_id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="batchId != null">batch_id,</if> |
| | | <if test="processId != null">process_id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="number != null">number,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="creator != null">creator,</if> |
| | | <if test="creator != null and creator !=''">creator,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="startDate != null">start_date,</if> |
| | | <if test="endDate != null">end_date,</if> |
| | | <if test="startDate != null and startDate !=''">start_date,</if> |
| | | <if test="endDate != null and endDate !=''">end_date,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="content != null">content,</if> |
| | | <if test="inputNumber != null">input_number,</if> |
| | | <if test="outputNumber != null">output_number,</if> |
| | | <if test="content != null and content !=''">content,</if> |
| | | <if test="inputNumber!= null">input_number,</if> |
| | | <if test="outputNumber!= null">output_number,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="batchId != null">#{batchId,jdbcType=BIGINT},</if> |
| | | <if test="processId != null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="number != null">#{number,jdbcType=INTEGER},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="creator != null">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="creator != null and creator !=''">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="startDate != null">#{startDate,jdbcType=VARCHAR},</if> |
| | | <if test="endDate != null">#{endDate,jdbcType=VARCHAR},</if> |
| | | <if test="startDate != null and startDate !=''">#{startDate,jdbcType=VARCHAR},</if> |
| | | <if test="endDate != null and endDate !=''">#{endDate,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="inputNumber != null">#{inputNumber,jdbcType=INTEGER},</if> |
| | | <if test="outputNumber != null">#{outputNumber,jdbcType=INTEGER},</if> |
| | | <if test="content != null and content !=''">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="inputNumber!= null">#{inputNumber,jdbcType=INTEGER},</if> |
| | | <if test="outputNumber!= null">#{outputNumber,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | update pr_assembly_plan |
| | | <set> |
| | | <if test="orderId != null"> |
| | | order_id = #{orderId,jdbcType=BIGINT} , |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="number != null"> |
| | |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="startDate != null"> |
| | | <if test="startDate != null and startDate !=''"> |
| | | start_date = #{startDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="endDate != null"> |
| | | <if test="endDate != null and endDate !=''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="inputNumber != null"> |
| | | <if test="inputNumber!= null"> |
| | | input_number = #{inputNumber,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="outputNumber != null"> |
| | | <if test="outputNumber!= null"> |
| | | output_number = #{outputNumber,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | update pr_assembly_plan |
| | | set pro_id = #{proId,jdbcType=BIGINT}, |
| | | set order_id = #{orderId,jdbcType=BIGINT}, |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | batch_id = #{batchId,jdbcType=BIGINT}, |
| | | process_id = #{processId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | |
| | | </update> |
| | | |
| | | <select id="selectSome" resultMap="BaseResultMap"> |
| | | <!-- 䏿®µæ¶é´å¼å§çä»»å¡ --> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from pr_assembly_plan |
| | |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="startDate != null and startDate != '' "> |
| | | start_date = #{startDate,jdbcType=VARCHAR} and |
| | | start_date <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR} and |
| | | start_date <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="startDate != null and startDate != '' "> |
| | | start_date = #{startDate,jdbcType=VARCHAR} and |
| | | start_date <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR} and |
| | | start_date <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | |
| | | set deleted = 1 |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <select id="countByPlanIdAndNodeId" resultType="java.lang.Long"> |
| | | select count(1) from pr_assembly_plan ap |
| | | left join pr_production_node pn on ap.process_id = pn.process_id |
| | | where ap.id = #{planId} and pn.id= #{nodeId} |
| | | </select> |
| | | |
| | | <select id="selectByPlanName" resultType="cn.hutool.json.JSONObject"> |
| | | select ap.id planId,ap.name planName,ap.`status`,pn.id nodeId,pn.content from pr_assembly_plan ap |
| | | left join pr_production_node pn on ap.process_id = pn.process_id |
| | | where status != -1 |
| | | <if test="planName != null and planName!= ''"> |
| | | and ap.name like concat('%', #{planName}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryPlanList" resultType="cn.hutool.json.JSONObject"> |
| | | select pp.`name` as pro_name, p.`name` ,p.number, p.output_number, concat(round(((p.output_number/p.number) * 100 ),0), '%') as complete_rate ,p.end_date, |
| | | TIMESTAMPDIFF(DAY, NOW(),p.end_date) AS days_difference |
| | | from (SELECT * FROM pr_assembly_plan WHERE STATUS = 1 and deleted = 0) p |
| | | LEFT JOIN plt_product pp |
| | | on p.pro_id = pp.id |
| | | ORDER BY end_date |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | insert into pr_batch_number |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="batchNumber != null">batch_number,</if> |
| | | <if test="batchNumber!= null">batch_number,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="creator != null">creator,</if> |
| | | <if test="creator != null and creator !=''">creator,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="batchNumber != null">#{batchNumber,jdbcType=INTEGER},</if> |
| | | <if test="batchNumber!= null">#{batchNumber,jdbcType=INTEGER},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="creator != null">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="creator != null and creator !=''">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrBatchNumber"> |
| | | update pr_batch_number |
| | | <set> |
| | | <if test="batchNumber != null"> |
| | | <if test="batchNumber!= null"> |
| | | batch_number = #{batchNumber,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <if test="id != null"> |
| | | id = #{id,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="batchNumber != null"> |
| | | <if test="batchNumber!= null"> |
| | | batch_number = #{batchNumber,jdbcType=INTEGER} and |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | id = #{id,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="batchNumber != null"> |
| | | <if test="batchNumber!= null and batchNumber !=''"> |
| | | batch_number = #{batchNumber,jdbcType=INTEGER} and |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP} and |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| New file |
| | |
| | | <?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.dy.pmsGlobal.daoPr.PrBillOfMaterialMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrBillOfMaterial"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table pr_bill_of_material--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="node_id" jdbcType="BIGINT" property="nodeId" /> |
| | | <result column="file_id" jdbcType="BIGINT" property="fileId" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, node_id, file_id |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_bill_of_material |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByNodeId" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_bill_of_material |
| | | where node_id = #{nodeId,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_bill_of_material |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insertMany" parameterType="java.util.List"> |
| | | insert into pr_bill_of_material |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | id,node_id,file_id |
| | | </trim> |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id,jdbcType=BIGINT}, |
| | | #{item.nodeId,jdbcType=BIGINT}, |
| | | #{item.fileId,jdbcType=BIGINT} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrBillOfMaterial" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_bill_of_material (node_id, file_id) |
| | | values (#{nodeId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrBillOfMaterial" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_bill_of_material |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null"> |
| | | node_id, |
| | | </if> |
| | | <if test="fileId != null"> |
| | | file_id, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null"> |
| | | #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="fileId != null"> |
| | | #{fileId,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrBillOfMaterial"> |
| | | <!--@mbg.generated--> |
| | | update pr_bill_of_material |
| | | <set> |
| | | <if test="nodeId != null"> |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="fileId != null"> |
| | | file_id = #{fileId,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrBillOfMaterial"> |
| | | <!--@mbg.generated--> |
| | | update pr_bill_of_material |
| | | set node_id = #{nodeId,jdbcType=BIGINT}, |
| | | file_id = #{fileId,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | insert into pr_dev_ops_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="creator != null">creator,</if> |
| | | <if test="creator != null and creator !=''">creator,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="startDate != null">start_date,</if> |
| | | <if test="endDate != null">end_date,</if> |
| | | <if test="startDate != null and startDate !=''">start_date,</if> |
| | | <if test="endDate != null and endDate !=''">end_date,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="content != null">content,</if> |
| | | <if test="content != null and content !=''">content,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="creator != null">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="creator != null and creator !=''">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="startDate != null">#{startDate,jdbcType=VARCHAR},</if> |
| | | <if test="endDate != null">#{endDate,jdbcType=VARCHAR},</if> |
| | | <if test="startDate != null and startDate !=''">#{startDate,jdbcType=VARCHAR},</if> |
| | | <if test="endDate != null and endDate !=''">#{endDate,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="content != null and content !=''">#{content,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrDevOpsPlan"> |
| | | update pr_dev_ops_plan |
| | | <set> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="startDate != null"> |
| | | <if test="startDate != null and startDate !=''"> |
| | | start_date = #{startDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="endDate != null"> |
| | | <if test="endDate != null and endDate !=''"> |
| | | end_date = #{endDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from pr_dev_ops_plan |
| | | <trim prefix="where" suffixOverrides="and"> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | select count(1) |
| | | from pr_dev_ops_plan |
| | | <trim prefix="where" suffixOverrides="and"> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="batchId != null">batch_id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="status != null">status,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="batchId != null">#{batchId,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo}, |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="batchId != null"> |
| | | batch_id = #{batchId,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=BIGINT} and |
| | | </if> |
| | | <if test="status != null"> |
| New file |
| | |
| | | <?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.dy.pmsGlobal.daoPr.PrOrderItemMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="orderId" column="order_id" jdbcType="BIGINT"/> |
| | | <result property="proId" column="pro_id" jdbcType="BIGINT"/> |
| | | <result property="number" column="number" jdbcType="INTEGER"/> |
| | | <result property="completeNumber" column="complete_number" jdbcType="INTEGER"/> |
| | | <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" /> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,order_id,pro_id,number, |
| | | complete_number, deleted |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order_item |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectItems" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--ç®åºå®æç Base_Column_List--> |
| | | SELECT aa.*, concat(round(((complete_number/number) * 100 ),2), '%') as complete_rate from ( |
| | | select oi.id,oi.order_id,oi.pro_id,pp.`name`,oi.number, sum(IFNULL(pap.output_number,0)) as complete_number |
| | | from (SELECT * from pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi |
| | | LEFT JOIN pr_assembly_plan pap |
| | | ON oi.order_id = pap.order_id AND oi.pro_id = pap.pro_id |
| | | LEFT JOIN plt_product pp |
| | | ON oi.pro_id = pp.id |
| | | GROUP BY oi.id,oi.order_id,oi.pro_id,oi.number) aa |
| | | </select> |
| | | <select id="selectDistinctPro" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--Distinctåºorder_idä¸ç产å Base_Column_List--> |
| | | select DISTINCT(oi.order_id),oi.pro_id,pp.`name` |
| | | from (SELECT * from pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi |
| | | LEFT JOIN plt_product pp |
| | | ON oi.pro_id = pp.id |
| | | GROUP BY oi.order_id,oi.pro_id |
| | | ORDER BY oi.order_id |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_order_item |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_order_item ( id,order_id,pro_id,number, |
| | | complete_number, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{orderId,jdbcType=BIGINT}, #{proId,jdbcType=BIGINT}, #{number,jdbcType=INTEGER}, |
| | | #{completeNumber,jdbcType=INTEGER}, #{deleted,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem" useGeneratedKeys="true"> |
| | | insert into pr_order_item |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="orderId != null">order_id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="number != null">number,</if> |
| | | <if test="completeNumber != null">complete_number,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="number != null">#{number,jdbcType=INTEGER},</if> |
| | | <if test="completeNumber != null">#{completeNumber,jdbcType=INTEGER},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <!--@mbg.generated--> |
| | | update pr_order_item |
| | | <set> |
| | | <if test="orderId != null"> |
| | | order_id = #{orderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="number != null"> |
| | | number = #{number,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="completeNumber != null"> |
| | | complete_number = #{completeNumber,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteLogicById"> |
| | | update pr_order_item set deleted = 1 where id = #{id} |
| | | </delete> |
| | | <select id="selectSome" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order_item p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="orderId != null"> |
| | | p.order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start}, #{count} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectSomeCount" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from pr_order_item p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="orderId != null"> |
| | | p.order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | <?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.dy.pmsGlobal.daoPr.PrOrderMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrOrder"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="customerName" column="customer_name" jdbcType="VARCHAR"/> |
| | | <result property="projectName" column="project_name" jdbcType="VARCHAR"/> |
| | | <result property="director" column="director" jdbcType="VARCHAR"/> |
| | | <result property="dMobile" column="d_mobile" jdbcType="VARCHAR"/> |
| | | <result property="deliveryDate" column="delivery_date" jdbcType="VARCHAR"/> |
| | | <result property="deliveryAddress" column="delivery_address" jdbcType="VARCHAR"/> |
| | | <result property="recipient" column="recipient" jdbcType="VARCHAR"/> |
| | | <result property="rMobile" column="r_mobile" jdbcType="VARCHAR"/> |
| | | <result property="status" column="status" jdbcType="TINYINT"/> |
| | | <result property="creator" column="creator" jdbcType="VARCHAR"/> |
| | | <result property="dt" column="dt" jdbcType="TIMESTAMP"/> |
| | | <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" /> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <resultMap id="BaseResultMap2" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap"> |
| | | <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="com.dy.pmsGlobal.daoPr.PrOrderItemMapper.selectItems" column="id" /> |
| | | </resultMap> |
| | | <resultMap id="BaseResultMap3" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap"> |
| | | <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="com.dy.pmsGlobal.daoPr.PrOrderItemMapper.selectDistinctPro" column="id" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id,`name`,customer_name,project_name, |
| | | director,d_mobile,delivery_date,delivery_address,recipient,r_mobile, |
| | | status,creator,dt, |
| | | deleted,remark |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap2"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectOrderNameById" parameterType="java.lang.Long" resultType="String"> |
| | | select name from pr_order where id=#{orderId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="exists" resultType="java.lang.Boolean"> |
| | | select count(1) from pr_order where name = #{name} |
| | | <if test="id != null"> |
| | | and id != #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSome" resultMap="BaseResultMap2"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | project_name like concat('%', #{projectName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startDate != null and startDate != ''"> |
| | | delivery_date <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | delivery_date <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT} and |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start}, #{count} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectSomeCount" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | project_name like concat('%', #{projectName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startDate != null and startDate != ''"> |
| | | delivery_date <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | delivery_date <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT} and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--䏿èå订å--> |
| | | <select id="selectAll" resultType="com.dy.pmsGlobal.pojoPr.PrOrder"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | project_name like concat('%', #{projectName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startDate != null and startDate != ''"> |
| | | delivery_date <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | delivery_date <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT} and |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_order |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <update id="deleteLogicById" parameterType="java.lang.Long"> |
| | | update pr_order set deleted = 1 |
| | | where id = #{id} |
| | | </update> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrder" useGeneratedKeys="true"> |
| | | insert into pr_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="customerName!= null and customerName !=''">customer_name,</if> |
| | | <if test="projectName!= null and projectName !=''">project_name,</if> |
| | | <if test="director != null and director !=''">director,</if> |
| | | <if test="dMobile != null and dMobile !=''">d_mobile,</if> |
| | | <if test="deliveryDate!= null and deliveryDate !=''">delivery_date,</if> |
| | | <if test="deliveryAddress!= null and deliveryAddress !=''">delivery_date,</if> |
| | | <if test="recipient!= null and recipient !=''">recipient,</if> |
| | | <if test="rMobile!= null and rMobile !=''">r_mobile,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="creator != null and creator !=''">creator,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="customerName!= null and customerName !=''">#{customerName,jdbcType=VARCHAR},</if> |
| | | <if test="projectName!= null and projectName !=''">#{projectName,jdbcType=VARCHAR},</if> |
| | | <if test="director != null and director !=''">#{director,jdbcType=VARCHAR},</if> |
| | | <if test="dMobile != null and dMobile !=''">#{dMobile,jdbcType=VARCHAR},</if> |
| | | <if test="deliveryDate!= null and deliveryDate !=''">#{deliveryDate,jdbcType=VARCHAR},</if> |
| | | <if test="deliveryAddress!= null and deliveryAddress !=''">#{deliveryAddress,jdbcType=VARCHAR},</if> |
| | | <if test="recipient!= null and recipient !=''">#{recipient,jdbcType=VARCHAR},</if> |
| | | <if test="rMobile!= null and rMobile !=''">#{rMobile,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="creator != null and creator !=''">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrder"> |
| | | update pr_order |
| | | <set> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="customerName!= null and customerName !=''"> |
| | | customer_name = #{customerName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="projectName!= null and projectName !=''"> |
| | | project_name = #{projectName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="director != null and director !=''"> |
| | | director = #{director,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deliveryDate!= null and deliveryDate !=''"> |
| | | delivery_date = #{deliveryDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deliveryAddress!= null and deliveryAddress !=''"> |
| | | delivery_date = #{deliveryAddress,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="recipient!= null and recipient !=''"> |
| | | recipient = #{recipient,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="rMobile!= null and rMobile !=''"> |
| | | r_mobile = #{rMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <association property="instruction" |
| | | column="id" javaType="java.lang.Long" select="com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper.selectByNodeId" fetchType="eager" /> |
| | | <association property="bill" |
| | | column="id" javaType="java.lang.Long" select="com.dy.pmsGlobal.daoPr.PrBillOfMaterialMapper.selectByNodeId" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from pr_production_node |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectNodeBySort" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_production_node |
| | | where process_id = #{processId,jdbcType=BIGINT} and sort = #{sort,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectNameByNodeId" parameterType="java.lang.Long" resultType="String"> |
| | | select content from pr_production_node where id = #{id} |
| | |
| | | insert into pr_production_node |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="processId != null">process_id,</if> |
| | | <if test="processId!= null">process_id,</if> |
| | | <if test="sort != null">sort,</if> |
| | | <if test="content != null">content,</if> |
| | | <if test="content != null and content !=''">content,</if> |
| | | <if test="nodeType != null">node_type,</if> |
| | | <if test="isStart != null">is_start,</if> |
| | | <if test="isEnd != null">is_end,</if> |
| | | <if test="isRecord != null">is_record,</if> |
| | | <if test="deviceCycleContent != null">device_cycle_content,</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="processId != null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="isEnd != null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="sort != null">#{sort,jdbcType=INTEGER},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="content != null and content !=''">#{content,jdbcType=VARCHAR},</if> |
| | | <if test="nodeType != null">#{nodeType,jdbcType=INTEGER},</if> |
| | | <if test="isStart != null">#{isStart,jdbcType=TINYINT},</if> |
| | | <if test="isEnd != null">#{isEnd,jdbcType=TINYINT},</if> |
| | | <if test="isRecord != null">#{isRecord,jdbcType=TINYINT},</if> |
| | | <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="sort != null"> |
| | | sort = #{sort,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="content != null"> |
| | | <if test="content != null and content !=''"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="nodeType != null"> |
| | |
| | | <if test="isRecord != null"> |
| | | is_record = #{isRecord,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deviceCycleContent != null"> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''"> |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from pr_production_node |
| | | <trim prefix="where" suffixOverrides="and"> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <association property="proName" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" /> |
| | | <association property="proType" column="pro_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProTypeById" fetchType="eager" /> |
| | | <association property="creatorName" column="creator" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager" /> |
| | | <association property="isQuote" column="id" javaType="java.lang.Boolean" fetchType="eager" |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="creator != null">creator,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="creator != null and creator !=''">creator,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="creator != null">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="creator != null and creator !=''">#{creator,jdbcType=VARCHAR},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrProductionProcess"> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="name != null and name !=''"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="creator != null"> |
| | | <if test="creator != null and creator !=''"> |
| | | creator = #{creator,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | <if test="remark != null and remark !=''"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <!-- <if test="name != null">--> |
| | | <!-- <if test="name != null and name !=''">--> |
| | | <!-- name = #{name,jdbcType=VARCHAR} and--> |
| | | <!-- </if>--> |
| | | </trim> |
| | |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT} and |
| | | </if> |
| | | <!-- <if test="name != null">--> |
| | | <!-- <if test="name != null and name !=''">--> |
| | | <!-- name = #{name,jdbcType=VARCHAR} and--> |
| | | <!-- </if>--> |
| | | </trim> |
| New file |
| | |
| | | <?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.dy.pmsGlobal.daoPr.PrScheduleMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrSchedule"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table pr_schedule--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="user_id" jdbcType="BIGINT" property="userId" /> |
| | | <result column="schedule_date" jdbcType="VARCHAR" property="scheduleDate" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <association property="userName" column="user_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager"/> |
| | | <collection column="id" ofType="com.dy.pmsGlobal.pojoPr.PrScheduleRel" property="relList" |
| | | select="com.dy.pmsGlobal.daoPr.PrScheduleRelMapper.selectByScheduleId" fetchType="eager" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, user_id, schedule_date, deleted,dt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_schedule (id, user_id, schedule_date, |
| | | deleted,dt) |
| | | values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{scheduleDate,jdbcType=VARCHAR}, |
| | | #{deleted,jdbcType=TINYINT},now()) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pmsGlobal.pojoPr.PrSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_schedule |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="userId != null"> |
| | | user_id, |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | schedule_date, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="userId != null"> |
| | | #{userId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | #{scheduleDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="dt != null and dt !=''"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrSchedule"> |
| | | <!--@mbg.generated--> |
| | | update pr_schedule |
| | | <set> |
| | | <if test="userId != null"> |
| | | user_id = #{userId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | schedule_date = #{scheduleDate,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrSchedule"> |
| | | <!--@mbg.generated--> |
| | | update pr_schedule |
| | | set user_id = #{userId,jdbcType=BIGINT}, |
| | | schedule_date = #{scheduleDate,jdbcType=VARCHAR}, |
| | | deleted = #{deleted,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="selectSomeCount" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from pr_schedule |
| | | where deleted = 0 |
| | | <if test="userId != null"> |
| | | and user_id = #{userId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | and schedule_date = #{scheduleDate,jdbcType=VARCHAR} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSome" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_schedule |
| | | where deleted = 0 |
| | | <if test="userId != null"> |
| | | and user_id = #{userId} |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | and schedule_date = #{scheduleDate} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectAll" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_schedule |
| | | where deleted = 0 |
| | | <if test="userId != null"> |
| | | and user_id = #{userId} |
| | | </if> |
| | | <if test="scheduleDate != null and scheduleDate !=''"> |
| | | and schedule_date = #{scheduleDate} |
| | | </if> |
| | | order by schedule_date desc |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | <?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.dy.pmsGlobal.daoPr.PrScheduleRelMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrScheduleRel"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table pr_schedule_rel--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="schedule_id" jdbcType="BIGINT" property="scheduleId" /> |
| | | <result column="plan_id" jdbcType="BIGINT" property="planId" /> |
| | | <result column="node_id" jdbcType="BIGINT" property="nodeId" /> |
| | | <result column="station_id" jdbcType="BIGINT" property="stationId" /> |
| | | <result column="work_details" jdbcType="VARCHAR" property="workDetails" /> |
| | | <association property="nodeName" column="node_id" javaType="java.lang.String" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionNodeMapper.selectNameByNodeId" fetchType="eager"/> |
| | | <association property="planName" column="plan_id" javaType="java.lang.String" |
| | | select="com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper.selectNameByPlanId" fetchType="eager"/> |
| | | <association property="stationName" column="station_id" javaType="java.lang.String" |
| | | select="com.dy.pmsGlobal.daoPlt.PltStationMapper.selectNameByStationId" fetchType="eager"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, schedule_id, plan_id, node_id, station_id, work_details |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_schedule_rel |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from pr_schedule_rel |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_schedule_rel (id, schedule_id, plan_id, |
| | | node_id, station_id, work_details |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{scheduleId,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, |
| | | #{nodeId,jdbcType=BIGINT}, #{stationId,jdbcType=BIGINT}, #{workDetails,jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_schedule_rel |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="scheduleId!= null and scheduleId !=''"> |
| | | schedule_id, |
| | | </if> |
| | | <if test="planId != null"> |
| | | plan_id, |
| | | </if> |
| | | <if test="nodeId!= null"> |
| | | node_id, |
| | | </if> |
| | | <if test="stationId != null"> |
| | | station_id, |
| | | </if> |
| | | <if test="workDetails!= null and workDetails !=''"> |
| | | work_details, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="scheduleId!= null and scheduleId !=''"> |
| | | #{scheduleId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="planId != null"> |
| | | #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeId!= null"> |
| | | #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="stationId != null"> |
| | | #{stationId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="workDetails!= null and workDetails !=''"> |
| | | #{workDetails,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel"> |
| | | <!--@mbg.generated--> |
| | | update pr_schedule_rel |
| | | <set> |
| | | <if test="scheduleId!= null and scheduleId !=''"> |
| | | schedule_id = #{scheduleId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="planId != null"> |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeId!= null"> |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="stationId != null"> |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="workDetails!= null and workDetails !=''"> |
| | | work_details = #{workDetails,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel"> |
| | | <!--@mbg.generated--> |
| | | update pr_schedule_rel |
| | | set schedule_id = #{scheduleId,jdbcType=BIGINT}, |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | | work_details = #{workDetails,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteByScheduleId"> |
| | | delete from pr_schedule_rel where schedule_id=#{scheduleId} |
| | | </delete> |
| | | |
| | | <select id="selectByScheduleId" resultMap="BaseResultMap"> |
| | | select * from pr_schedule_rel where schedule_id=#{scheduleId} |
| | | </select> |
| | | </mapper> |
| | |
| | | insert into pr_working_instruction |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="nodeId != null">node_id,</if> |
| | | <if test="nodeId!= null">node_id,</if> |
| | | <if test="fileId != null">file_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="nodeId != null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="nodeId!= null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="fileId != null">#{fileId,jdbcType=BIGINT},</if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrWorkingInstruction"> |
| | | update pr_working_instruction |
| | | <set> |
| | | <if test="nodeId != null"> |
| | | <if test="nodeId!= null"> |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="fileId != null"> |
| | |
| | | <if test="lineId != null">line_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="processId != null">process_id,</if> |
| | | <if test="nodeId != null">node_id,</if> |
| | | <if test="processId!= null">process_id,</if> |
| | | <if test="nodeId!= null">node_id,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="startTime != null">start_time,</if> |
| | | <if test="endTime != null">end_time,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | |
| | | <if test="lineId != null">#{lineId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="processId != null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="nodeId != null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="processId!= null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="nodeId!= null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkHistory"> |
| | |
| | | <if test="planId != null"> |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeId != null"> |
| | | <if test="nodeId!= null"> |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <if test="endTime != null"> |
| | | end_time = #{endTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <!-- <include refid="Base_Column_List"/>--> |
| | | <!-- from plt_station where status =1--> |
| | | <!-- <trim prefix="and" suffixOverrides="and">--> |
| | | <!-- <if test="id != null and id !=''">--> |
| | | <!-- <if test="id != null">--> |
| | | <!-- id = #{id,jdbcType=BIGINT} and--> |
| | | <!-- </if>--> |
| | | <!-- <if test="code != null and code !=''">--> |
| | |
| | | <!-- <if test="name != null and name !=''">--> |
| | | <!-- name like concat('%', #{name}, '%') and--> |
| | | <!-- </if>--> |
| | | <!-- <if test="disabled != null and disabled !=''">--> |
| | | <!-- <if test="disabled != null">--> |
| | | <!-- disabled = #{disabled,jdbcType=TINYINT} and--> |
| | | <!-- </if>--> |
| | | <!-- <if test="lineId != null and lineId !=''">--> |
| | | <!-- <if test="lineId != null">--> |
| | | <!-- line_id = #{lineId,jdbcType=BIGINT} and--> |
| | | <!-- </if>--> |
| | | <!-- </trim>--> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from sta_assembly_work_last |
| | | <where> |
| | | <if test="userId != null and userId !=''"> |
| | | <if test="userId != null"> |
| | | and user_id = #{userId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="lineId != null and lineId !=''"> |
| | | <if test="lineId != null"> |
| | | and line_id = #{lineId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="stationId != null and stationId !=''"> |
| | | <if test="stationId != null"> |
| | | and station_id = #{stationId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="planId != null and planId !=''"> |
| | | <if test="planId != null"> |
| | | and plan_id = #{planId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="processId != null and processId !=''"> |
| | | <if test="processId != null"> |
| | | and process_id = #{processId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="nodeId != null and nodeId !=''"> |
| | | <if test="nodeId != null"> |
| | | and node_id = #{nodeId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="status != null and status !=''"> |
| | | <if test="status != null"> |
| | | and status = #{status,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="startTime != null and startTime !=''"> |
| | | <if test="startTime != null"> |
| | | and start_time = #{startTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endTime != null and endTime !=''"> |
| | | <if test="endTime != null"> |
| | | and end_time = #{endTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="assistants != null and assistants !=''"> |
| | |
| | | <if test="endTime != null"> |
| | | and l.start_time <![CDATA[ < ]]> #{endTime} |
| | | </if> |
| | | <if test="userId != null and userId !=''"> |
| | | <if test="userId != null"> |
| | | and l.user_id = #{userId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="lineId != null and lineId !=''"> |
| | | <if test="lineId != null"> |
| | | and l.line_id = #{lineId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="stationId != null and stationId !=''"> |
| | | <if test="stationId != null"> |
| | | and l.station_id = #{stationId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="planId != null and planId !=''"> |
| | | <if test="planId != null"> |
| | | and l.plan_id = #{planId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="processId != null and processId !=''"> |
| | | <if test="processId != null"> |
| | | and l.process_id = #{processId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="nodeId != null and nodeId !=''"> |
| | | <if test="nodeId != null"> |
| | | and l.node_id = #{nodeId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="status != null and status !=''"> |
| | | <if test="status != null"> |
| | | and l.status = #{status,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="assistants != null and assistants !=''"> |
| | |
| | | <if test="endTime != null"> |
| | | and l.start_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="userId != null and userId !=''"> |
| | | <if test="userId != null"> |
| | | and l.user_id = #{userId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="lineId != null and lineId !=''"> |
| | | <if test="lineId != null"> |
| | | and l.line_id = #{lineId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="stationId != null and stationId !=''"> |
| | | <if test="stationId != null"> |
| | | and l.station_id = #{stationId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="planId != null and planId !=''"> |
| | | <if test="planId != null"> |
| | | and l.plan_id = #{planId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="processId != null and processId !=''"> |
| | | <if test="processId != null"> |
| | | and l.process_id = #{processId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="nodeId != null and nodeId !=''"> |
| | | <if test="nodeId != null"> |
| | | and l.node_id = #{nodeId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="status != null and status !=''"> |
| | | <if test="status != null"> |
| | | and l.status = #{status,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="assistants != null and assistants !=''"> |
| | |
| | | <if test="lineId != null">line_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="processId != null">process_id,</if> |
| | | <if test="nodeId != null">node_id,</if> |
| | | <if test="workType != null">work_Type,</if> |
| | | <if test="processId!= null">process_id,</if> |
| | | <if test="nodeId!= null">node_id,</if> |
| | | <if test="workType!= null">work_Type,</if> |
| | | <if test="dt != null">dt,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="startTime != null">start_time,</if> |
| | | <if test="endTime != null">end_time,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | |
| | | <if test="lineId != null">#{lineId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="processId != null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="nodeId != null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="workType != null">#{workType,jdbcType=TINYINT},</if> |
| | | <if test="processId!= null">#{processId,jdbcType=BIGINT},</if> |
| | | <if test="nodeId!= null">#{nodeId,jdbcType=BIGINT},</if> |
| | | <if test="workType!= null">#{workType,jdbcType=TINYINT},</if> |
| | | <if test="dt != null">#{dt,jdbcType=TIMESTAMP},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast"> |
| | |
| | | <if test="planId != null"> |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="processId != null"> |
| | | <if test="processId!= null"> |
| | | process_id = #{processId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeId != null"> |
| | | <if test="nodeId!= null"> |
| | | node_id = #{nodeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="workType != null"> |
| | | <if test="workType!= null"> |
| | | work_type = #{workType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="dt != null"> |
| | |
| | | <if test="endTime != null"> |
| | | end_time = #{endTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <result property="stationId" column="station_id" jdbcType="BIGINT"/> |
| | | <result property="currNode" column="curr_node" jdbcType="BIGINT"/> |
| | | <result property="nodeContent" column="node_content" jdbcType="VARCHAR"/> |
| | | <result property="nextNode" column="next_node" jdbcType="BIGINT"/> |
| | | <result property="nextNodeContent" column="next_node_content" jdbcType="VARCHAR"/> |
| | | <result property="deviceCycleContent" column="device_cycle_content" jdbcType="VARCHAR"/> |
| | | <result property="status" column="status" jdbcType="TINYINT"/> |
| | | <result property="result" column="result" jdbcType="TINYINT"/> |
| | |
| | | insert into sta_device_last |
| | | ( id,device_no,work_id |
| | | ,repair_id,plan_id,station_id |
| | | ,curr_node,node_content,device_cycle_content |
| | | ,curr_node,node_content,next_node,next_node_content,device_cycle_content |
| | | ,status,result |
| | | ,error_msg,assistants |
| | | ,updated_by,in_time,out_time |
| | | ,memo) |
| | | values (#{id,jdbcType=BIGINT},#{deviceNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT} |
| | | ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT} |
| | | ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{deviceCycleContent,jdbcType=VARCHAR} |
| | | ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{nextNode,jdbcType=BIGINT},#{nextNodeContent,jdbcType=VARCHAR} |
| | | ,#{deviceCycleContent,jdbcType=VARCHAR} |
| | | ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT} |
| | | ,#{errorMsg,jdbcType=VARCHAR},#{assistants,jdbcType=VARCHAR} |
| | | ,#{updatedBy,jdbcType=BIGINT},#{inTime,jdbcType=TIMESTAMP},#{outTime,jdbcType=TIMESTAMP} |
| | |
| | | insert into sta_device_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="currNode != null">curr_node,</if> |
| | | <if test="nodeContent != null">node_content,</if> |
| | | <if test="deviceCycleContent != null">device_cycle_content,</if> |
| | | <if test="nodeContent != null and nodeContent !=''">node_content,</if> |
| | | <if test="nextNode != null">next_node,</if> |
| | | <if test="nextNodeContent != null and nextNodeContent !=''">next_node_content,</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="result != null">result,</if> |
| | | <if test="errorMsg != null">error_msg,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="errorMsg != null and errorMsg !=''">error_msg,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | <if test="updatedBy != null">updated_by,</if> |
| | | <if test="inTime != null">in_time,</if> |
| | | <if test="outTime != null">out_time,</if> |
| | | <if test="inLineTime != null">in_line_time,</if> |
| | | <if test="outLineTime != null">out_line_time,</if> |
| | | <if test="memo != null">memo,</if> |
| | | <if test="memo != null and memo !=''">memo,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if> |
| | | <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="nodeContent != null and nodeContent !=''">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="nextNode != null">#{nextNode,jdbcType=BIGINT},</if> |
| | | <if test="nextNodeContent != null and nextNodeContent !=''">#{nextNodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="result != null">#{result,jdbcType=TINYINT},</if> |
| | | <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="errorMsg != null and errorMsg !=''">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if> |
| | | <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inLineTime != null">#{inLineTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="outLineTime != null">#{outLineTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="memo != null">#{memo,jdbcType=VARCHAR},</if> |
| | | <if test="memo != null and memo !=''">#{memo,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLast"> |
| | | update sta_device_last |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | |
| | | <if test="currNode != null"> |
| | | curr_node = #{currNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeContent != null"> |
| | | <if test="nodeContent != null and nodeContent !=''"> |
| | | node_content = #{nodeContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceCycleContent != null"> |
| | | <if test="nextNode != null"> |
| | | next_node = #{nextNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nextNodeContent != null and nextNodeContent !=''"> |
| | | next_node_content = #{nextNodeContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''"> |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="result != null"> |
| | | result = #{result,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="errorMsg != null"> |
| | | <if test="errorMsg != null and errorMsg !=''"> |
| | | error_msg = #{errorMsg,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="updatedBy != null"> |
| | |
| | | <if test="outLineTime != null"> |
| | | out_line_time = #{outLineTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="memo != null"> |
| | | <if test="memo != null and memo !=''"> |
| | | memo = #{memo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | | curr_node = #{currNode,jdbcType=BIGINT}, |
| | | node_content = #{nodeContent,jdbcType=VARCHAR}, |
| | | next_node = #{nextNode,jdbcType=BIGINT}, |
| | | next_node_content = #{nextNodeContent,jdbcType=VARCHAR}, |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | status = #{status,jdbcType=TINYINT}, |
| | | result = #{result,jdbcType=TINYINT}, |
| | |
| | | insert into sta_device_life_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="currNode != null">curr_node,</if> |
| | | <if test="nodeContent != null">node_content,</if> |
| | | <if test="deviceCycleContent != null">device_cycle_content,</if> |
| | | <if test="nodeContent != null and nodeContent !=''">node_content,</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="errorMsg != null">error_msg,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="errorMsg != null and errorMsg !=''">error_msg,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | <if test="inTime != null">in_time,</if> |
| | | <if test="outTime != null">out_time,</if> |
| | | <if test="updatedBy != null">updated_by,</if> |
| | | <if test="memo != null">memo,</if> |
| | | <if test="memo != null and memo !=''">memo,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if> |
| | | <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="nodeContent != null and nodeContent !=''">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="errorMsg != null and errorMsg !=''">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if> |
| | | <if test="memo != null">#{memo,jdbcType=VARCHAR},</if> |
| | | <if test="memo != null and memo !=''">#{memo,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast"> |
| | | update sta_device_life_last |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | |
| | | <if test="currNode != null"> |
| | | curr_node = #{currNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeContent != null"> |
| | | <if test="nodeContent != null and nodeContent !=''"> |
| | | node_content = #{nodeContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceCycleContent != null"> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''"> |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | | status = #{status,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="errorMsg != null"> |
| | | <if test="errorMsg != null and errorMsg !=''"> |
| | | error_msg = #{errorMsg,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="inTime != null"> |
| | |
| | | <if test="updatedBy != null"> |
| | | updated_by = #{updatedBy,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="memo != null"> |
| | | <if test="memo != null and memo !=''"> |
| | | memo = #{memo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | insert into sta_device_life |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="currNode != null">curr_node,</if> |
| | | <if test="nodeContent != null">node_content,</if> |
| | | <if test="deviceCycleContent != null">device_cycle_content,</if> |
| | | <if test="nodeContent != null and nodeContent !=''">node_content,</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="result != null">result,</if> |
| | | <if test="errorMsg != null">error_msg,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="errorMsg != null and errorMsg !=''">error_msg,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | <if test="inTime != null">in_time,</if> |
| | | <if test="outTime != null">out_time,</if> |
| | | <if test="updatedBy != null">updated_by,</if> |
| | | <if test="memo != null">memo,</if> |
| | | <if test="memo != null and memo !=''">memo,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if> |
| | | <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="nodeContent != null and nodeContent !=''">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="result != null">#{result,jdbcType=TINYINT},</if> |
| | | <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="errorMsg != null and errorMsg !=''">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if> |
| | | <if test="memo != null">#{memo,jdbcType=VARCHAR},</if> |
| | | <if test="memo != null and memo !=''">#{memo,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife"> |
| | | update sta_device_life |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | |
| | | <if test="currNode != null"> |
| | | curr_node = #{currNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeContent != null"> |
| | | <if test="nodeContent != null and nodeContent !=''"> |
| | | node_content = #{nodeContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceCycleContent != null"> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''"> |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="result != null"> |
| | | result = #{result,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="errorMsg != null"> |
| | | <if test="errorMsg != null and errorMsg !=''"> |
| | | error_msg = #{errorMsg,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="inTime != null"> |
| | |
| | | <if test="updatedBy != null"> |
| | | updated_by = #{updatedBy,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="memo != null"> |
| | | <if test="memo != null and memo !=''"> |
| | | memo = #{memo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | insert into sta_device_production_log |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | | <if test="currNode != null">curr_node,</if> |
| | | <if test="nodeContent != null">node_content,</if> |
| | | <if test="deviceCycleContent != null">device_cycle_content,</if> |
| | | <if test="nodeContent != null and nodeContent !=''">node_content,</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="result != null">result,</if> |
| | | <if test="errorMsg != null">error_msg,</if> |
| | | <if test="assistants != null">assistants,</if> |
| | | <if test="errorMsg != null and errorMsg !=''">error_msg,</if> |
| | | <if test="assistants != null and assistants !=''">assistants,</if> |
| | | <if test="inTime != null">in_time,</if> |
| | | <if test="outTime != null">out_time,</if> |
| | | <if test="updatedBy != null">updated_by,</if> |
| | | <if test="memo != null">memo,</if> |
| | | <if test="memo != null and memo !=''">memo,</if> |
| | | <if test="number != null">number,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if> |
| | | <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="nodeContent != null and nodeContent !=''">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="result != null">#{result,jdbcType=TINYINT},</if> |
| | | <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="errorMsg != null and errorMsg !=''">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | <if test="assistants != null and assistants !=''">#{assistants,jdbcType=VARCHAR},</if> |
| | | <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if> |
| | | <if test="memo != null">#{memo,jdbcType=VARCHAR},</if> |
| | | <if test="memo != null and memo !=''">#{memo,jdbcType=VARCHAR},</if> |
| | | <if test="number != null">#{number,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog"> |
| | | update sta_device_production_log |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | |
| | | <if test="currNode != null"> |
| | | curr_node = #{currNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="nodeContent != null"> |
| | | <if test="nodeContent != null and nodeContent !=''"> |
| | | node_content = #{nodeContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceCycleContent != null"> |
| | | <if test="deviceCycleContent != null and deviceCycleContent !=''"> |
| | | device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="status != null"> |
| | |
| | | <if test="result != null"> |
| | | result = #{result,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="errorMsg != null"> |
| | | <if test="errorMsg != null and errorMsg !=''"> |
| | | error_msg = #{errorMsg,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="assistants != null"> |
| | | <if test="assistants != null and assistants !=''"> |
| | | assistants = #{assistants,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="inTime != null"> |
| | |
| | | <if test="updatedBy != null"> |
| | | updated_by = #{updatedBy,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="memo != null"> |
| | | <if test="memo != null and memo !=''"> |
| | | memo = #{memo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="number != null"> |
| | |
| | | <delete id="deleteFromLogTable"> |
| | | DELETE FROM sta_device_production_log WHERE DATE(out_time) != CURDATE(); |
| | | </delete> |
| | | |
| | | <select id="countLastDayLogs" resultType="_long"> |
| | | SELECT COUNT(1) FROM sta_device_production_log WHERE DATE(out_time) != CURDATE(); |
| | | </select> |
| | | </mapper> |
| | |
| | | insert into sta_repair_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="fromNode != null">from_node,</if> |
| | | <if test="repairReason != null">repair_reason,</if> |
| | | <if test="repairReason != null and repairReason !=''">repair_reason,</if> |
| | | <if test="repairBy != null">repair_by,</if> |
| | | <if test="repairTime != null">repair_time,</if> |
| | | <if test="repairTime != null and repairTime !=''">repair_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="fromNode != null">#{fromNode,jdbcType=BIGINT},</if> |
| | | <if test="repairReason != null">#{repairReason,jdbcType=VARCHAR},</if> |
| | | <if test="repairReason != null and repairReason !=''">#{repairReason,jdbcType=VARCHAR},</if> |
| | | <if test="repairBy != null">#{repairBy,jdbcType=BIGINT},</if> |
| | | <if test="repairTime != null">#{repairTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="repairTime != null and repairTime !=''">#{repairTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo"> |
| | | update sta_repair_info |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | |
| | | <if test="fromNode != null"> |
| | | from_node = #{fromNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairReason != null"> |
| | | <if test="repairReason != null and repairReason !=''"> |
| | | repair_reason = #{repairReason,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="repairBy != null"> |
| | | repair_by = #{repairBy,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairTime != null"> |
| | | <if test="repairTime != null and repairTime !=''"> |
| | | repair_time = #{repairTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | |
| | | insert into sta_wip_sn_ex |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="deviceNo != null">device_no,</if> |
| | | <if test="deviceNo != null and deviceNo !=''">device_no,</if> |
| | | <if test="productId != null">product_id,</if> |
| | | <if test="productName != null">product_name,</if> |
| | | <if test="productNo != null">product_no,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="productName != null and productName !=''">product_name,</if> |
| | | <if test="productNo!= null and productNo !=''">product_no,</if> |
| | | <if test="createTime != null and createTime !=''">create_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="deviceNo != null and deviceNo !=''">#{deviceNo,jdbcType=VARCHAR},</if> |
| | | <if test="productId != null">#{productId,jdbcType=BIGINT},</if> |
| | | <if test="productName != null">#{productName,jdbcType=VARCHAR},</if> |
| | | <if test="productNo != null">#{productNo,jdbcType=VARCHAR},</if> |
| | | <if test="productName != null and productName !=''">#{productName,jdbcType=VARCHAR},</if> |
| | | <if test="productNo!= null and productNo !=''">#{productNo,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createBy != null">#{createBy,jdbcType=BIGINT},</if> |
| | | </trim> |
| | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaWipSnEx"> |
| | | update sta_wip_sn_ex |
| | | <set> |
| | | <if test="deviceNo != null"> |
| | | <if test="deviceNo != null and deviceNo !=''"> |
| | | device_no = #{deviceNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="productId != null"> |
| | | product_id = #{productId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="productName != null"> |
| | | <if test="productName != null and productName !=''"> |
| | | product_name = #{productName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="productNo != null"> |
| | | <if test="productNo!= null and productNo !=''"> |
| | | product_no = #{productNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | |
| | | <privilege num="10200003" name="æµç¨ç®¡ç" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200004" name="è¿ç»´è®¡åæ¥è¯¢" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200005" name="è¿ç»´è®¡å管ç" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200006" name="è®¢åæ¥è¯¢" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200007" name="订å管ç" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200008" name="æçæ¥è¯¢" type="1020" typeName="ç产管ç"></privilege> |
| | | <privilege num="10200009" name="æç管ç" type="1020" typeName="ç产管ç"></privilege> |
| | | |
| | | <!-- å¹³å°ä¿¡æ¯ --> |
| | | <privilege num="10300000" name="äº§åæ¥è¯¢" type="1030" typeName="å¹³å°ä¿¡æ¯"></privilege> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <exclusions> |
| | | <!-- å¼å
¥log4j2æ¥å¿æ¶é廿é»è®¤çlogback --> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | </dependency> |
| | | <!--log4j-bomæ¯ä¸ªpomï¼æ²¡æå
·ä½çjarå
, springbootéè¦å® --> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom --> |
| | | <dependency> |
| | | <groupId>org.apache.logging.log4j</groupId> |
| | | <artifactId>log4j-bom</artifactId> |
| | | <version>${log4j-bom}</version> |
| | | <!-- è¿ä¸ªæ²¡æjarå
ï¼åªæpomæä»¶ï¼æä»¥è¦å ä¸ä¸é¢è®¾ç½® --> |
| | | <type>pom</type> |
| | | </dependency> |
| | | <!-- lombok --> |
| | | <dependency> |
| | |
| | | po.supperAdmin = Constant.no.byteValue() ; |
| | | // po.disabled = false ;//é»è®¤ä¸ç¦ç¨ |
| | | po.deleted = false;//é»è®¤ä¸å é¤ |
| | | po.supperAdmin = 0;//é»è®¤ä¸æ¯ç®¡çå |
| | | if (!StringUtils.isNullOrEmpty(po.password)) { |
| | | /* |
| | | 妿å端è¿è¡äºbase64å å¯ |
| | |
| | | package com.dy.pmsBase; |
| | | |
| | | import com.dingtalk.api.response.OapiRobotSendResponse; |
| | | import com.dy.pmsGlobal.util.DingDingUtils; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @SpringBootTest |
| | | class PmsWebBaseApplicationTests { |
| | | |
| | | private DingDingUtils dingDingUtils; |
| | | @Autowired |
| | | public void setDingDingUtils(DingDingUtils dingDingUtils) { |
| | | this.dingDingUtils = dingDingUtils; |
| | | } |
| | | @Test |
| | | void contextLoads() { |
| | | OapiRobotSendResponse rsp = dingDingUtils.send("åä½,è¿æ¯ä¸æ¡æµè¯æ¶æ¯"); |
| | | System.out.println(rsp.getErrcode()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.pmsOther.screen; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.dy.common.aop.SsoPowerAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | |
| | | List<StaDeviceProductionLog> log = sv.queryDeviceLog(startTime,endTime); |
| | | return BaseResponseUtils.buildSuccess(log); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * ä»»å¡çæ¿ æ¥è¯¢å¨äº§ä»»å¡çæ¿ |
| | | * */ |
| | | @GetMapping(path="queryPlanList") |
| | | @Log("æ¥è¯¢å¨äº§ä»»å¡çæ¿") |
| | | public BaseResponse<List<JSONObject>> queryPlanList(){ |
| | | List<JSONObject> list = sv.queryPlanList(); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | } |
| | |
| | | package com.dy.pmsOther.screen; |
| | | |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper; |
| | | import com.dy.pmsGlobal.daoSta.*; |
| | | import com.dy.pmsGlobal.pojoSta.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | private StaWipSnExMapper wipSnExDao; |
| | | private StaDeviceProductionLogMapper deviceProductionLogDao; |
| | | private StaRepairInfoMapper repairInfoDao; |
| | | private PrAssemblyPlanMapper assemblyPlanDao; |
| | | @Autowired |
| | | public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) { |
| | | this.deviceLastDao = deviceLastDao; |
| | |
| | | @Autowired |
| | | public void setDeviceProductionLogDao(StaDeviceProductionLogMapper deviceProductionLogDao) { |
| | | this.deviceProductionLogDao = deviceProductionLogDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) { |
| | | this.assemblyPlanDao = assemblyPlanDao; |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | return date; |
| | | } |
| | | |
| | | public List<JSONObject> queryPlanList() { |
| | | List<JSONObject> list = assemblyPlanDao.queryPlanList(); |
| | | Map<String, JSONObject> map = new ConcurrentHashMap<>(); // 使ç¨å¹¶åå®å
¨çMap |
| | | for(JSONObject item:list){ |
| | | String planId = String.valueOf(item.getObj("planId")); |
| | | JSONObject innerObject = new JSONObject() |
| | | .set("nodeId", String.valueOf(item.getObj("nodeId"))) |
| | | .set("content", item.getObj("content")); |
| | | if(map.containsKey(planId)){ |
| | | JSONArray array = (JSONArray)map.get(planId).get("nodes"); |
| | | array.add(innerObject); |
| | | }else{ |
| | | JSONArray array = new JSONArray(); |
| | | array.add(innerObject); |
| | | JSONObject outObject= new JSONObject() |
| | | .set("planId", planId) |
| | | .set("planName", item.getObj("planName")) |
| | | .set("nodes", array); |
| | | map.put(planId,outObject); |
| | | } |
| | | } |
| | | return map.values().stream().collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <exclusions> |
| | | <!-- å¼å
¥log4j2æ¥å¿æ¶é廿é»è®¤çlogback --> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | </dependency> |
| | | <!--log4j-bomæ¯ä¸ªpomï¼æ²¡æå
·ä½çjarå
, springbootéè¦å® --> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom --> |
| | | <dependency> |
| | | <groupId>org.apache.logging.log4j</groupId> |
| | | <artifactId>log4j-bom</artifactId> |
| | | <version>${log4j-bom}</version> |
| | | <!-- è¿ä¸ªæ²¡æjarå
ï¼åªæpomæä»¶ï¼æä»¥è¦å ä¸ä¸é¢è®¾ç½® --> |
| | | <type>pom</type> |
| | | </dependency> |
| | | <!-- lombok --> |
| | | <dependency> |
| | |
| | | public class QueryVo extends QueryConditionVo { |
| | | public String reason; |
| | | /** |
| | | * 产ååç§° |
| | | * 产åID |
| | | */ |
| | | public String proName; |
| | | public Long proId; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 产ååç§° |
| | | */ |
| | | public String proName; |
| | | public String proId; |
| | | } |
| | |
| | | QueryVo vo = new QueryVo(); |
| | | return BaseResponseUtils.buildSuccess(proSv.selectAll(vo)); |
| | | } |
| | | /** |
| | | * 坿 ¹æ®orderIdæ¥è¯¢äº§å |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getProduct") |
| | | @SsoPowerAop(power = "10300000") |
| | | @Log("坿 ¹æ®orderIdæ¥è¯¢äº§å") |
| | | public BaseResponse<List<PltProduct>> getProduct(Long orderId){ |
| | | return BaseResponseUtils.buildSuccess(proSv.getProduct(orderId)); |
| | | } |
| | | |
| | | |
| | | @PostMapping(path="export") |
| | | @SsoPowerAop(power = "10300001") |
| | |
| | | |
| | | @Transactional |
| | | public int save(PltProduct p) { |
| | | //å¤æäº§åä¸è½éå |
| | | if (dao.exists(p.name, p.id)) { |
| | | throw new RuntimeException("产ååç§°éå¤"); |
| | | //å¤æäº§å åç§°ååå· ä¸è½éå |
| | | if (dao.exists(p.name.trim(), p.type.trim() ,p.id)) { |
| | | throw new RuntimeException("å·²ç»åå¨ç¸åç产ååç§°&åå·"); |
| | | } |
| | | int flag=0; |
| | | do { |
| | |
| | | |
| | | @Transactional |
| | | public int update(PltProduct p) { |
| | | if (dao.exists(p.name, p.id)) { |
| | | throw new RuntimeException("产ååç§°éå¤"); |
| | | if (dao.exists(p.name.trim(), p.type.trim(),p.id)) { |
| | | throw new RuntimeException("å·²ç»åå¨ç¸åç产ååç§°&åå·"); |
| | | } |
| | | int count = dao.updateByPrimaryKeySelective(p); |
| | | //å 餿§æ°æ®,éæ°æå
¥ |
| | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | return dao.selectAll(params); |
| | | } |
| | | |
| | | public List<PltProduct> getProduct(Long orderId) { |
| | | return dao.selectByOrderId(orderId); |
| | | } |
| | | |
| | | // public void downloadDoc(HttpServletResponse response) { |
| | | // PltProduct pro=dao.selectByPrimaryKey(Long.valueOf(1)); |
| | |
| | | package com.dy.pmsPlatform.station; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.dy.common.aop.SsoPowerAop; |
| | |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææå·¥ç« |
| | | * @return |
| | | */ |
| | | @GetMapping(path="all") |
| | | @SsoPowerAop(power = "10300006") |
| | | @Log("æ¥è¯¢ææå·¥ç«") |
| | | public BaseResponse<JSONArray> all(){ |
| | | JSONArray array = sv.selectAllIdAndName() ; |
| | | return BaseResponseUtils.buildSuccess(array); |
| | | } |
| | | |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10300007") |
| | | @Log("ç¦ç¨æå¯ç¨å·¥ç«") |
| | |
| | | package com.dy.pmsPlatform.station; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper; |
| | |
| | | public List<PltStation> selectAll() { |
| | | return dao.selectAll(); |
| | | } |
| | | |
| | | public JSONArray selectAllIdAndName() { |
| | | List<PltStation> list = dao.selectAll(); |
| | | JSONArray child = new JSONArray(); |
| | | list.forEach(item->{ |
| | | child.add(new JSONObject().set("id", String.valueOf(item.getId())).set("name", item.getName())); |
| | | }); |
| | | return child; |
| | | } |
| | | } |
| | | |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <exclusions> |
| | | <!-- å¼å
¥log4j2æ¥å¿æ¶é廿é»è®¤çlogback --> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | </dependency> |
| | | <!--log4j-bomæ¯ä¸ªpomï¼æ²¡æå
·ä½çjarå
, springbootéè¦å® --> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom --> |
| | | <dependency> |
| | | <groupId>org.apache.logging.log4j</groupId> |
| | | <artifactId>log4j-bom</artifactId> |
| | | <version>${log4j-bom}</version> |
| | | <!-- è¿ä¸ªæ²¡æjarå
ï¼åªæpomæä»¶ï¼æä»¥è¦å ä¸ä¸é¢è®¾ç½® --> |
| | | <type>pom</type> |
| | | </dependency> |
| | | <!-- lombok --> |
| | | <dependency> |
| | |
| | | filterRegistrationBean.setOrder(order_DevStageFilter);//æ§è¡æ¬¡åº |
| | | }else{ |
| | | filterRegistrationBean.setFilter(new UserTokenFilter()); |
| | | filterRegistrationBean.addUrlPatterns("/*");//é
ç½®è¿æ»¤è§å |
| | | filterRegistrationBean.addUrlPatterns("/process/*","/order/*","/assembly/*", |
| | | "/devOps/*","/workStation/*","/assembly/*", |
| | | "/schedule/save", |
| | | "/schedule/update", |
| | | "/schedule/selectPlan", |
| | | "/schedule/one", |
| | | "/schedule/some", |
| | | "/schedule/export", |
| | | "/schedule/getUserList");//é
ç½®è¿æ»¤è§å |
| | | filterRegistrationBean.setName("UserTokenFilter");//è®¾ç½®è¿æ»¤å¨åç§° |
| | | filterRegistrationBean.setOrder(order_UserTokenFilter);//æ§è¡æ¬¡åº |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.order; |
| | | |
| | | import com.dy.common.aop.SsoPowerAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProduct; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import com.dy.pmsGlobal.pojoPr.PrOrder; |
| | | import com.dy.pmsProduct.order.QueryVo; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 订å管ç |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path = "order") |
| | | public class OrderCtrl { |
| | | private OrderSv sv; |
| | | |
| | | @Autowired |
| | | public void setAssemblySv(OrderSv orderSv) { |
| | | this.sv = orderSv; |
| | | } |
| | | |
| | | @PostMapping(path = "save") |
| | | @SsoPowerAop(power = "10200007") |
| | | @Log("ä¿å订åä¿¡æ¯") |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PrOrder order) { |
| | | int count = sv.save(order); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "update") |
| | | @SsoPowerAop(power = "10200007") |
| | | @Log("ä¿®æ¹è®¢åä¿¡æ¯") |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PrOrder order) { |
| | | int count = sv.update(order); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¢åä¿¡æ¯ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "delete") |
| | | @SsoPowerAop(power = "10200007") |
| | | @Log("å é¤è®¢åä¿¡æ¯") |
| | | public BaseResponse<Boolean> delete(String id) { |
| | | int count = sv.delete(Long.parseLong(id)); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "one") |
| | | @SsoPowerAop(power = "10200006") |
| | | @Log("æ ¹æ®IDæ¥è¯¢è®¢åä¿¡æ¯") |
| | | public BaseResponse<PrOrder> one(String id) { |
| | | PrOrder plan = sv.selectById(id); |
| | | return BaseResponseUtils.buildSuccess(plan); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "some") |
| | | @SsoPowerAop(power = "10200006") |
| | | @Log("å页æ¥è¯¢è®¢åä¿¡æ¯") |
| | | public BaseResponse<QueryResultVo<List<PrOrder>>> some(@RequestBody QueryVo vo) { |
| | | QueryResultVo<List<PrOrder>> list = sv.selectSome(vo); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææè®¢å |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "all") |
| | | @SsoPowerAop(power = "10200006") |
| | | @Log("æ¥è¯¢ææäº§å") |
| | | public BaseResponse<List<PrOrder>> all() { |
| | | QueryVo vo = new QueryVo(); |
| | | return BaseResponseUtils.buildSuccess(sv.selectAll(vo)); |
| | | } |
| | | |
| | | @PostMapping(path = "updateStatus") |
| | | @SsoPowerAop(power = "10200007") |
| | | @Log("æ´æ°è®¢åç¶æ") |
| | | public BaseResponse<Boolean> updateStatus(@RequestBody PrOrder order) { |
| | | int count = sv.updateStatus(order); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.order; |
| | | |
| | | public enum OrderStatusEnum { |
| | | //æä¸¾, ç¶æ:æ£å¸¸(1) æå(0) ç»æ(-1) |
| | | NORMAL(1,"æ£å¸¸"), |
| | | PAUSE(0,"æå"), |
| | | END(-1,"ç»æ"); |
| | | private int code; |
| | | private String name; |
| | | |
| | | OrderStatusEnum(int code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.order; |
| | | |
| | | import com.dy.common.webFilter.UserTokenContext; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoPr.*; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.pojoPr.*; |
| | | import com.dy.pmsGlobal.util.UserUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class OrderSv { |
| | | private PrOrderMapper orderDao; |
| | | private PrOrderItemMapper orderItemDao; |
| | | private UserUtil userUtil; |
| | | |
| | | @Autowired |
| | | public void setOrderDao(PrOrderMapper orderDao) { |
| | | this.orderDao = orderDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setOrderItemDao(PrOrderItemMapper orderItemDao) { |
| | | this.orderItemDao = orderItemDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setUserUtil(UserUtil userUtil) { |
| | | this.userUtil = userUtil; |
| | | } |
| | | |
| | | @Transactional |
| | | public int save(PrOrder p) { |
| | | p.id = null; |
| | | //å¤æäº§åä¸è½éå |
| | | if (orderDao.exists(p.name, p.id)) { |
| | | throw new RuntimeException("订ååç§°ä¸è½éå¤"); |
| | | } |
| | | extractedCheck(p); |
| | | p.deleted = false; |
| | | BaUser loginUser = userUtil.getUser(UserTokenContext.get()); |
| | | if (loginUser != null) { |
| | | p.creator = loginUser.id; |
| | | } |
| | | int count = orderDao.insertSelective(p); |
| | | saveOrderItems(p); |
| | | return count; |
| | | } |
| | | |
| | | @Transactional |
| | | public int update(PrOrder p) { |
| | | if (orderDao.exists(p.name, p.id)) { |
| | | throw new RuntimeException("订ååç§°ä¸è½éå¤"); |
| | | } |
| | | extractedCheck(p); |
| | | int count = orderDao.updateByPrimaryKeySelective(p); |
| | | if (count > 0) { |
| | | saveOrderItems(p); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | private void saveOrderItems(PrOrder p) { |
| | | p.items.forEach(param -> { |
| | | param.orderId = p.id; |
| | | if (param.id != null) { |
| | | orderItemDao.updateByPrimaryKeySelective(param); |
| | | } else { |
| | | param.deleted = false; |
| | | orderItemDao.insert(param); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * é»è¾å é¤å®ä½ |
| | | * |
| | | * @param id å®ä½ID |
| | | * @return å½±åè®°å½æ°é |
| | | */ |
| | | @Transactional |
| | | public int delete(Long id) { |
| | | return orderDao.deleteLogicById(id); |
| | | } |
| | | |
| | | public PrOrder selectById(String proId) { |
| | | PrOrder pro = orderDao.selectByPrimaryKey(Long.valueOf(proId)); |
| | | changeRate(pro); |
| | | return pro; |
| | | } |
| | | |
| | | /** |
| | | * è·å订åå表 |
| | | */ |
| | | public QueryResultVo<List<PrOrder>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | //æ¥è¯¢ç¬¦åæ¡ä»¶çè®°å½æ»æ° |
| | | Long itemTotal = orderDao.selectSomeCount(params); |
| | | |
| | | QueryResultVo<List<PrOrder>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr); |
| | | //计ç®å页çä¿¡æ¯ |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<PrOrder> orderList = orderDao.selectSome(params); |
| | | for (PrOrder prOrder : orderList) { |
| | | changeRate(prOrder); |
| | | } |
| | | //æ¥è¯¢ç¬¦åæ¡ä»¶çè®°å½ |
| | | rsVo.obj = orderList; |
| | | return rsVo; |
| | | } |
| | | |
| | | private void changeRate(PrOrder prOrder) { |
| | | if (prOrder != null && prOrder.items != null) { |
| | | List<PrOrderItem> items = prOrder.items; |
| | | for (int i = 1; i < items.size(); i++) { |
| | | for (int j = i - 1; j >= 0; j--) { |
| | | //æ¿çi便¬¡è·ä¸ä¸ä¸ªæ¯è¾,å¦æäº§åç¸å,åä¸ä¸ä¸ªè®°å½complete_number - number 妿 > 0 åç»i ,妿 < 0 åå° complete_number 置为0 |
| | | if (items.get(j).getProId().intValue() == items.get(i).getProId().intValue()) { |
| | | int remainNumber = items.get(j).getCompleteNumber() - items.get(j).getNumber(); |
| | | if (remainNumber > 0) { |
| | | items.get(j).setCompleteNumber(items.get(j).getNumber()); |
| | | items.get(j).setCompleteRate("100.00%"); |
| | | items.get(i).setCompleteNumber(remainNumber); |
| | | BigDecimal remainBig = new BigDecimal(remainNumber * 100); |
| | | BigDecimal iNumberBig = new BigDecimal(items.get(i).getNumber()); |
| | | BigDecimal result = remainBig.divide(iNumberBig, 2, RoundingMode.HALF_UP); |
| | | items.get(i).setCompleteRate(result.toString() + "%"); |
| | | } else { |
| | | items.get(i).setCompleteNumber(0); |
| | | items.get(i).setCompleteRate("0.00%"); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public List<PrOrder> selectAll(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | List<PrOrder> orderList = orderDao.selectAll(params); |
| | | for (PrOrder prOrder : orderList) { |
| | | changeRate(prOrder); |
| | | } |
| | | return orderList; |
| | | } |
| | | |
| | | /** |
| | | * åªæ´æ°ç¶æ,䏿´æ°å
¶ä»å段 |
| | | * |
| | | * @param order æ´æ°ç¶æ 妿æå¨æ§è¡ä¸çä»»å¡,ä¸è®©æå |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public int updateStatus(PrOrder order) { |
| | | if (order.status == OrderStatusEnum.NORMAL.getCode()) { |
| | | PrOrder prOrder = orderDao.selectByPrimaryKey(order.id); |
| | | prOrder.status = order.status; |
| | | extractedCheck(prOrder); |
| | | } |
| | | PrOrder param = new PrOrder(); |
| | | param.id = order.id; |
| | | param.status = order.status; |
| | | return orderDao.updateByPrimaryKeySelective(param); |
| | | } |
| | | |
| | | //å¦æäº¤æå°äºå½åæ¶é´,ä¸å
许设置为æ£å¸¸ |
| | | private void extractedCheck(PrOrder order) { |
| | | if (order.status == OrderStatusEnum.NORMAL.getCode()) { |
| | | String deliveryDateStr = order.getDeliveryDate(); |
| | | LocalDate endDate = LocalDate.parse(deliveryDateStr, DateTimeFormatter.ISO_LOCAL_DATE); |
| | | LocalDate nextDay = endDate.plusDays(1); |
| | | LocalDate today = LocalDate.now(); // è·åå½åæ¥æ |
| | | if (nextDay.isBefore(today)) { |
| | | throw new RuntimeException("äº¤ä»æ¥æå¿
须大äºçäºå½åæ¥æ,请修æ¹äº¤ä»æ¥æ"); |
| | | } |
| | | } |
| | | //妿æå¨ç产çä»»å¡ä¸è½è®¾ç½®ä¸ºæå æ ç»æ |
| | | /* |
| | | PrProductionProcess process = processDao.selectByPrimaryKey(order.processId); |
| | | if(process == null || !process.proId.equals(order.proId)){ |
| | | throw new RuntimeException("产åä¸ç产æµç¨ä¸å¹é
"); |
| | | } |
| | | //å¼å§æ¥æè¦å°äºç»ææ¥æ |
| | | if(order.startDate.compareTo(order.endDate) > 0){ |
| | | throw new RuntimeException("å¼å§æ¥æä¸è½å¤§äºç»ææ¥æ"); |
| | | }*/ |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.order; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.*; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class QueryVo extends QueryConditionVo { |
| | | public String name; |
| | | public String customerName; |
| | | public String projectName; |
| | | public String director; |
| | | public String startDate; |
| | | public String endDate; |
| | | public Integer status; |
| | | } |
| | |
| | | import com.dy.common.webFilter.UserTokenContext; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoOth.OthFileMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrProductionNodeMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrProductionProcessMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper; |
| | | import com.dy.pmsGlobal.daoPr.*; |
| | | import com.dy.pmsGlobal.dyFile.FileOperate; |
| | | import com.dy.pmsGlobal.dyFile.FileRestVo; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.pojoOth.OthFile; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import com.dy.pmsGlobal.pojoPr.PrProductionNode; |
| | | import com.dy.pmsGlobal.pojoPr.PrProductionProcess; |
| | | import com.dy.pmsGlobal.pojoPr.PrWorkingInstruction; |
| | | import com.dy.pmsGlobal.pojoPr.*; |
| | | import com.dy.pmsGlobal.util.UserUtil; |
| | | import com.dy.pmsProduct.taskPlan.PlanStatusEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private PrProductionProcessMapper processDao; |
| | | private PrProductionNodeMapper nodeDao; |
| | | private PrWorkingInstructionMapper workDao; |
| | | private PrBillOfMaterialMapper billDao; |
| | | private UserUtil userUtil; |
| | | private FileOperate fileOperate; |
| | | private OthFileMapper othFileMapper; |
| | |
| | | @Autowired |
| | | public void setOthFileMapper(OthFileMapper othFileMapper) { |
| | | this.othFileMapper = othFileMapper; |
| | | } |
| | | @Autowired |
| | | public void setBillDao(PrBillOfMaterialMapper billDao) { |
| | | this.billDao = billDao; |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | } |
| | | }); |
| | | if (startCount.get() != 1 || endCount.get() != 1) { |
| | | throw new RuntimeException("èç¹å¼å§åç»æèç¹æä¸åªè½æä¸ä¸ª"); |
| | | throw new RuntimeException("å¼å§èç¹åç»æèç¹æä¸åªè½æä¸ä¸ª"); |
| | | } |
| | | } |
| | | |
| | |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | workDao.insertMany(workList); |
| | | } |
| | | |
| | | List<PrBillOfMaterial> billList = process.nodes.stream().map(node -> { |
| | | if (node.bill != null) { |
| | | node.bill.nodeId = node.id; |
| | | return node.bill; |
| | | } |
| | | return null; |
| | | }).filter(bill -> bill != null).toList(); |
| | | if (CollectionUtils.isNotEmpty(billList)) { |
| | | billDao.insertMany(billList); |
| | | } |
| | | } |
| | | |
| | | public int delete(Long id) { |
| | |
| | | process.nodes.forEach(node -> { |
| | | if (node.instruction != null) { |
| | | addUrl(node.instruction); |
| | | } |
| | | if (node.bill != null) { |
| | | addBillUrl(node.bill); |
| | | } |
| | | }); |
| | | } |
| | |
| | | if (node.instruction != null) { |
| | | addUrl(node.instruction); |
| | | } |
| | | if (node.bill != null) { |
| | | addBillUrl(node.bill); |
| | | } |
| | | }); |
| | | }); |
| | | return rsVo; |
| | |
| | | return; |
| | | } |
| | | FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash); |
| | | ins.webUrl = fileRestVo.fileSysRestUrl + fileRestVo.fileWebDownloadPath + ins.fileId; |
| | | ins.webUrl = fileRestVo.fileWebDownloadPath + ins.fileId; |
| | | ins.orgName = file.orgName; |
| | | ins.extName = file.extName; |
| | | } |
| | | |
| | | private void addBillUrl(PrBillOfMaterial bill) { |
| | | if (bill == null || bill.fileId == null) { |
| | | return; |
| | | } |
| | | OthFile file = othFileMapper.selectByPrimaryKey(bill.fileId); |
| | | if (file == null) { |
| | | return; |
| | | } |
| | | FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash); |
| | | bill.webUrl = fileRestVo.fileWebDownloadPath + bill.fileId; |
| | | bill.orgName = file.orgName; |
| | | bill.extName = file.extName; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import com.alibaba.excel.util.BooleanUtils; |
| | | import com.alibaba.excel.write.handler.CellWriteHandler; |
| | | import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èªå®ä¹æ¦æªå¨ã |
| | | * æ ¹æ®æç,设置横跨å è¡ |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class CustomCellWriteHandler implements CellWriteHandler { |
| | | |
| | | // 设置åå¹¶ç¸ååç§°çåå
å |
| | | private int[] mergeColumnIndex = {1,2,3}; |
| | | // ä»åªè¡å¼å§åå¹¶ |
| | | private int mergeRowIndex = 3; |
| | | |
| | | @Override |
| | | public void afterCellDispose(CellWriteHandlerContext context) { |
| | | Cell cell = context.getCell(); |
| | | //å½åè¡ |
| | | int curRowIndex = cell.getRowIndex(); |
| | | //å½åå |
| | | int curColIndex = cell.getColumnIndex(); |
| | | |
| | | WriteSheetHolder writeSheetHolder = context.getWriteSheetHolder(); |
| | | |
| | | if (curRowIndex >= mergeRowIndex) { |
| | | for (int i = 0; i < mergeColumnIndex.length; i++) { |
| | | if (curColIndex == mergeColumnIndex[i]) { |
| | | mergeWithPrevRow(writeSheetHolder, cell, curRowIndex, curColIndex); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å½ååå
æ ¼åä¸åå¹¶ |
| | | * |
| | | * @param writeSheetHolder |
| | | * @param cell å½ååå
æ ¼ |
| | | * @param curRowIndex å½åè¡ |
| | | * @param curColIndex å½åå |
| | | */ |
| | | private void mergeWithPrevRow(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex) { |
| | | Object curId = cell.getSheet().getRow(curRowIndex).getCell(0).getStringCellValue(); |
| | | Object preId = cell.getSheet().getRow(curRowIndex-1).getCell(0).getStringCellValue(); |
| | | |
| | | // æ¯è¾å½åè¡çidå¼ä¸ä¸ä¸è¡æ¯å¦ç¸åï¼ç¸ååå¹¶å½ååå
æ ¼ä¸ä¸ä¸è¡ |
| | | if (curId.equals(preId)) { |
| | | Sheet sheet = writeSheetHolder.getSheet(); |
| | | List<CellRangeAddress> mergeRegions = sheet.getMergedRegions(); |
| | | boolean isMerged = false; |
| | | for (int i = 0; i < mergeRegions.size() && !isMerged; i++) { |
| | | CellRangeAddress cellRangeAddr = mergeRegions.get(i); |
| | | // è¥ä¸ä¸ä¸ªåå
æ ¼å·²ç»è¢«åå¹¶ï¼åå
ç§»åºåæçåå¹¶åå
ï¼åéæ°æ·»å åå¹¶åå
|
| | | if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) { |
| | | sheet.removeMergedRegion(i); |
| | | cellRangeAddr.setLastRow(curRowIndex); |
| | | sheet.addMergedRegion(cellRangeAddr); |
| | | isMerged = true; |
| | | } |
| | | } |
| | | // è¥ä¸ä¸ä¸ªåå
æ ¼æªè¢«åå¹¶ï¼åæ°å¢åå¹¶åå
|
| | | if (!isMerged) { |
| | | CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex); |
| | | sheet.addMergedRegion(cellRangeAddress); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.*; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.BooleanEnum; |
| | | import com.alibaba.excel.enums.poi.BorderStyleEnum; |
| | | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
| | | import com.alibaba.excel.enums.poi.VerticalAlignmentEnum; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | //åèï¼ https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write |
| | | @Data |
| | | @HeadRowHeight(40) //设置æ é¢é«åº¦ |
| | | @HeadFontStyle(fontName="å®ä½", fontHeightInPoints = 16) |
| | | @HeadStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, |
| | | horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, |
| | | borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, |
| | | leftBorderColor = 8, rightBorderColor = 8, topBorderColor = 8, bottomBorderColor = 8) //IndexedColors.BLACK |
| | | @ContentRowHeight(30) //设置å
容é«åº¦ |
| | | @ContentFontStyle(fontName="å®ä½", fontHeightInPoints = 11) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, |
| | | horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, |
| | | borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, |
| | | leftBorderColor = 8, rightBorderColor = 8, topBorderColor = 8, bottomBorderColor = 8) //IndexedColors.BLACK |
| | | @ColumnWidth(16) //设置å宽 |
| | | public class ExcelVo implements Converter<byte[]> { |
| | | @ColumnWidth(0)//设置å宽为0,䏿¾ç¤º |
| | | @ExcelProperty("ID") |
| | | public String id ; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("ç¨æ·å") |
| | | public String userName ; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("æçæ¥æ") |
| | | public String scheduleDate ; |
| | | |
| | | @ColumnWidth(28) |
| | | @ExcelProperty("å建æ¶é´") |
| | | public Date dt ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"æçå
容","ä»»å¡è®¡å"}) |
| | | public String planName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"æçå
容","èç¹"}) |
| | | public String nodeName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"æçå
容","å·¥ç«"}) |
| | | public String stationName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"æçå
容","å·¥ä½å
容"}) |
| | | public String workDetails ; |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.*; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class QueryVo extends QueryConditionVo { |
| | | public String planName; |
| | | public String scheduleDate; |
| | | public Long userId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.dy.common.aop.SsoPowerAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.pojoPr.PrSchedule; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æç |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="schedule") |
| | | public class ScheduleCtrl { |
| | | private String fileName = "æçä¿¡æ¯" ; |
| | | private String sheetName = "æçä¿¡æ¯" ; |
| | | private ScheduleSv sv; |
| | | @Autowired |
| | | public void setScheduleSv(ScheduleSv scheduleSv) { |
| | | this.sv = scheduleSv; |
| | | } |
| | | |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10200009") |
| | | @Log("ä¿åæç") |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PrSchedule schedule){ |
| | | int count = sv.save(schedule); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @param schedule |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10200009") |
| | | @Log("æ´æ°æç") |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PrSchedule schedule){ |
| | | int count = sv.update(schedule); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("æ°æ®åºåå¨å¤±è´¥"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡è®¡åå表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping(path="selectPlan") |
| | | @SsoPowerAop(power = "10200008") |
| | | @Log("æ¥è¯¢ä»»å¡è®¡åå表") |
| | | public BaseResponse<List<JSONObject>> selectPlan(@RequestBody QueryVo vo){ |
| | | List<JSONObject> array = sv.selectPlan(vo) ; |
| | | return BaseResponseUtils.buildSuccess(array); |
| | | } |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10200008") |
| | | @Log("æ ¹æ®IDæ¥è¯¢æç") |
| | | public BaseResponse<PrSchedule> one(Long id){ |
| | | PrSchedule schedule=sv.selectById(id); |
| | | return BaseResponseUtils.buildSuccess(schedule); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10200008") |
| | | @Log("å页æ¥è¯¢æç") |
| | | public BaseResponse<QueryResultVo<List<PrSchedule>>> some(@RequestBody QueryVo vo){ |
| | | QueryResultVo<List<PrSchedule>> list = sv.selectSome(vo) ; |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getUserList") |
| | | @SsoPowerAop(power = "10200008") |
| | | @Log("æ¥è¯¢ç³»ç»ä¸æä½äººåä¿¡æ¯") |
| | | public BaseResponse<List<BaUser>> getUserList(){ |
| | | List<BaUser> userList = sv.selectById(); |
| | | return BaseResponseUtils.buildSuccess(userList); |
| | | } |
| | | |
| | | |
| | | @PostMapping(path="export") |
| | | @SsoPowerAop(power = "10200009") |
| | | @Log("å¯¼åºæç") |
| | | public void exportSchedule(@RequestBody QueryVo queryVo, HttpServletResponse response) throws IOException { |
| | | List<ExcelVo> list = new ArrayList<>(); |
| | | |
| | | List<PrSchedule> schList = sv.selectAll(queryVo); |
| | | if (CollectionUtils.isNotEmpty(schList)) { |
| | | schList.forEach(sch -> { |
| | | if (CollectionUtils.isNotEmpty(sch.relList)) { |
| | | sch.relList.forEach(rel -> { |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.id = sch.id.toString(); |
| | | vo.userName = sch.userName; |
| | | vo.scheduleDate = sch.scheduleDate; |
| | | vo.dt = sch.dt; |
| | | vo.planName = rel.planName; |
| | | vo.nodeName = rel.nodeName; |
| | | vo.stationName = rel.stationName; |
| | | vo.workDetails = rel.workDetails; |
| | | list.add(vo); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName) |
| | | .registerWriteHandler(new CustomCellWriteHandler()).doWrite(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ,触å±ç«¯ä½¿ç¨ä¸éªè¯token |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | @PostMapping(path="selectAll") |
| | | public BaseResponse<List<PrSchedule>> selectAll(@RequestBody QueryVo queryVo) { |
| | | return BaseResponseUtils.buildSuccess(sv.selectAll(queryVo)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoBa.BaUserMapper; |
| | | import com.dy.pmsGlobal.daoPlt.PltStationMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrScheduleMapper; |
| | | import com.dy.pmsGlobal.daoPr.PrScheduleRelMapper; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.pojoPlt.PltStation; |
| | | import com.dy.pmsGlobal.pojoPr.PrSchedule; |
| | | import com.dy.pmsGlobal.pojoPr.PrScheduleRel; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class ScheduleSv { |
| | | private PrScheduleMapper scheduleDao; |
| | | private PrScheduleRelMapper scheduleRelDao; |
| | | private PrAssemblyPlanMapper assemblyPlanDao; |
| | | private PltStationMapper stationDao; |
| | | private BaUserMapper baUserDao; |
| | | |
| | | @Autowired |
| | | public void setStationDao(PltStationMapper stationDao) { |
| | | this.stationDao = stationDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setScheduleRelDao(PrScheduleRelMapper scheduleRelDao) { |
| | | this.scheduleRelDao = scheduleRelDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) { |
| | | this.assemblyPlanDao = assemblyPlanDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setScheduleDao(PrScheduleMapper scheduleDao) { |
| | | this.scheduleDao = scheduleDao; |
| | | } |
| | | |
| | | @Autowired |
| | | private void setBaUserMapper(BaUserMapper baUserDao) { |
| | | this.baUserDao = baUserDao; |
| | | } |
| | | |
| | | @Transactional |
| | | public int save(PrSchedule schedule) { |
| | | int count = scheduleDao.insertSelective(schedule); |
| | | saveRel(schedule); |
| | | return count; |
| | | } |
| | | @Transactional |
| | | public int update(PrSchedule schedule) { |
| | | scheduleRelDao.deleteByScheduleId(schedule.id); |
| | | saveRel(schedule); |
| | | return scheduleDao.updateByPrimaryKeySelective(schedule); |
| | | } |
| | | |
| | | private void saveRel(PrSchedule schedule) { |
| | | schedule.relList.forEach(rel -> validateRelData(rel, schedule)); |
| | | schedule.relList.forEach(rel -> scheduleRelDao.insertSelective(rel)); |
| | | } |
| | | |
| | | private void validateRelData(PrScheduleRel rel, PrSchedule schedule) { |
| | | validatePlan(rel); |
| | | validateStation(rel); |
| | | rel.scheduleId = schedule.id; |
| | | } |
| | | |
| | | private void validatePlan(PrScheduleRel rel) { |
| | | if (rel.planId != null && rel.nodeId != null) { |
| | | long countPlan = assemblyPlanDao.countByPlanIdAndNodeId(rel.planId, rel.nodeId); |
| | | if (countPlan == 0) { |
| | | log.error("æçæ°æ®ä¸å¹é
, planId:{}, nodeId:{}", rel.planId, rel.nodeId); |
| | | throw new RuntimeException("æçæ°æ®ä¸å¹é
, planId:" + rel.planId + ", nodeId:" + rel.nodeId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void validateStation(PrScheduleRel rel) { |
| | | if (rel.stationId != null) { |
| | | Optional<PltStation> stationOpt = Optional.ofNullable(stationDao.selectByPrimaryKey(rel.stationId)); |
| | | stationOpt.orElseThrow(() -> { |
| | | log.error("å·¥ç«ä¿¡æ¯ä¸åå¨, stationId:{}", rel.stationId); |
| | | return new RuntimeException("å·¥ç«ä¿¡æ¯ä¸åå¨, stationId:" + rel.stationId); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | public PrSchedule selectById(Long id) { |
| | | return scheduleDao.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | public List<BaUser> selectById() { |
| | | List<BaUser> userList = baUserDao.getUserList(); |
| | | return userList; |
| | | } |
| | | |
| | | public QueryResultVo<List<PrSchedule>> selectSome(QueryVo vo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | //æ¥è¯¢ç¬¦åæ¡ä»¶çè®°å½æ»æ° |
| | | Long itemTotal = scheduleDao.selectSomeCount(params); |
| | | QueryResultVo<List<PrSchedule>> rsVo = new QueryResultVo<>(vo.pageSize, vo.pageCurr); |
| | | //计ç®å页çä¿¡æ¯ |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | //æ¥è¯¢ç¬¦åæ¡ä»¶çè®°å½ |
| | | rsVo.obj = scheduleDao.selectSome(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | public List<JSONObject> selectPlan(QueryVo vo) { |
| | | List<JSONObject> list = assemblyPlanDao.selectByPlanName(vo.planName); |
| | | Map<String, JSONObject> map = new ConcurrentHashMap<>(); // 使ç¨å¹¶åå®å
¨çMap |
| | | for(JSONObject item:list){ |
| | | String planId = String.valueOf(item.getObj("planId")); |
| | | JSONObject innerObject = new JSONObject() |
| | | .set("nodeId", String.valueOf(item.getObj("nodeId"))) |
| | | .set("content", item.getObj("content")); |
| | | if(map.containsKey(planId)){ |
| | | JSONArray array = (JSONArray)map.get(planId).get("nodes"); |
| | | array.add(innerObject); |
| | | }else{ |
| | | JSONArray array = new JSONArray(); |
| | | array.add(innerObject); |
| | | JSONObject outObject= new JSONObject() |
| | | .set("planId", planId) |
| | | .set("planName", item.getObj("planName")) |
| | | .set("nodes", array); |
| | | map.put(planId,outObject); |
| | | } |
| | | } |
| | | return map.values().stream().collect(Collectors.toList()); |
| | | } |
| | | |
| | | public List<PrSchedule> selectAll(QueryVo queryVo) { |
| | | return scheduleDao.selectAll(queryVo.scheduleDate, queryVo.userId); |
| | | } |
| | | } |
| | |
| | | |
| | | @GetMapping(path="exportDevice") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("导åºè®¾å¤å·") |
| | | @Log("导åºè®¾å¤å·åäºç»´ç ") |
| | | public void exportDevice(Long batchId, HttpServletResponse response){ |
| | | Date start = new Date() ; |
| | | List<Converter> list = new ArrayList<>(); |
| | |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | log.info("导åºè®¾å¤å·èæ¶ï¼"+(new Date().getTime()-start.getTime())+"ms"); |
| | | log.info("导åºè®¾å¤å·åäºç»´ç èæ¶ï¼"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileName,sheetName,list); |
| | | log.info("导åºè®¾å¤å·åäºç»´ç èæ¶ï¼"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | @GetMapping(path="exportDeviceNo") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("导åºè®¾å¤å·") |
| | | public void exportDeviceNo(Long batchId, HttpServletResponse response){ |
| | | Date start = new Date() ; |
| | | List<Converter> list = new ArrayList<>(); |
| | | |
| | | List<PrDevice> deviceList = sv.selectDeviceByBatchId(batchId) ; |
| | | // 使ç¨å¹¶è¡æµæé«æ§è½ |
| | | deviceList.parallelStream().forEach(device -> { |
| | | ExcelDeviceNoVo vo = new ExcelDeviceNoVo(); |
| | | vo.deviceNo = device.deviceNo; |
| | | list.add(vo); |
| | | }); |
| | | //æ ¹æ®batchidæ¾å°ä»»å¡åç§° |
| | | PrAssemblyPlan plan = sv.selectByBatchId(batchId); |
| | | String fileNameStr = plan.name +"-"+ fileName; |
| | | log.info("导åºè®¾å¤å·èæ¶ï¼"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileNameStr,sheetName,list); |
| | | log.info("导åºè®¾å¤å·èæ¶ï¼"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | } |
| | |
| | | return deviceDao.selectByBatchId(batchId); |
| | | } |
| | | |
| | | public PrAssemblyPlan selectByBatchId(Long batchId){ |
| | | return assemblyDao.selectByBatchId(batchId); |
| | | } |
| | | /** |
| | | * åªæ´æ°ç¶æ,䏿´æ°å
¶ä»å段 |
| | | * @param plan |
| New file |
| | |
| | | package com.dy.pmsProduct.taskPlan; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.*; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.BooleanEnum; |
| | | import com.alibaba.excel.enums.poi.BorderStyleEnum; |
| | | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
| | | import com.alibaba.excel.enums.poi.VerticalAlignmentEnum; |
| | | import lombok.Data; |
| | | |
| | | //åèï¼ https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write |
| | | @Data |
| | | @HeadRowHeight(40) //设置æ é¢é«åº¦ |
| | | @HeadFontStyle(fontName="å®ä½", fontHeightInPoints = 16) |
| | | @HeadStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, |
| | | horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, |
| | | borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, |
| | | leftBorderColor = 8, rightBorderColor = 8, topBorderColor = 8, bottomBorderColor = 8) //IndexedColors.BLACK |
| | | @ColumnWidth(16) //设置å宽 |
| | | public class ExcelDeviceNoVo implements Converter<byte[]> { |
| | | @ColumnWidth(40) |
| | | @ExcelProperty("设å¤å·") |
| | | public String deviceNo ; |
| | | } |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <exclusions> |
| | | <!-- å¼å
¥log4j2æ¥å¿æ¶é廿é»è®¤çlogback --> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | </dependency> |
| | | <!--log4j-bomæ¯ä¸ªpomï¼æ²¡æå
·ä½çjarå
, springbootéè¦å® --> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom --> |
| | | <dependency> |
| | | <groupId>org.apache.logging.log4j</groupId> |
| | | <artifactId>log4j-bom</artifactId> |
| | | <version>${log4j-bom}</version> |
| | | <!-- è¿ä¸ªæ²¡æjarå
ï¼åªæpomæä»¶ï¼æä»¥è¦å ä¸ä¸é¢è®¾ç½® --> |
| | | <type>pom</type> |
| | | </dependency> |
| | | <!-- lombok --> |
| | | <dependency> |
| | |
| | | } else { |
| | | PrProductionNode node = nodeDao.selectByPrimaryKey(workLast.nodeId); |
| | | record.nodeContent = node.content; |
| | | PrProductionNode nextNode = nodeDao.selectNodeBySort(node.getProcessId() , (node.getSort() + 1)); |
| | | record.nextNodeContent = nextNode.content; |
| | | record.nextNode = nextNode.id; |
| | | if (node.isRecord) { |
| | | record.deviceCycleContent = node.deviceCycleContent; |
| | | } |
| | |
| | | return; |
| | | } |
| | | FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash); |
| | | doc.webUrl = fileRestVo.fileSysRestUrl + fileRestVo.fileWebDownloadPath + doc.fileId; |
| | | doc.webUrl = fileRestVo.fileWebDownloadPath + doc.fileId; |
| | | doc.orgName = file.orgName; |
| | | doc.extName = file.extName; |
| | | }); |
| | |
| | | return; |
| | | } |
| | | FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash); |
| | | ins.webUrl = fileRestVo.fileSysRestUrl + fileRestVo.fileWebDownloadPath + ins.fileId; |
| | | ins.webUrl = fileRestVo.fileWebDownloadPath + ins.fileId; |
| | | ins.orgName = file.orgName; |
| | | ins.extName = file.extName; |
| | | } |
| | |
| | | package com.dy.pmsStation.config; |
| | | |
| | | import com.dy.common.schedulerTask.SchedulerTaskSupport; |
| | | import com.dy.pmsGlobal.daoSta.StaDeviceProductionLogPastMapper; |
| | | import com.dy.pmsStation.task.LogMoveTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class AppStartupRunner implements CommandLineRunner { |
| | | |
| | | |
| | | private StaDeviceProductionLogPastMapper pastMapper; |
| | | @Autowired |
| | | public void setPastMapper(StaDeviceProductionLogPastMapper pastMapper) { |
| | | this.pastMapper = pastMapper; |
| | | } |
| | | |
| | | @Override |
| | | public void run(String... args) throws Exception { |
| | | //æå¡å¯å¨æ¶æ£æ¥ä¸æ¬¡ä»»å¡æ¯å¦å·²æ§è¡ |
| | | Long count = pastMapper.countLastDayLogs(); |
| | | log.info("æªç§»å¨è®°å½æ°é:"+count); |
| | | if(count >0){ |
| | | new LogMoveTask().execute(null); |
| | | } |
| | | SchedulerTaskSupport.addDailyJob("logMoveTask", "station", LogMoveTask.class, |
| | | null, 0, 5); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class LogMoveTask extends TaskJob { |
| | | |
| | | @Override |
| | |
| | | public void execute(JobExecutionContext ctx) throws JobExecutionException { |
| | | log.info("ç产æ¥å¿ç§»å¨ä»»å¡å¼å§"); |
| | | StaDeviceProductionLogPastMapper pastMapper = SpringContextUtil.getBean(StaDeviceProductionLogPastMapper.class); |
| | | pastMapper.insertIntoPastLogs(); |
| | | pastMapper.deleteFromLogTable(); |
| | | Long count = pastMapper.countLastDayLogs(); |
| | | if(count>0){ |
| | | pastMapper.insertIntoPastLogs(); |
| | | pastMapper.deleteFromLogTable(); |
| | | } |
| | | log.info("ç产æ¥å¿ç§»å¨ä»»å¡ç»æ"); |
| | | } |
| | | } |
| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <!--ééæ¶æ¯æ¨é--> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>alibaba-dingtalk-service-sdk</artifactId> |
| | | <version>2.0.0</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <!-- vo poè½¬æ¢ --> |
| | | <dependency> |
| | | <groupId>org.mapstruct</groupId> |