há 5 anos atrás
pai
commit
e4777204c1

+ 18 - 132
pcbms/src/main/java/com/hssx/pcbms/entity/Goods.java

@@ -1,11 +1,13 @@
 package com.hssx.pcbms.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -13,8 +15,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-11-05
+ * @since 2019-11-13
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class Goods extends Model<Goods> {
 
     private static final long serialVersionUID=1L;
@@ -32,7 +37,7 @@ public class Goods extends Model<Goods> {
     private String name;
 
     /**
-     * 分类标签id
+     * 分类标签id,录入机柜时默认传-1
      */
     @TableField("tag_id")
     private Integer tagId;
@@ -103,141 +108,22 @@ public class Goods extends Model<Goods> {
     @TableField("suffix_code")
     private String suffixCode;
 
+    /**
+     * 资产类型 0-普通资产 1-机柜
+     */
+    @TableField("good_type")
+    private Integer goodType;
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Integer getTagId() {
-        return tagId;
-    }
-
-    public void setTagId(Integer tagId) {
-        this.tagId = tagId;
-    }
-
-    public String getModelNumber() {
-        return modelNumber;
-    }
-
-    public void setModelNumber(String modelNumber) {
-        this.modelNumber = modelNumber;
-    }
-
-    public String getUnit() {
-        return unit;
-    }
-
-    public void setUnit(String unit) {
-        this.unit = unit;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public void setAddress(String address) {
-        this.address = address;
-    }
-
-    public String getFactory() {
-        return factory;
-    }
-
-    public void setFactory(String factory) {
-        this.factory = factory;
-    }
-
-    public String getPic() {
-        return pic;
-    }
-
-    public void setPic(String pic) {
-        this.pic = pic;
-    }
-
-    public Integer getServiceLife() {
-        return serviceLife;
-    }
-
-    public void setServiceLife(Integer serviceLife) {
-        this.serviceLife = serviceLife;
-    }
-
-    public String getNextIndate() {
-        return nextIndate;
-    }
-
-    public void setNextIndate(String nextIndate) {
-        this.nextIndate = nextIndate;
-    }
-
-    public Integer getIsDelete() {
-        return isDelete;
-    }
-
-    public void setIsDelete(Integer isDelete) {
-        this.isDelete = isDelete;
-    }
-
-    public Integer getCreatorId() {
-        return creatorId;
-    }
-
-    public void setCreatorId(Integer creatorId) {
-        this.creatorId = creatorId;
-    }
-
-    public String getDivisionCode() {
-        return divisionCode;
-    }
-
-    public void setDivisionCode(String divisionCode) {
-        this.divisionCode = divisionCode;
-    }
-
-    public String getSuffixCode() {
-        return suffixCode;
-    }
+    /**
+     * 机柜id(只用于录入,没有与其他表关联)
+     */
+    @TableField("rack_id")
+    private String rackId;
 
-    public void setSuffixCode(String suffixCode) {
-        this.suffixCode = suffixCode;
-    }
 
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "Goods{" +
-        "id=" + id +
-        ", name=" + name +
-        ", tagId=" + tagId +
-        ", modelNumber=" + modelNumber +
-        ", unit=" + unit +
-        ", address=" + address +
-        ", factory=" + factory +
-        ", pic=" + pic +
-        ", serviceLife=" + serviceLife +
-        ", nextIndate=" + nextIndate +
-        ", isDelete=" + isDelete +
-        ", creatorId=" + creatorId +
-        ", divisionCode=" + divisionCode +
-        ", suffixCode=" + suffixCode +
-        "}";
-    }
 }

+ 0 - 1
pcbms/src/main/java/com/hssx/pcbms/entity/vo/GoodsVO.java

@@ -1,6 +1,5 @@
 package com.hssx.pcbms.entity.vo;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.hssx.pcbms.entity.Goods;
 import com.hssx.pcbms.entity.GoodsNo;
 import lombok.Data;

+ 1 - 1
pcbms/src/main/java/com/hssx/pcbms/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("task_file");
+        strategy.setInclude("goods");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 7 - 2
pcbms/src/main/resources/mapper/GoodsMapper.xml

@@ -18,11 +18,13 @@
         <result column="creator_id" property="creatorId" />
         <result column="division_code" property="divisionCode" />
         <result column="suffix_code" property="suffixCode" />
+        <result column="good_type" property="goodType" />
+        <result column="rack_id" property="rackId" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, name, tag_id, model_number, unit, address, factory, pic, service_life, next_indate, is_delete, creator_id, division_code, suffix_code
+        id, name, tag_id, model_number, unit, address, factory, pic, service_life, next_indate, is_delete, creator_id, division_code, suffix_code, good_type, rack_id
     </sql>
 
     <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.GoodsVO">
@@ -81,6 +83,8 @@
         <result column="next_indate" property="nextIndate"/>
         <result column="divisioncode" property="divisionCode"/>
         <result column="suffixcode" property="suffixCode"/>
+        <result column="good_type" property="goodType" />
+        <result column="rack_id" property="rackId" />
         <collection property="goodsNosVO" ofType="com.hssx.pcbms.entity.vo.GoodsNoVO">
             <id column="nid" property="id"/>
             <result column="model_no" property="modelNo"/>
@@ -122,7 +126,7 @@
     <select id="getDetail" resultMap="BaseResultMapDetail">
         select
         g.id, g.name, g.tag_id, g.model_number, g.unit,g.address, g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,g.suffix_code suffixcode,
-        g.is_delete,gn.id nid,
+        g.is_delete,gn.id nid,g.good_type,g.rack_id,
         gn.model_no, gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id, gn.user_id,u.name username,gn.is_maintain,u.phone
         from
         goods g
@@ -155,4 +159,5 @@
             limit #{start,jdbcType=INTEGER} ,#{pageSize,jdbcType=INTEGER}
         </if>
     </select>
+
 </mapper>

+ 2 - 2
pcbms/src/main/resources/mapper/TaskMapper.xml

@@ -70,7 +70,7 @@
                 and t.name like concat('%',#{taskVO.keyName},'%')
             </if>
             <if test="taskVO.startTime != null and taskVO.startTime != ''and taskVO.endTime != null and taskVO.endTime != ''">
-                and t.plan_time between #{taskVO.startTime} and #{taskVO.endTime}
+                and DATE_FORMAT(t.indate,'%Y-%m-%d') between #{taskVO.startTime} and #{taskVO.endTime}
             </if>
             <if test="taskVO.uid != null">
                 and t.publish_id =#{taskVO.uid}
@@ -106,7 +106,7 @@
                 and t.name like concat('%',#{taskVO.keyName},'%')
             </if>
             <if test="taskVO.startTime != null and taskVO.startTime != ''and taskVO.endTime != null and taskVO.endTime != ''">
-                and t.plan_time between #{taskVO.startTime} and #{taskVO.endTime}
+                and DATE_FORMAT(t.indate,'%Y-%m-%d') between #{taskVO.startTime} and #{taskVO.endTime}
             </if>
             <if test="taskVO.tagId != null and taskVO.tagId != ''">
                 and t.tag_id = #{taskVO.tagId}