地质所 沉降监测网建设项目
zmk
2024-07-03 a1f05ddf1901ef80cb10cff9af57f457c99121c6
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
@@ -65,16 +65,16 @@
    </select>
    <select id="countTubLogDate" resultMap="TubLogResult">
       SELECT
            a.project_id,
            a.tub_name,
            b.inbound_number,
            a.outbound_number,
            a.unit
        SELECT
        a.project_id,
        a.tub_name,
        a.inbound_number,
        b.outbound_number,
        a.unit
        FROM
            ( SELECT project_id, tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) a
            LEFT JOIN ( SELECT project_id, tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name
            AND a.project_id = b.project_id
        ( SELECT project_id, tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) a
        LEFT JOIN ( SELECT project_id, tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name
        AND a.project_id = b.project_id
        <where>
            <if test="projectId != null and projectId != ''"> and a.project_id = #{projectId}</if>
        </where>