wuxw лет назад: 3
Родитель
Сommit
5dd33972fd

+ 86 - 9
java110-bean/src/main/java/com/java110/dto/machineType/MachineTypeDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.machineType;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,10 +16,17 @@ import java.util.Date;
 public class MachineTypeDto extends PageDto implements Serializable {
 
     private String machineTypeName;
-private String typeId;
-private String machineTypeCd;
-private String communityId;
-
+    private String typeId;
+    private String parentTypeId;
+    private String machineTypeCd;
+    private String communityId;
+    private String isEnable;
+    private String machineTypeCode;
+    private String unit;
+    private String importanceLevel;
+    private String seq;
+    private String remark;
+    private String warrantyDeadline;
 
     private Date createTime;
 
@@ -28,19 +36,24 @@ private String communityId;
     public String getMachineTypeName() {
         return machineTypeName;
     }
-public void setMachineTypeName(String machineTypeName) {
+
+    public void setMachineTypeName(String machineTypeName) {
         this.machineTypeName = machineTypeName;
     }
-public String getTypeId() {
+
+    public String getTypeId() {
         return typeId;
     }
-public void setTypeId(String typeId) {
+
+    public void setTypeId(String typeId) {
         this.typeId = typeId;
     }
-public String getMachineTypeCd() {
+
+    public String getMachineTypeCd() {
         return machineTypeCd;
     }
-public void setMachineTypeCd(String machineTypeCd) {
+
+    public void setMachineTypeCd(String machineTypeCd) {
         this.machineTypeCd = machineTypeCd;
     }
 
@@ -68,4 +81,68 @@ public void setMachineTypeCd(String machineTypeCd) {
     public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
+
+    public String getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(String parentTypeId) {
+        this.parentTypeId = parentTypeId;
+    }
+
+    public String getIsEnable() {
+        return isEnable;
+    }
+
+    public void setIsEnable(String isEnable) {
+        this.isEnable = isEnable;
+    }
+
+    public String getMachineTypeCode() {
+        return machineTypeCode;
+    }
+
+    public void setMachineTypeCode(String machineTypeCode) {
+        this.machineTypeCode = machineTypeCode;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getImportanceLevel() {
+        return importanceLevel;
+    }
+
+    public void setImportanceLevel(String importanceLevel) {
+        this.importanceLevel = importanceLevel;
+    }
+
+    public String getSeq() {
+        return seq;
+    }
+
+    public void setSeq(String seq) {
+        this.seq = seq;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getWarrantyDeadline() {
+        return warrantyDeadline;
+    }
+
+    public void setWarrantyDeadline(String warrantyDeadline) {
+        this.warrantyDeadline = warrantyDeadline;
+    }
 }

+ 93 - 12
java110-bean/src/main/java/com/java110/po/machineType/MachineTypePo.java

@@ -17,6 +17,7 @@ package com.java110.po.machineType;
 
 import java.io.Serializable;
 import java.util.Date;
+
 /**
  * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
  * add by 吴学文 at 2021-10-15 12:38:42 mail: 928255095@qq.com
@@ -28,32 +29,48 @@ import java.util.Date;
 public class MachineTypePo implements Serializable {
 
     private String machineTypeName;
-private String typeId;
-private String statusCd = "0";
-private String machineTypeCd;
-private String communityId;
-public String getMachineTypeName() {
+    private String typeId;
+    private String parentTypeId;
+    private String statusCd = "0";
+    private String machineTypeCd;
+    private String communityId;
+    private String isEnable;
+    private String machineTypeCode;
+    private String unit;
+    private String importanceLevel;
+    private String seq;
+    private String remark;
+    private String warrantyDeadline;
+
+    public String getMachineTypeName() {
         return machineTypeName;
     }
-public void setMachineTypeName(String machineTypeName) {
+
+    public void setMachineTypeName(String machineTypeName) {
         this.machineTypeName = machineTypeName;
     }
-public String getTypeId() {
+
+    public String getTypeId() {
         return typeId;
     }
-public void setTypeId(String typeId) {
+
+    public void setTypeId(String typeId) {
         this.typeId = typeId;
     }
-public String getStatusCd() {
+
+    public String getStatusCd() {
         return statusCd;
     }
-public void setStatusCd(String statusCd) {
+
+    public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
-public String getMachineTypeCd() {
+
+    public String getMachineTypeCd() {
         return machineTypeCd;
     }
-public void setMachineTypeCd(String machineTypeCd) {
+
+    public void setMachineTypeCd(String machineTypeCd) {
         this.machineTypeCd = machineTypeCd;
     }
 
@@ -64,4 +81,68 @@ public void setMachineTypeCd(String machineTypeCd) {
     public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
+
+    public String getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(String parentTypeId) {
+        this.parentTypeId = parentTypeId;
+    }
+
+    public String getIsEnable() {
+        return isEnable;
+    }
+
+    public void setIsEnable(String isEnable) {
+        this.isEnable = isEnable;
+    }
+
+    public String getMachineTypeCode() {
+        return machineTypeCode;
+    }
+
+    public void setMachineTypeCode(String machineTypeCode) {
+        this.machineTypeCode = machineTypeCode;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getImportanceLevel() {
+        return importanceLevel;
+    }
+
+    public void setImportanceLevel(String importanceLevel) {
+        this.importanceLevel = importanceLevel;
+    }
+
+    public String getSeq() {
+        return seq;
+    }
+
+    public void setSeq(String seq) {
+        this.seq = seq;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getWarrantyDeadline() {
+        return warrantyDeadline;
+    }
+
+    public void setWarrantyDeadline(String warrantyDeadline) {
+        this.warrantyDeadline = warrantyDeadline;
+    }
 }

+ 146 - 3
java110-db/src/main/resources/mapper/common/MachineTypeV1ServiceDaoImplMapper.xml

@@ -8,25 +8,126 @@
     <!-- 保存设备类型信息 add by wuxw 2018-07-03 -->
     <insert id="saveMachineTypeInfo" parameterType="Map">
         insert into machine_type(
-        machine_type_name,type_id,machine_type_cd,community_id
+        machine_type_name,type_id,machine_type_cd,community_id,parent_type_id,is_enable,machine_type_code,unit,importance_level,seq,warranty_deadline,remark
         ) values (
-        #{machineTypeName},#{typeId},#{machineTypeCd},#{communityId}
+        #{machineTypeName},#{typeId},#{machineTypeCd},#{communityId},#{parentTypeId},#{isEnable},#{machineTypeCode},#{unit},#{importanceLevel},#{seq},#{warrantyDeadline},#{remark}
         )
     </insert>
 
+    <insert id="saveMachineTypeInfoSelective" parameterType="Map">
+        insert into machine_type
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="typeId != null" >
+                type_id,
+            </if>
+            <if test="machineTypeName != null" >
+                machine_type_name,
+            </if>
+            <if test="machineTypeCd != null" >
+                machine_type_cd,
+            </if>
+            <if test="communityId != null" >
+                community_id,
+            </if>
+            <if test="parentTypeId != null" >
+                parent_type_id,
+            </if>
+            <if test="isEnable != null" >
+                is_enable,
+            </if>
+            <if test="machineTypeCode != null" >
+                machine_type_code,
+            </if>
+            <if test="unit != null" >
+                unit,
+            </if>
+            <if test="importanceLevel != null" >
+                importance_level,
+            </if>
+            <if test="seq != null " >
+                seq,
+            </if>
+            <if test="warrantyDeadline != null and warrantyDeadline!=''" >
+                warranty_deadline,
+            </if>
+            <if test="remark != null and remark!=''" >
+                remark,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="typeId != null" >
+                #{typeId},
+            </if>
+            <if test="machineTypeName != null" >
+                #{machineTypeName},
+            </if>
+            <if test="machineTypeCd != null" >
+                #{machineTypeCd},
+            </if>
+            <if test="communityId != null" >
+                #{communityId},
+            </if>
+            <if test="parentTypeId != null" >
+                #{parentTypeId},
+            </if>
+            <if test="isEnable != null" >
+                #{isEnable},
+            </if>
+            <if test="machineTypeCode != null" >
+                #{machineTypeCode},
+            </if>
+            <if test="unit != null" >
+                #{unit},
+            </if>
+            <if test="importanceLevel != null" >
+                #{importanceLevel},
+            </if>
+            <if test="seq != null" >
+                #{seq},
+            </if>
+            <if test="warrantyDeadline != null and warrantyDeadline!=''" >
+                #{warrantyDeadline},
+            </if>
+            <if test="remark != null and remark!=''" >
+                #{remark},
+            </if>
+        </trim>
+    </insert>
 
     <!-- 查询设备类型信息 add by wuxw 2018-07-03 -->
     <select id="getMachineTypeInfo" parameterType="Map" resultType="Map">
         select t.machine_type_name,t.machine_type_name machineTypeName,t.type_id,t.type_id
         typeId,t.status_cd,t.status_cd statusCd,t.machine_type_cd,t.machine_type_cd machineTypeCd,t.community_id communityId
+        ,t.parent_type_id,t.parent_type_id parentTypeId,t.is_enable isEnable,t.machine_type_code machineTypeCode,t.unit unit,t.importance_level importanceLevel,t.seq seq,t.warranty_deadline warrantyDeadline,t.remark remark
         from machine_type t
         where 1 =1
+        <if test="isEnable !=null and isEnable != ''">
+            and t.is_enable= #{isEnable}
+        </if>
+        <if test="machineTypeCode !=null and machineTypeCode != ''">
+            and t.machine_type_code= #{machineTypeCode}
+        </if>
+        <if test="importanceLevel !=null and importanceLevel != ''">
+            and t.importance_level= #{importanceLevel}
+        </if>
+        <if test="warrantyDeadline !=null and warrantyDeadline != ''">
+            and t.warranty_deadline= #{warrantyDeadline}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
+        <if test="unit !=null and unit != ''">
+            and t.unit= #{unit}
+        </if>
         <if test="machineTypeName !=null and machineTypeName != ''">
             and t.machine_type_name= #{machineTypeName}
         </if>
         <if test="typeId !=null and typeId != ''">
             and t.type_id= #{typeId}
         </if>
+        <if test="parentTypeId !=null and parentTypeId != ''">
+            and t.parent_type_id= #{parentTypeId}
+        </if>
         <if test="statusCd !=null and statusCd != ''">
             and t.status_cd= #{statusCd}
         </if>
@@ -36,7 +137,7 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
-        order by t.create_time desc
+        order by t.seq desc,t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
@@ -59,6 +160,27 @@
         <if test="communityId !=null and communityId != ''">
             , t.community_id= #{communityId}
         </if>
+        <if test="isEnable !=null and isEnable != ''">
+            , t.is_enable= #{isEnable}
+        </if>
+        <if test="machineTypeCode !=null and machineTypeCode != ''">
+            , t.machine_type_code= #{machineTypeCode}
+        </if>
+        <if test="importanceLevel !=null and importanceLevel != ''">
+            , t.importance_level= #{importanceLevel}
+        </if>
+        <if test="warrantyDeadline !=null and warrantyDeadline != ''">
+            , t.warranty_deadline= #{warrantyDeadline}
+        </if>
+        <if test="seq !=null and seq != ''">
+            , t.seq= #{seq}
+        </if>
+        <if test="unit !=null and unit != ''">
+            , t.unit= #{unit}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
         where 1=1
         <if test="typeId !=null and typeId != ''">
             and t.type_id= #{typeId}
@@ -71,12 +193,33 @@
         select count(1) count
         from machine_type t
         where 1 =1
+        <if test="isEnable !=null and isEnable != ''">
+            and t.is_enable= #{isEnable}
+        </if>
+        <if test="machineTypeCode !=null and machineTypeCode != ''">
+            and t.machine_type_code= #{machineTypeCode}
+        </if>
+        <if test="importanceLevel !=null and importanceLevel != ''">
+            and t.importance_level= #{importanceLevel}
+        </if>
+        <if test="warrantyDeadline !=null and warrantyDeadline != ''">
+            and t.warranty_deadline= #{warrantyDeadline}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
+        <if test="unit !=null and unit != ''">
+            and t.unit= #{unit}
+        </if>
         <if test="machineTypeName !=null and machineTypeName != ''">
             and t.machine_type_name= #{machineTypeName}
         </if>
         <if test="typeId !=null and typeId != ''">
             and t.type_id= #{typeId}
         </if>
+        <if test="parentTypeId !=null and parentTypeId != ''">
+            and t.parent_type_id= #{parentTypeId}
+        </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>

+ 7 - 1
service-common/src/main/java/com/java110/common/dao/IMachineTypeV1ServiceDao.java

@@ -44,7 +44,13 @@ public interface IMachineTypeV1ServiceDao {
      */
     int saveMachineTypeInfo(Map info) throws DAOException;
 
-
+    /**
+     * 选择保存插入
+     * @param info 参数
+     * @return
+     * @throws DAOException
+     */
+    int saveMachineTypeInfoSelective(Map info) throws DAOException;
 
 
     /**

+ 10 - 5
service-common/src/main/java/com/java110/common/dao/impl/MachineTypeV1ServiceDaoImpl.java

@@ -42,10 +42,6 @@ public class MachineTypeV1ServiceDaoImpl extends BaseServiceDao implements IMach
 
     private static Logger logger = LoggerFactory.getLogger(MachineTypeV1ServiceDaoImpl.class);
 
-
-
-
-
     /**
      * 保存设备类型信息 到 instance
      * @param info   bId 信息
@@ -60,6 +56,15 @@ public class MachineTypeV1ServiceDaoImpl extends BaseServiceDao implements IMach
         return saveFlag;
     }
 
+    @Override
+    public int saveMachineTypeInfoSelective(Map info) throws DAOException {
+        logger.debug("保存 saveMachineTypeInfoSelective 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("machineTypeV1ServiceDaoImpl.saveMachineTypeInfoSelective",info);
+
+        return saveFlag;
+    }
+
 
     /**
      * 查询设备类型信息(instance)
@@ -91,7 +96,7 @@ public class MachineTypeV1ServiceDaoImpl extends BaseServiceDao implements IMach
         return saveFlag;
     }
 
-     /**
+    /**
      * 查询设备类型数量
      * @param info 设备类型信息
      * @return 设备类型数量

+ 6 - 6
service-common/src/main/java/com/java110/common/smo/impl/MachineTypeV1InnerServiceSMOImpl.java

@@ -48,21 +48,21 @@ public class MachineTypeV1InnerServiceSMOImpl extends BaseServiceSMO implements
 
     @Override
     public int saveMachineType(@RequestBody  MachineTypePo machineTypePo) {
-        int saveFlag = machineTypeV1ServiceDaoImpl.saveMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
+        int saveFlag = machineTypeV1ServiceDaoImpl.saveMachineTypeInfoSelective(BeanConvertUtil.beanCovertMap(machineTypePo));
         return saveFlag;
     }
 
-     @Override
+    @Override
     public int updateMachineType(@RequestBody  MachineTypePo machineTypePo) {
         int saveFlag = machineTypeV1ServiceDaoImpl.updateMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
         return saveFlag;
     }
 
-     @Override
+    @Override
     public int deleteMachineType(@RequestBody  MachineTypePo machineTypePo) {
-       machineTypePo.setStatusCd("1");
-       int saveFlag = machineTypeV1ServiceDaoImpl.updateMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
-       return saveFlag;
+        machineTypePo.setStatusCd("1");
+        int saveFlag = machineTypeV1ServiceDaoImpl.updateMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
+        return saveFlag;
     }
 
     @Override