<?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.gk.hotwork.Mapper.MajorEquipmentDataMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.MajorEquipmentData" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="valid_flag" property="validFlag" jdbcType="TINYINT" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
<result column="equipment_id" property="equipmentId" jdbcType="BIGINT" />
|
<result column="range_lower_limit" property="rangeLowerLimit" jdbcType="FLOAT" />
|
<result column="range_upper_limit" property="rangeUpperLimit" jdbcType="FLOAT" />
|
<result column="high_high_liquid_alarm" property="highHighLiquidAlarm" jdbcType="FLOAT" />
|
<result column="high_liquid_alarm" property="highLiquidAlarm" jdbcType="FLOAT" />
|
<result column="low_liquid_alarm" property="lowLiquidAlarm" jdbcType="FLOAT" />
|
<result column="low_low_liquid_alarm" property="lowLowLiquidAlarm" jdbcType="FLOAT" />
|
<result column="monitoring_time" property="monitoringTime" jdbcType="TIMESTAMP" />
|
|
<result column="equipment_name" property="equipmentName" jdbcType="VARCHAR" />
|
<result column="equipment_serial_number" property="equipmentSerialNumber" jdbcType="VARCHAR" />
|
|
</resultMap>
|
<select id="selectPages" resultMap="BaseResultMap">
|
select a.*,
|
b.name equipment_name,
|
b.serial_number equipment_serial_number
|
from major_equipment_data as a
|
left join major_equipment as b on a.equipment_id = b.id
|
where a.valid_flag = 1 and b.valid_flag = 1
|
<if test="params.equipmentName != null and params.equipmentName != ''">
|
and b.name like concat("%",#{params.equipmentName},"%")
|
</if>
|
order by a.create_time desc
|
</select>
|
|
<update id="deleteByEquipmentId" >
|
update major_equipment_data set valid_flag=0 , update_time=#{updateTime}, update_by=#{updateBy} where equipment_id=#{id}
|
</update>
|
|
</mapper>
|