change - 设备参数

master
yinq 8 months ago
parent c9903c34b3
commit 3d69b39c7b

@ -46,6 +46,12 @@ public class BaseDeviceLedgerController extends BaseController {
return getDataTable(list);
}
@GetMapping("/getDeviceLedgerList")
public AjaxResult getDeviceLedgerList(BaseDeviceLedger baseDeviceLedger) {
List<BaseDeviceLedger> list = baseDeviceLedgerService.selectBaseDeviceLedgerList(baseDeviceLedger);
return success(list);
}
/**
*
*/

@ -88,6 +88,8 @@ public class BaseDeviceLedger extends BaseEntity {
@Excel(name = "所属产线")
private String productLineName;
private String productLinedDevice;
/**
*
*/
@ -150,6 +152,14 @@ public class BaseDeviceLedger extends BaseEntity {
@Excel(name = "资产编号")
private String assetCode;
public String getProductLinedDevice() {
return productLinedDevice;
}
public void setProductLinedDevice(String productLinedDevice) {
this.productLinedDevice = productLinedDevice;
}
public String getAssetCode() {
return assetCode;
}

@ -22,6 +22,12 @@ public class BaseDeviceParam extends BaseEntity {
*/
private Long objId;
/**
* 线
*/
@Excel(name = "产线名称")
private String productLineName;
/**
*
*/
@ -58,6 +64,12 @@ public class BaseDeviceParam extends BaseEntity {
@Excel(name = "设备编号")
private String deviceCode;
/**
*
*/
@Excel(name = "设备名称")
private String deviceName;
/**
*
*/
@ -96,6 +108,22 @@ public class BaseDeviceParam extends BaseEntity {
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setObjId(Long objId) {
this.objId = objId;
}

@ -27,6 +27,7 @@
<result property="teamName" column="TEAM_NAME"/>
<result property="assetCode" column="ASSET_CODE"/>
<result property="productLineName" column="PRODUCT_LINE_NAME"/>
<result property="productLinedDevice" column="productLinedDevice"/>
</resultMap>
<sql id="selectBaseDeviceLedgerVo">
@ -53,7 +54,8 @@
WHEN te.TEAM_NAME IS NOT NULL THEN SUBSTR(te.TEAM_NAME, 1, LENGTH(te.TEAM_NAME) - 3) || '班组'
END TEAM_NAME,
dl.ASSET_CODE,
pl.PRODUCT_LINE_NAME
pl.PRODUCT_LINE_NAME,
CONCAT(PRODUCT_LINE_NAME, DEVICE_NAME) productLinedDevice
from base_deviceledger dl
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = dl.PRODUCT_LINE_CODE
left join BASE_TEAMMEMBERS te on te.TEAM_CODE = dl.TEAM_CODE

@ -5,106 +5,129 @@
<mapper namespace="com.aucma.base.mapper.BaseDeviceParamMapper">
<resultMap type="BaseDeviceParam" id="BaseDeviceParamResult">
<result property="objId" column="obj_id" />
<result property="paramCode" column="param_code" />
<result property="paramName" column="param_name" />
<result property="paramNetwork" column="param_network" />
<result property="paramAddress" column="param_address" />
<result property="paramType" column="param_type" />
<result property="deviceCode" column="device_code" />
<result property="readFrequency" column="read_frequency" />
<result property="isFlag" column="is_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="objId" column="obj_id"/>
<result property="paramCode" column="param_code"/>
<result property="paramName" column="param_name"/>
<result property="paramNetwork" column="param_network"/>
<result property="paramAddress" column="param_address"/>
<result property="paramType" column="param_type"/>
<result property="deviceCode" column="device_code"/>
<result property="readFrequency" column="read_frequency"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="deviceName" column="device_name"/>
<result property="productLineName" column="PRODUCT_LINE_NAME"/>
</resultMap>
<sql id="selectBaseDeviceParamVo">
select obj_id, param_code, param_name, param_network, param_address, param_type, device_code, read_frequency, is_flag, created_by, created_time, updated_by, updated_time from base_deviceparam
select dp.obj_id,
dp.param_code,
dp.param_name,
dp.param_network,
dp.param_address,
dp.param_type,
dp.device_code,
dp.read_frequency,
dp.is_flag,
dp.created_by,
dp.created_time,
dp.updated_by,
dp.updated_time,
dl.DEVICE_NAME,
pl.PRODUCT_LINE_NAME
from base_deviceparam dp
left join BASE_DEVICELEDGER dl on dl.DEVICE_CODE = dp.DEVICE_CODE
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = dl.PRODUCT_LINE_CODE
</sql>
<select id="selectBaseDeviceParamList" parameterType="BaseDeviceParam" resultMap="BaseDeviceParamResult">
<include refid="selectBaseDeviceParamVo"/>
<where>
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''"> and param_name like concat(concat('%', #{paramName}), '%')</if>
<if test="paramNetwork != null and paramNetwork != ''"> and param_network = #{paramNetwork}</if>
<if test="paramAddress != null and paramAddress != ''"> and param_address = #{paramAddress}</if>
<if test="paramType != null and paramType != ''"> and param_type = #{paramType}</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="readFrequency != null "> and read_frequency = #{readFrequency}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
<if test="paramCode != null and paramCode != ''">and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''">and param_name like concat(concat('%', #{paramName}),
'%')
</if>
<if test="paramNetwork != null and paramNetwork != ''">and param_network = #{paramNetwork}</if>
<if test="paramAddress != null and paramAddress != ''">and param_address = #{paramAddress}</if>
<if test="paramType != null and paramType != ''">and param_type = #{paramType}</if>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="readFrequency != null ">and read_frequency = #{readFrequency}</if>
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
<if test="createdTime != null ">and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectBaseDeviceParamByObjId" parameterType="Long" resultMap="BaseDeviceParamResult">
<include refid="selectBaseDeviceParamVo"/>
where obj_id = #{objId}
<include refid="selectBaseDeviceParamVo"/>
where dp.obj_id = #{objId}
</select>
<insert id="insertBaseDeviceParam" parameterType="BaseDeviceParam">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_deviceparam.NEXTVAL as objId FROM DUAL
</selectKey>
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_deviceparam.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_deviceparam
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="paramCode != null">param_code,</if>
<if test="paramName != null">param_name,</if>
<if test="paramNetwork != null">param_network,</if>
<if test="paramAddress != null">param_address,</if>
<if test="paramType != null">param_type,</if>
<if test="deviceCode != null">device_code,</if>
<if test="readFrequency != null">read_frequency,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="objId != null">obj_id,</if>
<if test="paramCode != null">param_code,</if>
<if test="paramName != null">param_name,</if>
<if test="paramNetwork != null">param_network,</if>
<if test="paramAddress != null">param_address,</if>
<if test="paramType != null">param_type,</if>
<if test="deviceCode != null">device_code,</if>
<if test="readFrequency != null">read_frequency,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="paramCode != null">#{paramCode},</if>
<if test="paramName != null">#{paramName},</if>
<if test="paramNetwork != null">#{paramNetwork},</if>
<if test="paramAddress != null">#{paramAddress},</if>
<if test="paramType != null">#{paramType},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="readFrequency != null">#{readFrequency},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="objId != null">#{objId},</if>
<if test="paramCode != null">#{paramCode},</if>
<if test="paramName != null">#{paramName},</if>
<if test="paramNetwork != null">#{paramNetwork},</if>
<if test="paramAddress != null">#{paramAddress},</if>
<if test="paramType != null">#{paramType},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="readFrequency != null">#{readFrequency},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateBaseDeviceParam" parameterType="BaseDeviceParam">
update base_deviceparam
<trim prefix="SET" suffixOverrides=",">
<if test="paramCode != null">param_code = #{paramCode},</if>
<if test="paramName != null">param_name = #{paramName},</if>
<if test="paramNetwork != null">param_network = #{paramNetwork},</if>
<if test="paramAddress != null">param_address = #{paramAddress},</if>
<if test="paramType != null">param_type = #{paramType},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="readFrequency != null">read_frequency = #{readFrequency},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="paramCode != null">param_code = #{paramCode},</if>
<if test="paramName != null">param_name = #{paramName},</if>
<if test="paramNetwork != null">param_network = #{paramNetwork},</if>
<if test="paramAddress != null">param_address = #{paramAddress},</if>
<if test="paramType != null">param_type = #{paramType},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="readFrequency != null">read_frequency = #{readFrequency},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseDeviceParamByObjId" parameterType="Long">
delete from base_deviceparam where obj_id = #{objId}
delete
from base_deviceparam
where obj_id = #{objId}
</delete>
<delete id="deleteBaseDeviceParamByObjIds" parameterType="String">

Loading…
Cancel
Save