基础信息 设备加字段 + 设备看板完好设备比问题

master
A0010407 1 year ago
parent a69e7c1ebc
commit b27e18f403

@ -79,7 +79,7 @@
<select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation"> <select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
SELECT SELECT
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment, SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment,
SUM(CASE WHEN equipment_status = '0' or equipment_status = '0' THEN 1 Else 0 END) AS faultEquipment, SUM(CASE WHEN equipment_status = '0' or equipment_status = '2' THEN 1 Else 0 END) AS faultEquipment,
COUNT(*) AS totalEquipment, COUNT(*) AS totalEquipment,
CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate
FROM base_equipment FROM base_equipment

@ -215,6 +215,26 @@ public class BaseEquipment extends BaseEntity {
@Excel(name = "设备类别") @Excel(name = "设备类别")
private String equipmentCategory; private String equipmentCategory;
/** 资产分类名称 */
@Excel(name = "资产分类名称")
private String assetClassificationName;
/** 资产描述 */
@Excel(name = "资产描述")
private String assetDescription;
/** 数量 */
@Excel(name = "数量")
private String equipmentNumber;
/** 存货号 */
@Excel(name = "存货号")
private String inventoryNumber;
/** 计量单位 */
@Excel(name = "计量单位")
private String unitMeasurement;
private String imageFileList; private String imageFileList;
private String barCodeFileList; private String barCodeFileList;
@ -663,6 +683,46 @@ public class BaseEquipment extends BaseEntity {
return equipmentCategory; return equipmentCategory;
} }
//资产分类名称
public void setAssetClassificationName(String assetClassificationName) {
this.assetClassificationName = assetClassificationName;
}
public String getAssetClassificationName() {
return assetClassificationName;
}
//资产描述
public void setAssetDescription(String assetDescription) {
this.assetDescription = assetDescription;
}
public String getAssetDescription() {
return assetDescription;
}
//数量
public void setEquipmentNumber(String equipmentNumber) {
this.equipmentNumber = equipmentNumber;
}
public String getEquipmentNumber() {
return equipmentNumber;
}
//存货号
public void setInventoryNumber(String inventoryNumber) {
this.inventoryNumber = inventoryNumber;
}
public String getInventoryNumber() {
return inventoryNumber;
}
//计量单位
public void setUnitMeasurement(String unitMeasurement) {
this.unitMeasurement = unitMeasurement;
}
public String getUnitMeasurement() {
return unitMeasurement;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -49,6 +49,12 @@
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<result property="equipmentStatus" column="equipment_status" /> <result property="equipmentStatus" column="equipment_status" />
<result property="equipmentCategory" column="equipment_category" /> <result property="equipmentCategory" column="equipment_category" />
<result property="assetClassificationName" column="asset_classification_name" />
<result property="assetDescription" column="asset_description" />
<result property="equipmentNumber" column="equipment_number" />
<result property="inventoryNumber" column="inventory_number" />
<result property="unitMeasurement" column="unit_measurement" />
</resultMap> </resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult"> <resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -164,7 +170,12 @@
equipment_head, equipment_head,
factory_code, factory_code,
equipment_status, equipment_status,
equipment_category equipment_category,
asset_classification_name,
asset_description,
equipment_number,
inventory_number,
unit_measurement
from base_equipment from base_equipment
</sql> </sql>
@ -208,6 +219,11 @@
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if> <if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if>
<if test="equipmentCategory != null and equipmentCategory != ''"> and equipment_category = #{equipmentCategory}</if> <if test="equipmentCategory != null and equipmentCategory != ''"> and equipment_category = #{equipmentCategory}</if>
<if test="assetClassificationName != null and assetClassificationName != ''"> and asset_classification_name = #{assetClassificationName}</if>
<if test="assetDescription != null and assetDescription != ''"> and asset_description = #{assetDescription}</if>
<if test="equipmentNumber != null and equipmentNumber != ''"> and equipment_number = #{equipmentNumber}</if>
<if test="inventoryNumber != null and inventoryNumber != ''"> and inventory_number = #{inventoryNumber}</if>
<if test="unitMeasurement != null and unitMeasurement != ''"> and unit_measurement = #{unitMeasurement}</if>
and del_flag ='0' and del_flag ='0'
</where> </where>
</select> </select>
@ -263,6 +279,11 @@
<if test="factoryCode != null">factory_code,</if> <if test="factoryCode != null">factory_code,</if>
<if test="equipmentStatus != null">equipment_status,</if> <if test="equipmentStatus != null">equipment_status,</if>
<if test="equipmentCategory != null">equipment_category,</if> <if test="equipmentCategory != null">equipment_category,</if>
<if test="assetClassificationName != null">asset_classification_name,</if>
<if test="assetDescription != null">asset_description,</if>
<if test="equipmentNumber != null">equipment_number,</if>
<if test="inventoryNumber != null">inventory_number,</if>
<if test="unitMeasurement != null">unit_measurement,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if> <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -307,6 +328,11 @@
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">#{equipmentStatus},</if> <if test="equipmentStatus != null">#{equipmentStatus},</if>
<if test="equipmentCategory != null">#{equipmentCategory},</if> <if test="equipmentCategory != null">#{equipmentCategory},</if>
<if test="assetClassificationName != null and assetClassificationName != ''"> #{assetClassificationName},</if>
<if test="assetDescription != null and assetDescription != ''"> #{assetDescription},</if>
<if test="equipmentNumber != null and equipmentNumber != ''"> #{equipmentNumber},</if>
<if test="inventoryNumber != null and inventoryNumber != ''"> #{inventoryNumber},</if>
<if test="unitMeasurement != null and unitMeasurement != ''"> #{unitMeasurement},</if>
</trim> </trim>
</insert> </insert>
@ -355,6 +381,11 @@
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if> <if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
<if test="equipmentCategory != null">equipment_category = #{equipmentCategory},</if> <if test="equipmentCategory != null">equipment_category = #{equipmentCategory},</if>
<if test="assetClassificationName != null and assetClassificationName != ''"> asset_classification_name = #{assetClassificationName},</if>
<if test="assetDescription != null and assetDescription != ''"> asset_description = #{assetDescription},</if>
<if test="equipmentNumber != null and equipmentNumber != ''"> equipment_number = #{equipmentNumber},</if>
<if test="inventoryNumber != null and inventoryNumber != ''"> inventory_number = #{inventoryNumber},</if>
<if test="unitMeasurement != null and unitMeasurement != ''"> unit_measurement = #{unitMeasurement},</if>
</trim> </trim>
where equipment_id = #{equipmentId} where equipment_id = #{equipmentId}
</update> </update>

Loading…
Cancel
Save