map/das/src/main/resources/mapper/SysIotModelFieldMapper.xml

40 lines
1.9 KiB
XML
Raw Normal View History

2024-07-04 09:48:36 +08:00
<?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.das.modules.equipment.mapper.SysIotModelFieldMapper">
<resultMap type="com.das.modules.equipment.domain.vo.SysIotModelFieldVo" id="SysIotModelFieldMap">
<result property="attributeCode" column="attribute_code" jdbcType="VARCHAR"/>
<result property="attributeName" column="attribute_name" jdbcType="VARCHAR"/>
<result property="attributeType" column="attribute_type" jdbcType="INTEGER"/>
<result property="porder" column="porder" jdbcType="INTEGER"/>
<result property="revision" column="revision" jdbcType="INTEGER"/>
<result property="id" column="id" jdbcType="BIGINT"/>
<result property="iotModelId" column="iot_model_id" jdbcType="BIGINT"/>
</resultMap>
<select id="querySysIotModelFieldList" resultMap="SysIotModelFieldMap">
select t.* from sys_iot_model_field t
<where>
<if test="info.iotModelId != null and info.iotModelId != ''">
and t.iot_model_id = #{info.iotModelId}
</if>
<if test="info.attributeName != null and info.attributeName != ''">
and t.attribute_name like concat('%',#{info.attributeName},'%')
</if>
<if test="info.attributeCode != null and info.attributeCode != ''">
and t.attribute_code like concat('%',#{info.attributeCode},'%')
</if>
</where>
</select>
2024-07-11 17:29:07 +08:00
<select id="querySysIotModelFieldByModelId" resultType="java.lang.Long">
select count(1) from sys_iot_model_field where iot_model_id = #{id}
</select>
<select id="selectByAttributeCode" resultMap="SysIotModelFieldMap">
select * from sys_iot_model_field simf where upper(simf.attribute_code) = upper(#{code})
</select>
2024-07-11 17:29:07 +08:00
2024-07-04 09:48:36 +08:00
</mapper>