add new mapper.xml

This commit is contained in:
wty 2023-02-27 11:22:09 +08:00
parent d13d68d669
commit e5a974efc2
2 changed files with 261 additions and 0 deletions

View File

@ -0,0 +1,153 @@
<?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.aiit.xiuos.dao.mappers.AlarmInfoMapper">
<resultMap id="BaseResultMap" type="com.aiit.xiuos.model.AlarmInfo">
<constructor>
<idArg column="device_no" javaType="java.lang.String" jdbcType="VARCHAR" />
<idArg column="alarm_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<idArg column="alarm_level" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="alarm_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="device_type" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="alarm_status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="alarm_res" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="org" javaType="java.lang.String" jdbcType="VARCHAR" />
</constructor>
</resultMap>
<sql id="Base_Column_List">
device_no, alarm_name, alarm_level, alarm_time, device_type, alarm_status, alarm_res,
org
</sql>
<select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from alarm_info
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="map">
delete from alarm_info
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.aiit.xiuos.model.AlarmInfo">
insert into alarm_info (device_no, alarm_name, alarm_level,
alarm_time, device_type, alarm_status,
alarm_res, org)
values (#{deviceNo,jdbcType=VARCHAR}, #{alarmName,jdbcType=VARCHAR}, #{alarmLevel,jdbcType=INTEGER},
#{alarmTime,jdbcType=TIMESTAMP}, #{deviceType,jdbcType=VARCHAR}, #{alarmStatus,jdbcType=INTEGER},
#{alarmRes,jdbcType=VARCHAR}, #{org,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.aiit.xiuos.model.AlarmInfo">
insert into alarm_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceNo != null">
device_no,
</if>
<if test="alarmName != null">
alarm_name,
</if>
<if test="alarmLevel != null">
alarm_level,
</if>
<if test="alarmTime != null">
alarm_time,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="alarmStatus != null">
alarm_status,
</if>
<if test="alarmRes != null">
alarm_res,
</if>
<if test="org != null">
org,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceNo != null">
#{deviceNo,jdbcType=VARCHAR},
</if>
<if test="alarmName != null">
#{alarmName,jdbcType=VARCHAR},
</if>
<if test="alarmLevel != null">
#{alarmLevel,jdbcType=INTEGER},
</if>
<if test="alarmTime != null">
#{alarmTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceType != null">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="alarmStatus != null">
#{alarmStatus,jdbcType=INTEGER},
</if>
<if test="alarmRes != null">
#{alarmRes,jdbcType=VARCHAR},
</if>
<if test="org != null">
#{org,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.aiit.xiuos.model.AlarmInfo">
update alarm_info
<set>
<if test="alarmTime != null">
alarm_time = #{alarmTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="alarmStatus != null">
alarm_status = #{alarmStatus,jdbcType=INTEGER},
</if>
<if test="alarmRes != null">
alarm_res = #{alarmRes,jdbcType=VARCHAR},
</if>
<if test="org != null">
org = #{org,jdbcType=VARCHAR},
</if>
</set>
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.aiit.xiuos.model.AlarmInfo">
update alarm_info
set alarm_time = #{alarmTime,jdbcType=TIMESTAMP},
device_type = #{deviceType,jdbcType=VARCHAR},
alarm_status = #{alarmStatus,jdbcType=INTEGER},
alarm_res = #{alarmRes,jdbcType=VARCHAR},
org = #{org,jdbcType=VARCHAR}
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</update>
<select id="selectByParam" parameterType="com.aiit.xiuos.model.AlarmInfo" resultMap="BaseResultMap">
select * from alarm_info where org= #{org,jdbcType=VARCHAR}
<if test="deviceNo != null">
and device_no = #{deviceNo,jdbcType=VARCHAR}
</if>
<if test="alarmName != null">
and alarm_name = #{alarmName,jdbcType=VARCHAR}
</if>
<if test="alarmTime != null">
and alarm_time = #{alarmTime,jdbcType=TIMESTAMP}
</if>
<if test="deviceType != null">
and device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="alarmStatus != null">
and alarm_status = #{alarmStatus,jdbcType=INTEGER}
</if>
<if test="alarmLevel != null">
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</if>
order by alarm_time desc;
</select>
</mapper>

View File

@ -0,0 +1,108 @@
<?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.aiit.xiuos.dao.mappers.FzDeviceInfoMapper">
<resultMap id="BaseResultMap" type="com.aiit.xiuos.model.FzDeviceInfo">
<constructor>
<idArg column="fz_device_no" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fz_device_status" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fz_device_type" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fz_device_user" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fz_outtime" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fz_remark" javaType="java.lang.String" jdbcType="VARCHAR" />
</constructor>
</resultMap>
<sql id="Base_Column_List">
fz_device_no, fz_device_status, fz_device_type, fz_device_user, fz_outtime, fz_remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from fz_device_info
where fz_device_no = #{fzDeviceNo,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from fz_device_info
where fz_device_no = #{fzDeviceNo,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.aiit.xiuos.model.FzDeviceInfo">
insert into fz_device_info (fz_device_no, fz_device_status, fz_device_type,
fz_device_user, fz_outtime, fz_remark
)
values (#{fzDeviceNo,jdbcType=VARCHAR}, #{fzDeviceStatus,jdbcType=VARCHAR}, #{fzDeviceType,jdbcType=VARCHAR},
#{fzDeviceUser,jdbcType=VARCHAR}, #{fzOuttime,jdbcType=VARCHAR}, #{fzRemark,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.aiit.xiuos.model.FzDeviceInfo">
insert into fz_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fzDeviceNo != null">
fz_device_no,
</if>
<if test="fzDeviceStatus != null">
fz_device_status,
</if>
<if test="fzDeviceType != null">
fz_device_type,
</if>
<if test="fzDeviceUser != null">
fz_device_user,
</if>
<if test="fzOuttime != null">
fz_outtime,
</if>
<if test="fzRemark != null">
fz_remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fzDeviceNo != null">
#{fzDeviceNo,jdbcType=VARCHAR},
</if>
<if test="fzDeviceStatus != null">
#{fzDeviceStatus,jdbcType=VARCHAR},
</if>
<if test="fzDeviceType != null">
#{fzDeviceType,jdbcType=VARCHAR},
</if>
<if test="fzDeviceUser != null">
#{fzDeviceUser,jdbcType=VARCHAR},
</if>
<if test="fzOuttime != null">
#{fzOuttime,jdbcType=VARCHAR},
</if>
<if test="fzRemark != null">
#{fzRemark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.aiit.xiuos.model.FzDeviceInfo">
update fz_device_info
<set>
<if test="fzDeviceStatus != null">
fz_device_status = #{fzDeviceStatus,jdbcType=VARCHAR},
</if>
<if test="fzDeviceType != null">
fz_device_type = #{fzDeviceType,jdbcType=VARCHAR},
</if>
<if test="fzDeviceUser != null">
fz_device_user = #{fzDeviceUser,jdbcType=VARCHAR},
</if>
<if test="fzOuttime != null">
fz_outtime = #{fzOuttime,jdbcType=VARCHAR},
</if>
<if test="fzRemark != null">
fz_remark = #{fzRemark,jdbcType=VARCHAR},
</if>
</set>
where fz_device_no = #{fzDeviceNo,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.aiit.xiuos.model.FzDeviceInfo">
update fz_device_info
set fz_device_status = #{fzDeviceStatus,jdbcType=VARCHAR},
fz_device_type = #{fzDeviceType,jdbcType=VARCHAR},
fz_device_user = #{fzDeviceUser,jdbcType=VARCHAR},
fz_outtime = #{fzOuttime,jdbcType=VARCHAR},
fz_remark = #{fzRemark,jdbcType=VARCHAR}
where fz_device_no = #{fzDeviceNo,jdbcType=VARCHAR}
</update>
</mapper>