2022-10-18 17:32:45 +08:00
|
|
|
<?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.rzyc.mapper.EntDeviceMapper">
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.EntDevice">
|
|
|
|
|
<id column="device_id" property="deviceId" />
|
|
|
|
|
<result column="name" property="name" />
|
|
|
|
|
<result column="number" property="number" />
|
|
|
|
|
<result column="model_num" property="modelNum" />
|
|
|
|
|
<result column="model_state" property="modelState" />
|
|
|
|
|
<result column="buy_time" property="buyTime" />
|
|
|
|
|
<result column="type_id" property="typeId" />
|
|
|
|
|
<result column="type_path" property="typePath" />
|
|
|
|
|
<result column="enterprise_id" property="enterpriseId" />
|
|
|
|
|
<result column="qr_code" property="qrCode" />
|
|
|
|
|
<result column="del_state" property="delState" />
|
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
|
<result column="create_by" property="createBy" />
|
|
|
|
|
<result column="modify_time" property="modifyTime" />
|
|
|
|
|
<result column="modify_by" property="modifyBy" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
device_id, name, number, model_num, model_state, buy_time, type_id, type_path, enterprise_id, qr_code, del_state, create_time, create_by, modify_time, modify_by
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEntEquipmentList" resultMap="BaseResultMap">
|
|
|
|
|
select * from ent_device where enterprise_id = #{enterpriseId}
|
|
|
|
|
<if test="null != typeId and '' != typeId">
|
|
|
|
|
and type_id = #{typeId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="entEquipmentStatistic" resultMap="BaseResultMap">
|
2022-10-31 17:33:15 +08:00
|
|
|
select count(edmr.record_id) as entDeviceMaintenanceRecord ,count(eir.ins_record_id) as entInsRecord,
|
|
|
|
|
count(err.repair_record_id)as entRepairRecord,count(eisr.inspection_id) as entInspectionRecord
|
|
|
|
|
from ent_device ed
|
|
|
|
|
left join ent_device_maintenance_record edmr on ed.device_id = edmr.device_id
|
|
|
|
|
left join ent_ins_record eir on ed.device_id = eir.device_id
|
|
|
|
|
left join ent_repair_record err on ed.device_id = err.device_id
|
|
|
|
|
left join ent_inspection_record eisr on ed.device_id = eisr.inspection_device_id
|
|
|
|
|
where ed.device_id = #{deviceId}
|
|
|
|
|
<if test="null != enterpriseId and '' != enterpriseId ">
|
|
|
|
|
and ed.enterprise_id = #{enterpriseId}
|
|
|
|
|
</if>
|
2022-10-18 17:32:45 +08:00
|
|
|
</select>
|
2022-10-20 17:30:09 +08:00
|
|
|
|
|
|
|
|
<update id="updateEntDevice" parameterType="com.rzyc.model.EntDevice">
|
|
|
|
|
update ent_device set type_path = #{entDevice.typePath},enterprise_id = #{entDevice.enterpriseId},qr_code = #{entDevice.qrCode},installation_time = #{entDevice.installationTime},
|
|
|
|
|
enable_time = #{entDevice.enableTime},scrap_time = #{entDevice.scrapTime},factory_number = #{entDevice.factoryNumber},longitude = #{entDevice.longitude},latitude = #{entDevice.latitude},
|
|
|
|
|
eq_charge_person = #{entDevice.eqChargePerson},manufacturer = #{entDevice.manufacturer},specific_location = #{entDevice.specificLocation},modify_by = #{entDevice.modifyBy},modify_time = #{entDevice.modifyTime}
|
|
|
|
|
where device_id = #{entDevice.deviceId}
|
|
|
|
|
</update>
|
2022-10-18 17:32:45 +08:00
|
|
|
</mapper>
|