|
@@ -1,61 +1,94 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.jjt.rz.mapper.TwinDeviceTypeMapper">
|
|
|
|
|
|
<resultMap type="TwinDeviceType" id="TwinDeviceTypeResult">
|
|
|
- <result property="typeId" column="TYPE_ID" />
|
|
|
- <result property="typeGroup" column="TYPE_GROUP" />
|
|
|
- <result property="typeName" column="TYPE_NAME" />
|
|
|
- <result property="typeMatch" column="TYPE_MATCH" />
|
|
|
- <result property="createdBy" column="CREATED_BY" />
|
|
|
- <result property="createdTime" column="CREATED_TIME" />
|
|
|
- <result property="updatedBy" column="UPDATED_BY" />
|
|
|
- <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
+ <result property="typeId" column="TYPE_ID"/>
|
|
|
+ <result property="typeGroup" column="TYPE_GROUP"/>
|
|
|
+ <result property="typeName" column="TYPE_NAME"/>
|
|
|
+ <result property="typeMatch" column="TYPE_MATCH"/>
|
|
|
+ <result property="createdBy" column="CREATED_BY"/>
|
|
|
+ <result property="createdTime" column="CREATED_TIME"/>
|
|
|
+ <result property="updatedBy" column="UPDATED_BY"/>
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="TwinDeviceTypeTwinDeviceTypeDataResult" type="TwinDeviceType" extends="TwinDeviceTypeResult">
|
|
|
- <collection property="twinDeviceTypeDataList" ofType="TwinDeviceTypeData" column="TYPE_ID" select="selectTwinDeviceTypeDataList" />
|
|
|
+ <collection property="twinDeviceTypeDataList" ofType="TwinDeviceTypeData" column="TYPE_ID"
|
|
|
+ select="selectTwinDeviceTypeDataList"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="TwinDeviceTypeData" id="TwinDeviceTypeDataResult">
|
|
|
- <result property="dataId" column="DATA_ID" />
|
|
|
- <result property="typeId" column="TYPE_ID" />
|
|
|
- <result property="dataName" column="DATA_NAME" />
|
|
|
- <result property="dataCode" column="DATA_CODE" />
|
|
|
- <result property="dataType" column="DATA_TYPE" />
|
|
|
- <result property="createdBy" column="CREATED_BY" />
|
|
|
- <result property="createdTime" column="CREATED_TIME" />
|
|
|
- <result property="updatedBy" column="UPDATED_BY" />
|
|
|
- <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
+ <result property="dataId" column="DATA_ID"/>
|
|
|
+ <result property="typeId" column="TYPE_ID"/>
|
|
|
+ <result property="dataName" column="DATA_NAME"/>
|
|
|
+ <result property="dataSort" column="DATA_SORT"/>
|
|
|
+ <result property="dataCode" column="DATA_CODE"/>
|
|
|
+ <result property="mesCode" column="MES_CODE"/>
|
|
|
+ <result property="actCode" column="ACT_CODE"/>
|
|
|
+ <result property="createdBy" column="CREATED_BY"/>
|
|
|
+ <result property="createdTime" column="CREATED_TIME"/>
|
|
|
+ <result property="updatedBy" column="UPDATED_BY"/>
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTwinDeviceTypeVo">
|
|
|
- select TYPE_ID, TYPE_GROUP, TYPE_NAME, TYPE_MATCH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_DEVICE_TYPE
|
|
|
+ select TYPE_ID,
|
|
|
+ TYPE_GROUP,
|
|
|
+ TYPE_NAME,
|
|
|
+ TYPE_MATCH,
|
|
|
+ CREATED_BY,
|
|
|
+ CREATED_TIME,
|
|
|
+ UPDATED_BY,
|
|
|
+ UPDATED_TIME,
|
|
|
+ REMARK
|
|
|
+ from TWIN_DEVICE_TYPE
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectTwinDeviceTypeList" parameterType="TwinDeviceType" resultMap="TwinDeviceTypeTwinDeviceTypeDataResult">
|
|
|
+ <select id="selectTwinDeviceTypeList" parameterType="TwinDeviceType"
|
|
|
+ resultMap="TwinDeviceTypeTwinDeviceTypeDataResult">
|
|
|
<include refid="selectTwinDeviceTypeVo"/>
|
|
|
<where>
|
|
|
- <if test="typeGroup != null and typeGroup != ''"> and TYPE_GROUP = #{typeGroup}</if>
|
|
|
- <if test="typeName != null and typeName != ''"> and TYPE_NAME like concat('%', #{typeName}, '%')</if>
|
|
|
- <if test="typeMatch != null and typeMatch != ''"> and TYPE_MATCH = #{typeMatch}</if>
|
|
|
+ <if test="typeGroup != null and typeGroup != ''">and TYPE_GROUP = #{typeGroup}</if>
|
|
|
+ <if test="typeName != null and typeName != ''">and TYPE_NAME like concat('%', #{typeName}, '%')</if>
|
|
|
+ <if test="typeMatch != null and typeMatch != ''">and TYPE_MATCH = #{typeMatch}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTwinDeviceTypeByTypeId" parameterType="Long" resultMap="TwinDeviceTypeTwinDeviceTypeDataResult">
|
|
|
- select TYPE_ID, TYPE_GROUP, TYPE_NAME, TYPE_MATCH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
|
|
|
+ select TYPE_ID,
|
|
|
+ TYPE_GROUP,
|
|
|
+ TYPE_NAME,
|
|
|
+ TYPE_MATCH,
|
|
|
+ CREATED_BY,
|
|
|
+ CREATED_TIME,
|
|
|
+ UPDATED_BY,
|
|
|
+ UPDATED_TIME,
|
|
|
+ REMARK
|
|
|
from TWIN_DEVICE_TYPE
|
|
|
where TYPE_ID = #{typeId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTwinDeviceTypeDataList" resultMap="TwinDeviceTypeDataResult">
|
|
|
- select DATA_ID, TYPE_ID, DATA_NAME, DATA_CODE, DATA_TYPE, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
|
|
|
+ select DATA_ID,
|
|
|
+ TYPE_ID,
|
|
|
+ DATA_NAME,
|
|
|
+ DATA_CODE,
|
|
|
+ MES_CODE,
|
|
|
+ ACT_CODE,
|
|
|
+ CREATED_BY,
|
|
|
+ CREATED_TIME,
|
|
|
+ UPDATED_BY,
|
|
|
+ UPDATED_TIME,
|
|
|
+ REMARK,
|
|
|
+ DATA_SORT
|
|
|
from TWIN_DEVICE_TYPE_DATA
|
|
|
where TYPE_ID = #{TYPE_ID}
|
|
|
+ order by type_id, data_sort
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertTwinDeviceType" parameterType="TwinDeviceType" useGeneratedKeys="true" keyProperty="typeId">
|
|
@@ -69,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
<if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="typeGroup != null">#{typeGroup},</if>
|
|
|
<if test="typeName != null">#{typeName},</if>
|
|
@@ -79,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTwinDeviceType" parameterType="TwinDeviceType">
|
|
@@ -98,7 +131,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTwinDeviceTypeByTypeId" parameterType="Long">
|
|
|
- delete from TWIN_DEVICE_TYPE where TYPE_ID = #{typeId}
|
|
|
+ delete
|
|
|
+ from TWIN_DEVICE_TYPE
|
|
|
+ where TYPE_ID = #{typeId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinDeviceTypeByTypeIds" parameterType="String">
|
|
@@ -116,13 +151,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinDeviceTypeDataByTypeId" parameterType="Long">
|
|
|
- delete from TWIN_DEVICE_TYPE_DATA where TYPE_ID = #{typeId}
|
|
|
+ delete
|
|
|
+ from TWIN_DEVICE_TYPE_DATA
|
|
|
+ where TYPE_ID = #{typeId}
|
|
|
</delete>
|
|
|
|
|
|
<insert id="batchTwinDeviceTypeData">
|
|
|
- insert into TWIN_DEVICE_TYPE_DATA( TYPE_ID, DATA_NAME, DATA_CODE, DATA_TYPE, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK) values
|
|
|
+ insert into TWIN_DEVICE_TYPE_DATA(TYPE_ID, DATA_NAME, DATA_CODE, MES_CODE, ACT_CODE, CREATED_BY, CREATED_TIME,
|
|
|
+ UPDATED_BY, UPDATED_TIME, REMARK, DATA_SORT) values
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
- ( #{item.typeId}, #{item.dataName}, #{item.dataCode}, #{item.dataType}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.remark})
|
|
|
+ (#{item.typeId}, #{item.dataName}, #{item.dataCode}, #{item.mesCode}, #{item.actCode}, #{item.createdBy},
|
|
|
+ #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.remark}, #{item.dataSort})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
</mapper>
|