|
|
|
|
<?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.dongjian.dashboard.back.dao.auto.DeviceGroupMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.dongjian.dashboard.back.model.DeviceGroup">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
|
|
|
<result column="company_id" jdbcType="BIGINT" property="companyId" />
|
|
|
|
|
<result column="building_id" jdbcType="BIGINT" property="buildingId" />
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
|
|
|
<result column="flag" jdbcType="INTEGER" property="flag" />
|
|
|
|
|
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
|
|
|
|
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
<where>
|
|
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
|
|
<if test="criteria.valid">
|
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
|
</choose>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
<where>
|
|
|
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
|
<if test="criteria.valid">
|
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
|
</choose>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
id, company_id, building_id, `name`, remark, flag, created_by, created_at
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.DeviceGroupExample" resultMap="BaseResultMap">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
'true' as QUERYID,
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from dashboard_device_group
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from dashboard_device_group
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
delete from dashboard_device_group
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="deleteByExample" parameterType="com.dongjian.dashboard.back.model.DeviceGroupExample">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
delete from dashboard_device_group
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" parameterType="com.dongjian.dashboard.back.model.DeviceGroup">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
|
|
|
|
SELECT LAST_INSERT_ID()
|
|
|
|
|
</selectKey>
|
|
|
|
|
insert into dashboard_device_group (company_id, building_id, `name`,
|
|
|
|
|
remark, flag, created_by,
|
|
|
|
|
created_at)
|
|
|
|
|
values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
|
|
|
|
#{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT},
|
|
|
|
|
#{createdAt,jdbcType=BIGINT})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.DeviceGroup">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
|
|
|
|
SELECT LAST_INSERT_ID()
|
|
|
|
|
</selectKey>
|
|
|
|
|
insert into dashboard_device_group
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
company_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="buildingId != null">
|
|
|
|
|
building_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="name != null">
|
|
|
|
|
`name`,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="remark != null">
|
|
|
|
|
remark,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="flag != null">
|
|
|
|
|
flag,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdBy != null">
|
|
|
|
|
created_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdAt != null">
|
|
|
|
|
created_at,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
#{companyId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="buildingId != null">
|
|
|
|
|
#{buildingId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="name != null">
|
|
|
|
|
#{name,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="remark != null">
|
|
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="flag != null">
|
|
|
|
|
#{flag,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdBy != null">
|
|
|
|
|
#{createdBy,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdAt != null">
|
|
|
|
|
#{createdAt,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="countByExample" parameterType="com.dongjian.dashboard.back.model.DeviceGroupExample" resultType="java.lang.Long">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
select count(*) from dashboard_device_group
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
update dashboard_device_group
|
|
|
|
|
<set>
|
|
|
|
|
<if test="record.id != null">
|
|
|
|
|
id = #{record.id,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.companyId != null">
|
|
|
|
|
company_id = #{record.companyId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.buildingId != null">
|
|
|
|
|
building_id = #{record.buildingId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.name != null">
|
|
|
|
|
`name` = #{record.name,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.remark != null">
|
|
|
|
|
remark = #{record.remark,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.flag != null">
|
|
|
|
|
flag = #{record.flag,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.createdBy != null">
|
|
|
|
|
created_by = #{record.createdBy,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.createdAt != null">
|
|
|
|
|
created_at = #{record.createdAt,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
update dashboard_device_group
|
|
|
|
|
set id = #{record.id,jdbcType=BIGINT},
|
|
|
|
|
company_id = #{record.companyId,jdbcType=BIGINT},
|
|
|
|
|
building_id = #{record.buildingId,jdbcType=BIGINT},
|
|
|
|
|
`name` = #{record.name,jdbcType=VARCHAR},
|
|
|
|
|
remark = #{record.remark,jdbcType=VARCHAR},
|
|
|
|
|
flag = #{record.flag,jdbcType=INTEGER},
|
|
|
|
|
created_by = #{record.createdBy,jdbcType=BIGINT},
|
|
|
|
|
created_at = #{record.createdAt,jdbcType=BIGINT}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.dongjian.dashboard.back.model.DeviceGroup">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
update dashboard_device_group
|
|
|
|
|
<set>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
company_id = #{companyId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="buildingId != null">
|
|
|
|
|
building_id = #{buildingId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="name != null">
|
|
|
|
|
`name` = #{name,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="remark != null">
|
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="flag != null">
|
|
|
|
|
flag = #{flag,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdBy != null">
|
|
|
|
|
created_by = #{createdBy,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdAt != null">
|
|
|
|
|
created_at = #{createdAt,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.dongjian.dashboard.back.model.DeviceGroup">
|
|
|
|
|
<!--
|
|
|
|
|
WARNING - @mbg.generated
|
|
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
-->
|
|
|
|
|
update dashboard_device_group
|
|
|
|
|
set company_id = #{companyId,jdbcType=BIGINT},
|
|
|
|
|
building_id = #{buildingId,jdbcType=BIGINT},
|
|
|
|
|
`name` = #{name,jdbcType=VARCHAR},
|
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
|
flag = #{flag,jdbcType=INTEGER},
|
|
|
|
|
created_by = #{createdBy,jdbcType=BIGINT},
|
|
|
|
|
created_at = #{createdAt,jdbcType=BIGINT}
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</update>
|
|
|
|
|
</mapper>
|