当前位置:网站首页>Use of subqueries

Use of subqueries

2022-06-26 14:50:00 All eyes are on it

    <!-- Query list -->
    <select id="selMap" parameterType="java.util.HashMap" resultType="java.util.HashMap">
        SELECT
            a.id,
            a.building_name,
            a.number_floor,
            DATE_FORMAT( a.create_time, "%Y-%m-%d " ) AS create_time,
        ( SELECT count( 1 ) FROM yz_install_mountingpoint WHERE name_id = a.id ) AS 'cOunt',
        ( SELECT count( 1 ) FROM yz_install_placefloor WHERE building_name = a.id ) AS 'cOuntfloor',
            address,
            dept_name
        FROM
            yz_install_placemanage a,
            sys_dept d
        WHERE
        d.dept_id = a.dept_id
            <include refid="selwhere"/>
            LIMIT #{StarRow},#{PageSize}
    </select>

原网站

版权声明
本文为[All eyes are on it]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261401317037.html