mqtt通讯修改 增加模板 计算属性
This commit is contained in:
@@ -7,6 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="com.xinda.iot.domain.Category" id="CategoryResult">
|
||||
<result property="categoryId" column="category_id" />
|
||||
<result property="categoryName" column="category_name" />
|
||||
<result property="modelName" column="model_name" />
|
||||
<result property="standardId" column="standard_id" />
|
||||
<result property="standardName" column="standard_name" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="isSys" column="is_sys" />
|
||||
@@ -19,14 +22,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="com.xinda.iot.model.IdAndName" id="CategoryShortResult">
|
||||
<result property="id" column="category_id" />
|
||||
<result property="name" column="category_name" />
|
||||
<!-- <result property="modelName" column="model_name" />-->
|
||||
<!-- <result property="standardId" column="standard_id" />-->
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCategoryVo">
|
||||
select category_id, category_name, tenant_id, tenant_name, is_sys,order_num, create_time, update_time, remark from iot_category
|
||||
select category_id, category_name,model_name, standard_id,standard_name,tenant_id, tenant_name, is_sys,order_num, create_time, update_time, remark from iot_category
|
||||
</sql>
|
||||
|
||||
<select id="selectCategoryList" parameterType="com.xinda.iot.domain.Category" resultMap="CategoryResult">
|
||||
select c.category_id, c.category_name, c.tenant_id, c.tenant_name,
|
||||
select c.category_id, c.category_name,c.model_name,c.standard_id,c.standard_name, c.tenant_id, c.tenant_name,
|
||||
c.is_sys,c.order_num, c.create_time, c.update_time, c.remark
|
||||
from iot_category c
|
||||
<where>
|
||||
@@ -48,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and c.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="categoryName != null and categoryName != ''"> and c.category_name like concat('%', #{categoryName}, '%')</if>
|
||||
<if test="modelName != null and modelName != ''"> and c.model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="standardId != null and standardId != ''"> and (c.standard_id = #{standardId})</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and (c.tenant_id = #{tenantId} or c.is_sys = 1)</if>
|
||||
</where>
|
||||
order by order_num
|
||||
@@ -55,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectCategoryShortList" resultMap="CategoryShortResult">
|
||||
select c.category_id, c.category_name
|
||||
-- select c.category_id, CONCAT_WS('-', c.category_name, c.model_name) AS category_name
|
||||
-- ,c.model_name,c.standard_id
|
||||
from iot_category c
|
||||
<where>
|
||||
<if test="deptId != null and showSenior and !isAdmin">
|
||||
@@ -75,6 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and c.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="categoryName != null and categoryName != ''"> and c.category_name like concat('%', #{categoryName}, '%')</if>
|
||||
<if test="modelName != null and modelName != ''"> and c.model_name like concat('%', #{modelName}, '%')</if>
|
||||
<!-- <if test="standardId != null and standardId != ''"> and (m.standard_id = #{standardId})</if>-->
|
||||
<if test="tenantId != null and tenantId != ''"> and (c.tenant_id = #{tenantId} or c.is_sys = 1)</if>
|
||||
</where>
|
||||
order by order_num
|
||||
@@ -89,6 +100,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into iot_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="categoryName != null and categoryName != ''">category_name,</if>
|
||||
<if test="modelName != null and modelName != ''">model_name,</if>
|
||||
<if test="standardId != null">standard_id,</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="isSys != null">is_sys,</if>
|
||||
@@ -101,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
|
||||
<if test="modelName != null and modelName != ''">#{modelName},</if>
|
||||
<if test="standardId != null">#{standardId},</if>
|
||||
<if test="standardName != null and standardName != ''">#{standardName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="isSys != null">#{isSys},</if>
|
||||
@@ -117,6 +134,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update iot_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
|
||||
<if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
|
||||
<if test="standardId != null">standard_id = #{standardId},</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name = #{standardName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="isSys != null">is_sys = #{isSys},</if>
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
<?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.xinda.iot.mapper.StandardMapper">
|
||||
|
||||
<resultMap type="com.xinda.iot.domain.Standard" id="StandardResult">
|
||||
<result property="standardId" column="standard_id" />
|
||||
<result property="standardName" column="standard_name" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="isSys" column="is_sys" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinda.iot.model.IdAndName" id="StandardShortResult">
|
||||
<result property="id" column="standard_id" />
|
||||
<result property="name" column="standard_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStandardVo">
|
||||
select standard_id, standard_name, tenant_id, tenant_name, is_sys,order_num, create_time, update_time, remark from iot_standard
|
||||
</sql>
|
||||
|
||||
<select id="selectStandardList" parameterType="com.xinda.iot.domain.Standard" resultMap="StandardResult">
|
||||
select c.standard_id, c.standard_name, c.tenant_id, c.tenant_name,
|
||||
c.is_sys,c.order_num, c.create_time, c.update_time, c.remark
|
||||
from iot_standard c
|
||||
<where>
|
||||
<if test="deptId != null and showSenior and !isAdmin">
|
||||
and ( c.tenant_id = #{tenantId}
|
||||
or (c.tenant_id in (
|
||||
SELECT de.dept_user_id
|
||||
FROM sys_dept de
|
||||
WHERE FIND_IN_SET( de.dept_id,(
|
||||
SELECT d.ancestors
|
||||
FROM sys_dept d
|
||||
WHERE d.dept_id = #{deptId} )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="!showSenior and tenantId != null and tenantId != 0 and !isAdmin">
|
||||
and c.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="standardName != null and standardName != ''"> and c.standard_name like concat('%', #{standardName}, '%')</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and (c.tenant_id = #{tenantId} or c.is_sys = 1)</if>
|
||||
</where>
|
||||
order by order_num
|
||||
</select>
|
||||
|
||||
<select id="selectStandardShortList" resultMap="StandardShortResult">
|
||||
select c.standard_id, c.standard_name
|
||||
from iot_standard c
|
||||
<where>
|
||||
<if test="deptId != null and showSenior and !isAdmin">
|
||||
and ( c.tenant_id = #{tenantId}
|
||||
or (c.tenant_id in (
|
||||
SELECT de.dept_user_id
|
||||
FROM sys_dept de
|
||||
WHERE FIND_IN_SET( de.dept_id,(
|
||||
SELECT d.ancestors
|
||||
FROM sys_dept d
|
||||
WHERE d.dept_id = #{deptId} )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="!showSenior and tenantId != null and tenantId != 0 and !isAdmin">
|
||||
and c.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="standardName != null and standardName != ''"> and c.standard_name like concat('%', #{standardName}, '%')</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and (c.tenant_id = #{tenantId} or c.is_sys = 1)</if>
|
||||
</where>
|
||||
order by order_num
|
||||
</select>
|
||||
|
||||
<select id="selectStandardByStandardId" parameterType="Long" resultMap="StandardResult">
|
||||
<include refid="selectStandardVo"/>
|
||||
where standard_id = #{standardId}
|
||||
</select>
|
||||
|
||||
<insert id="insertStandard" parameterType="com.xinda.iot.domain.Standard" useGeneratedKeys="true" keyProperty="standardId">
|
||||
insert into iot_standard
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="standardName != null and standardName != ''">standard_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="isSys != null">is_sys,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="standardName != null and standardName != ''">#{standardName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="isSys != null">#{isSys},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStandard" parameterType="com.xinda.iot.domain.Standard">
|
||||
update iot_standard
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="standardName != null and standardName != ''">standard_name = #{standardName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="isSys != null">is_sys = #{isSys},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where standard_id = #{standardId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStandardByStandardId" parameterType="Long">
|
||||
delete from iot_standard where standard_id = #{standardId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStandardByStandardIds" parameterType="String">
|
||||
delete from iot_standard where standard_id in
|
||||
<foreach item="standardId" collection="array" open="(" separator="," close=")">
|
||||
#{standardId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="productCountInStandards" parameterType="String" resultType="int">
|
||||
select count(*) from iot_product where standard_id in
|
||||
<foreach item="standardId" collection="array" open="(" separator="," close=")">
|
||||
#{standardId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,232 @@
|
||||
<?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.xinda.iot.mapper.ThingsModelStandardMapper">
|
||||
|
||||
<resultMap type="com.xinda.iot.domain.ThingsModelStandard" id="ThingsModelStandardResult">
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="templateName" column="template_name" />
|
||||
<result property="standardId" column="standard_id" />
|
||||
<result property="standardName" column="standard_name" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="identifier" column="identifier" />
|
||||
<result property="type" column="type" />
|
||||
<result property="datatype" column="datatype" />
|
||||
<result property="specs" column="specs" />
|
||||
<result property="isSys" column="is_sys" />
|
||||
<result property="isReadonly" column="is_readonly" />
|
||||
<result property="isSharePerm" column="is_share_perm" />
|
||||
<result property="isHistory" column="is_history" />
|
||||
<result property="isMonitor" column="is_monitor" />
|
||||
<result property="isApp" column="is_app"/>
|
||||
<result property="formula" column="formula" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="modelOrder" column="model_order" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectThingsModelStandardVo">
|
||||
select template_id, template_name, standard_id, standard_name, tenant_id, tenant_name, identifier, type, datatype, specs, is_sys, is_readonly, is_chart,is_share_perm, is_history, formula, del_flag, create_by, create_time, update_by, update_time, remark, model_order from iot_things_model_standard
|
||||
</sql>
|
||||
|
||||
<select id="selectThingsModelStandardList" parameterType="com.xinda.iot.domain.ThingsModelStandard" resultMap="ThingsModelStandardResult">
|
||||
select m.template_id,m.template_name,m.standard_id,m.standard_name,
|
||||
m.tenant_id, m.tenant_name, m.identifier, m.type, m.datatype, m.specs, m.is_sys, m.is_readonly, m.is_chart, m.is_share_perm, m.is_history, m.formula, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time, m.remark, m.model_order, m.is_monitor
|
||||
from iot_things_model_standard m
|
||||
<where>
|
||||
<if test="templateName != null and templateName != ''"> and m.template_name like concat('%', #{templateName}, '%')</if>
|
||||
<if test="type != null "> and m.type = #{type}</if>
|
||||
<if test="specs != null and specs != ''"> and m.specs = #{specs}</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and (m.tenant_id = #{tenantId} or m.is_sys = 1)</if>
|
||||
<if test="standardId != null and standardId != ''"> and (m.standard_id = #{standardId})</if>
|
||||
</where>
|
||||
order by m.template_id desc, m.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectModelListByStandardId" parameterType="Long" resultMap="ThingsModelStandardResult">
|
||||
select m.template_id,m.template_name,m.standard_id,m.standard_name,
|
||||
m.tenant_id, m.tenant_name, m.identifier, m.type, m.datatype, m.specs, m.is_sys, m.is_readonly, m.is_chart, m.is_share_perm, m.is_history, m.formula, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time, m.remark, m.model_order, m.is_monitor
|
||||
from iot_things_model_standard m
|
||||
<where>
|
||||
m.standard_id = #{standardId}
|
||||
</where>
|
||||
order by m.template_id desc, m.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectThingsModelStandardByTemplateId" resultMap="ThingsModelStandardResult">
|
||||
select m.template_id,m.template_name, m.standard_id, m.standard_name,m.tenant_id, m.tenant_name, m.identifier, m.type, m.datatype, m.specs, m.is_sys, m.is_readonly, m.is_chart, m.is_share_perm, m.is_history, m.formula, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time, m.remark, m.model_order
|
||||
from iot_things_model_standard m
|
||||
where m.template_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<select id="selectThingsModelStandardByTemplateIds" resultMap="ThingsModelStandardResult">
|
||||
select m.template_id, m.template_name, m.standard_id, m.standard_name,m.tenant_id, m.tenant_name, m.identifier, m.type, m.datatype, m.specs, m.is_sys, m.is_readonly, m.is_chart, m.is_share_perm, m.is_history, m.formula, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time, m.remark, m.model_order, m.is_monitor
|
||||
from iot_things_model_standard m
|
||||
where m.template_id in
|
||||
<foreach item="templateId" collection="templateIds" open="(" separator="," close=")">
|
||||
#{templateId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertThingsModelStandard" parameterType="com.xinda.iot.domain.ThingsModelStandard" useGeneratedKeys="true" keyProperty="templateId">
|
||||
insert into iot_things_model_standard
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name,</if>
|
||||
<if test="standardId != null">standard_id,</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="identifier != null and identifier != ''">identifier,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="datatype != null and datatype != ''">datatype,</if>
|
||||
<if test="specs != null and specs != ''">specs,</if>
|
||||
<if test="isSys != null">is_sys,</if>
|
||||
<if test="isReadonly != null">is_readonly,</if>
|
||||
<if test="isChart != null">is_chart,</if>
|
||||
<if test="isSharePerm != null">is_share_perm,</if>
|
||||
<if test="isHistory != null">is_history,</if>
|
||||
<if test="isMonitor != null">is_monitor,</if>
|
||||
<if test="isApp != null">is_app,</if>
|
||||
<if test="formula != null">formula,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="modelOrder != null">model_order,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">#{templateName},</if>
|
||||
<if test="standardId != null">#{standardId},</if>
|
||||
<if test="standardName != null and standardName != ''">#{standardName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="identifier != null and identifier != ''">#{identifier},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="datatype != null and datatype != ''">#{datatype},</if>
|
||||
<if test="specs != null and specs != ''">#{specs},</if>
|
||||
<if test="isSys != null">#{isSys},</if>
|
||||
<if test="isReadonly != null">#{isReadonly},</if>
|
||||
<if test="isChart != null">#{isChart},</if>
|
||||
<if test="isSharePerm != null">#{isSharePerm},</if>
|
||||
<if test="isHistory != null">#{isHistory},</if>
|
||||
<if test="isMonitor != null">#{isMonitor},</if>
|
||||
<if test="isApp != null">#{isApp},</if>
|
||||
<if test="formula != null">#{formula},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="modelOrder != null">#{modelOrder},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateThingsModelStandard" parameterType="com.xinda.iot.domain.ThingsModelStandard">
|
||||
update iot_things_model_standard
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
|
||||
<if test="standardId != null">standard_id = #{standardId},</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name = #{standardName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="identifier != null and identifier != ''">identifier = #{identifier},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="datatype != null and datatype != ''">datatype = #{datatype},</if>
|
||||
<if test="specs != null and specs != ''">specs = #{specs},</if>
|
||||
<if test="isSys != null">is_sys = #{isSys},</if>
|
||||
<if test="isReadonly != null">is_readonly = #{isReadonly},</if>
|
||||
<if test="isChart != null">is_chart = #{isChart},</if>
|
||||
<if test="isSharePerm != null">is_share_perm = #{isSharePerm},</if>
|
||||
<if test="isHistory != null">is_history = #{isHistory},</if>
|
||||
<if test="isMonitor != null">is_Monitor = #{isMonitor},</if>
|
||||
<if test="isApp != null">is_app = #{isApp},</if>
|
||||
<if test="formula != null">formula = #{formula},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where template_id = #{templateId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteThingsModelStandardByTemplateId" parameterType="Long">
|
||||
delete from iot_things_model_standard where template_id = #{templateId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteThingsModelStandardByTemplateIds" parameterType="String">
|
||||
delete from iot_things_model_standard where template_id in
|
||||
<foreach item="templateId" collection="array" open="(" separator="," close=")">
|
||||
#{templateId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchThingsModelStandards" parameterType="java.util.List">
|
||||
INSERT INTO iot_things_model_standard (
|
||||
template_name,
|
||||
standard_id,
|
||||
standard_name,
|
||||
tenant_id,
|
||||
tenant_name,
|
||||
identifier,
|
||||
type,
|
||||
datatype,
|
||||
specs,
|
||||
is_sys,
|
||||
is_readonly,
|
||||
is_share_perm,
|
||||
is_history,
|
||||
is_monitor,
|
||||
is_app,
|
||||
formula,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
model_order
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.templateName},
|
||||
#{item.standardId},
|
||||
#{item.standardName},
|
||||
#{item.tenantId},
|
||||
#{item.tenantName},
|
||||
#{item.identifier},
|
||||
#{item.type},
|
||||
#{item.datatype},
|
||||
#{item.specs},
|
||||
#{item.isSys},
|
||||
#{item.isReadonly},
|
||||
#{item.isSharePerm},
|
||||
#{item.isHistory},
|
||||
#{item.isMonitor},
|
||||
#{item.isApp},
|
||||
#{item.formula},
|
||||
#{item.delFlag},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
#{item.remark},
|
||||
#{item.modelOrder}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user