自动化立体仓库 - WMS系统
pang.jiabao
2024-06-14 fae1041e58137c61ea1e7075323351e8873fe931
src/main/resources/mapper/SaasLogMapper.xml
@@ -13,5 +13,57 @@
        <result column="create_by_name" property="createByName" />
    </resultMap>
    <select id="selectListSummary" resultType="com.zy.system.entity.SaasLog">
        select
            ISNULL(owner,
                   '') owner,
            type,
            matnr ,
            sum(ssl.anfme) anfme
        from
            sys_saas_log ssl
        <where>
            <if test="sDate != null">
                and io_time &gt; #{sDate}
            </if>
            <if test="eDate != null">
                and io_time &lt; #{eDate}
            </if>
            <if test="type != null and type != ''">
                and type = #{type}
            </if>
            <if test="owner != null and owner != ''">
                and owner = #{owner}
            </if>
        </where>
        group by
            ssl.owner,
            ssl.type,
            ssl.matnr
        order by
            ssl.owner,
            type
    </select>
    <select id="selectListSummaryBySubtotal" resultType="com.zy.system.entity.SaasLog">
        select owner,type,sum(anfme) anfme from sys_saas_log
        <where>
            <if test="owner == ''">
                owner IS NULL
            </if>
            <if test="owner != ''">
                owner = #{owner}
            </if>
            <if test="sDate != null">
                and io_time &gt; #{sDate}
            </if>
            <if test="eDate != null">
                and io_time &lt; #{eDate}
            </if>
            <if test="type != null and type != ''">
                and type = #{type}
            </if>
        </where>
        group by owner,type order by owner,type
    </select>
</mapper>