<?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.iailab.module.device.dao.DeviceRunStateDao">
|
|
<resultMap type="com.iailab.module.device.entity.DeviceRunStateEntity" id="deviceRunStateMap">
|
<result property="id" column="id"/>
|
<result property="totalCount" column="total_count"/>
|
<result property="runCount" column="run_count"/>
|
<result property="haltCount" column="halt_count"/>
|
<result property="offlineCount" column="offline_count"/>
|
<result property="creatorDate" column="creator_date"/>
|
</resultMap>
|
<insert id="insertRunState" parameterType="map">
|
insert into `t_device_run_state` (`total_count`, `run_count`, `halt_count`, `offline_count`, `creator_date`)
|
VALUES (#{total_count}, #{run_count}, #{halt_count}, #{offline_count}, SYSDATE())
|
</insert>
|
<update id="updateRunState" parameterType="map">
|
update t_device_run_state
|
set total_count = #{total_count},
|
run_count = #{run_count},
|
halt_count = #{halt_count},
|
offline_count = #{offline_count},
|
creator_date = SYSDATE()
|
where id = #{id}
|
</update>
|
<select id="getId" resultType="java.lang.Integer">
|
select IF(count(1), id, 0)
|
from t_device_run_state group by id
|
</select>
|
|
|
</mapper>
|