|
@@ -0,0 +1,102 @@
|
|
|
+<?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.bz.smart_city.dao.WarningRuleMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.WarningRule">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table sc_warning_rule-->
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="device_id" property="deviceId" />
|
|
|
+ <result column="warning_type" property="warningType" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="create_by" property="createBy" />
|
|
|
+ <result column="date_create" property="dateCreate" />
|
|
|
+ <result column="update_by" property="updateBy" />
|
|
|
+ <result column="date_update" property="dateUpdate" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id, device_id, warning_type, `status`, create_by, date_create, update_by, date_update
|
|
|
+ </sql>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bz.smart_city.entity.WarningRule" useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_warning_rule
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="warningType != null">
|
|
|
+ warning_type,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status`,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId},
|
|
|
+ </if>
|
|
|
+ <if test="warningType != null">
|
|
|
+ #{warningType},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ #{dateCreate},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ #{dateUpdate},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.bz.smart_city.entity.WarningRule">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update sc_warning_rule
|
|
|
+ <set>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id = #{deviceId},
|
|
|
+ </if>
|
|
|
+ <if test="warningType != null">
|
|
|
+ warning_type = #{warningType},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create = #{dateCreate},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update = #{dateUpdate},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="BaseResultMap">
|
|
|
+ select <include refid="Base_Column_List"/> from sc_warning_rule where status = 1 and warning_type = #{type}
|
|
|
+ </select>
|
|
|
+</mapper>
|