项目初始化
This commit is contained in:
75
ruoyi-admin/src/main/resources/mapper/kpi/KpiMapper.xml
Normal file
75
ruoyi-admin/src/main/resources/mapper/kpi/KpiMapper.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?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.ruoyi.kpi.mapper.KpiMapper">
|
||||
|
||||
<!-- 入库趋势:in_or_out < 20,按日期+仓库分组 -->
|
||||
<select id="selectInboundTrend" parameterType="com.ruoyi.kpi.domain.KpiQuery" resultType="map">
|
||||
SELECT
|
||||
CONVERT(varchar(10), finish_time, 23) AS date,
|
||||
ISNULL(warehouse_name, '未分配') AS warehouseName,
|
||||
COUNT(*) AS quantity
|
||||
FROM mydo_job_finish
|
||||
<where>
|
||||
in_or_out < 20
|
||||
AND finish_time IS NOT NULL
|
||||
AND finish_time != ''
|
||||
<if test="warehouseId != null and warehouseId != ''">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="params.beginDate != null and params.beginDate != ''">
|
||||
AND CONVERT(varchar(10), finish_time, 23) >= #{params.beginDate}
|
||||
</if>
|
||||
<if test="params.endDate != null and params.endDate != ''">
|
||||
AND CONVERT(varchar(10), finish_time, 23) <= #{params.endDate}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY CONVERT(varchar(10), finish_time, 23), warehouse_name
|
||||
ORDER BY CONVERT(varchar(10), finish_time, 23)
|
||||
</select>
|
||||
|
||||
<!-- 出库趋势:in_or_out >= 20,按日期+仓库分组 -->
|
||||
<select id="selectOutboundTrend" parameterType="com.ruoyi.kpi.domain.KpiQuery" resultType="map">
|
||||
SELECT
|
||||
CONVERT(varchar(10), finish_time, 23) AS date,
|
||||
ISNULL(warehouse_name, '未分配') AS warehouseName,
|
||||
COUNT(*) AS quantity
|
||||
FROM mydo_job_finish
|
||||
<where>
|
||||
in_or_out >= 20
|
||||
AND finish_time IS NOT NULL
|
||||
AND finish_time != ''
|
||||
<if test="warehouseId != null and warehouseId != ''">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="params.beginDate != null and params.beginDate != ''">
|
||||
AND CONVERT(varchar(10), finish_time, 23) >= #{params.beginDate}
|
||||
</if>
|
||||
<if test="params.endDate != null and params.endDate != ''">
|
||||
AND CONVERT(varchar(10), finish_time, 23) <= #{params.endDate}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY CONVERT(varchar(10), finish_time, 23), warehouse_name
|
||||
ORDER BY CONVERT(varchar(10), finish_time, 23)
|
||||
</select>
|
||||
|
||||
<!-- 货位平面图:按仓库+巷道+排筛选 -->
|
||||
<select id="selectCargoSpacePlan" resultType="map">
|
||||
SELECT
|
||||
the_platoon AS thePlatoon,
|
||||
the_column AS theColumn,
|
||||
the_floor AS theFloor,
|
||||
status,
|
||||
locked,
|
||||
tray_code AS trayCode,
|
||||
cargo_space_id AS cargoSpaceId,
|
||||
cargo_space_name AS cargoSpaceName
|
||||
FROM bas_cargo_space
|
||||
WHERE warehouse_id = #{warehouseId}
|
||||
AND roadway_id = #{roadwayId}
|
||||
AND the_platoon = #{thePlatoon}
|
||||
ORDER BY the_floor, the_column
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user