<?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.zy.system.mapper.SaasLogMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.zy.system.entity.SaasLog">
|
<result column="id" property="id" />
|
<result column="type" property="type" />
|
<result column="loc_no" property="locNo" />
|
<result column="matnr" property="matnr" />
|
<result column="io_time" property="ioTime" />
|
<result column="create_by" property="createBy" />
|
<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 > #{sDate}
|
</if>
|
<if test="eDate != null">
|
and io_time < #{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 > #{sDate}
|
</if>
|
<if test="eDate != null">
|
and io_time < #{eDate}
|
</if>
|
<if test="type != null and type != ''">
|
and type = #{type}
|
</if>
|
</where>
|
group by owner,type order by owner,type
|
</select>
|
|
</mapper>
|