lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DeviceTypeMapper.xml
@@ -1,4 +1,29 @@
<?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="org.jeecg.modules.dnc.mapper.DeviceTypeMapper">
    <select id="getDeviceTypeByAttribution" resultType="org.jeecg.modules.dnc.entity.DeviceType">
        SELECT
        nc_device_type.*,
        nc_device_management.device_management_name,
        nc_device_management.device_management_code
        FROM
        nc_device_type
        LEFT JOIN nc_device_management
        ON nc_device_type.device_management_id = nc_device_management.id
        WHERE
        1 = 1
        <if test="attributionIds != null and attributionIds.size() > 0">
            AND nc_device_type.attribution_id IN
            <foreach collection="attributionIds" item="attributionId" open="(" close=")" separator=",">
                #{attributionId}
            </foreach>
        </if>
        AND nc_device_type.attribution_type = #{attributionType}
        <if test="deviceManagementName != null and deviceManagementName != ''">
            AND nc_device_management.device_management_name LIKE CONCAT('%', #{deviceManagementName}, '%')
        </if>
        <if test="deviceManagementCode != null and deviceManagementCode != ''">
            AND nc_device_management.device_management_code LIKE CONCAT('%', #{deviceManagementCode}, '%')
        </if>
    </select>
</mapper>