Newer
Older
huludao / src / main / resources / mapper / business / InspectionTemplateDao.xml
<?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.newfiber.modules.inspection.dao.InspectionTemplateDao">

    <!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="com.newfiber.modules.inspection.entity.InspectionTemplateEntity" id="inspectionTemplateMap">
        <result property="id" column="id"/>
        <result property="templateNo" column="template_no"/>
        <result property="templateName" column="template_name"/>
        <result property="pointx" column="pointx"/>
        <result property="pointy" column="pointy"/>
        <result property="deviation" column="deviation"/>
        <result property="createTime" column="create_time"/>
    </resultMap>


    <!-- 查询巡检模版信息 -->
    <select id="queryList" resultMap="inspectionTemplateMap">
        SELECT
        id,
        template_no,
        template_name,
        pointx,
        pointy,
        deviation,
        related_user_count as relatedUserCount,
        create_time
        FROM
        inspection_template WHERE 1 = 1
        <if test="templateNo != null and templateNo.trim() != ''">
            AND template_no = #{templateNo}
        </if>
        ORDER BY create_time DESC
    </select>


</mapper>