查询统计修改

This commit is contained in:
猫猫guowen
2025-10-15 16:05:58 +08:00
parent f43c6782a6
commit 597f92b566
19 changed files with 1838 additions and 4158 deletions

View File

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="onlyIdentity" column="only_identity" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="orderId" column="order_id" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="lotNo" column="lot_no" />
@@ -68,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<when test="groupByProductId != null and groupByProductId or groupByProductName != null and groupByProductName or groupBySpec != null and groupBySpec or groupByUnit != null and groupByUnit or groupByLotNo != null and groupByLotNo or groupByWarehouseId != null and groupByWarehouseId or groupByCargoSpaceId != null and groupByCargoSpaceId or groupByPrice != null and groupByPrice or groupByParentId != null and groupByParentId or groupByCargoNo != null and groupByCargoNo or groupBySpare1 != null and groupBySpare1 or groupBySpare2 != null and groupBySpare2 or groupBySpare3 != null and groupBySpare3 or groupBySpare4 != null and groupBySpare4 or groupBySpare5 != null and groupBySpare5 or groupBySpare6 != null and groupBySpare6 or groupBySpare7 != null and groupBySpare7 or groupBySpare8 != null and groupBySpare8 or groupBySpare9 != null and groupBySpare9 or groupBySpare10 != null and groupBySpare10">
<if test="groupByProductId != null and groupByProductId">p.product_id,</if>
<if test="groupByProductName != null and groupByProductName">p.product_name,</if>
<if test="groupByOrderId != null and groupByOrderId">s.order_id,</if>
<if test="groupBySpec != null and groupBySpec">p.spec,</if>
<if test="groupByUnit != null and groupByUnit">p.unit,</if>
<if test="groupByPrice != null and groupByPrice">p.price,</if>
@@ -98,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND p.product_id IS NOT NULL AND p.product_id != ''
<if test="productId != null and productId != ''"> AND p.product_id like concat('%', #{productId}, '%')</if>
<if test="productName != null and productName != ''"> AND p.product_name like concat('%', #{productName}, '%')</if>
<if test="orderId != null and orderId != ''"> AND s.order_id like concat('%', #{orderId}, '%')</if>
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
@@ -111,6 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null and lotNo != ''"> AND s.lot_no like concat('%', #{lotNo}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> AND s.warehouse_id like concat('%', #{warehouseId}, '%')</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> AND s.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> AND bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="spare9 != null and spare9 != ''"> AND p.spare9 like concat('%', #{spare9}, '%')</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
@@ -119,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefixOverrides=",">
<if test="groupByProductId != null and groupByProductId">,p.product_id</if>
<if test="groupByProductName != null and groupByProductName">,p.product_name</if>
<if test="groupByOrderId != null and groupByOrderId">,s.order_id</if>
<if test="groupBySpec != null and groupBySpec">,p.spec</if>
<if test="groupByUnit != null and groupByUnit">,p.unit</if>
<if test="groupByPrice != null and groupByPrice">,p.price</if>
@@ -180,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND p.product_id IS NOT NULL AND p.product_id != ''
<if test="productId != null and productId != ''"> AND p.product_id like concat('%', #{productId}, '%')</if>
<if test="productName != null and productName != ''"> AND p.product_name like concat('%', #{productName}, '%')</if>
<if test="orderId != null and orderId != ''"> AND s.order_id like concat('%', #{orderId}, '%')</if>
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
@@ -228,6 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null and lotNo != ''"> AND s.lot_no like concat('%', #{lotNo}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> AND s.warehouse_id like concat('%', #{warehouseId}, '%')</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> AND s.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> AND bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>

View File

@@ -79,10 +79,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare37" column="spare37" />
<result property="spare38" column="spare38" />
<result property="spare39" column="spare39" />
<result property="lineId" column="line_id" />
</resultMap>
<sql id="selectViewInJobFlowVo">
select job_id, job_detail_id, status, task_no, tray_code, roadway_id, cargo_space_id, cargo_space_name, the_platoon, the_column, the_floor, priority, execution_phase, in_or_out, entrance_id, wlbh, lot_no, stacking_id, stock_status, in_quantity, in_or_out_id, in_or_out_d_id, create_time, start_time, finish_time, warehouse_id, product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9, spare10, spare11, spare12, spare13, spare14, spare15, spare16, spare17, spare18, spare19, spare20, spare21, spare22, spare23, spare24, spare25, spare26, spare27, spare28, spare29, spare30, spare31, spare32, spare33, spare34, spare35, spare36, spare37, spare38, spare39 from view_in_job_flow
select job_id, job_detail_id,line_id, status, task_no, tray_code, roadway_id, cargo_space_id, cargo_space_name, the_platoon, the_column, the_floor, priority, execution_phase, in_or_out, entrance_id, wlbh, lot_no, stacking_id, stock_status, in_quantity, in_or_out_id, in_or_out_d_id, create_time, start_time, finish_time, warehouse_id, product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9, spare10, spare11, spare12, spare13, spare14, spare15, spare16, spare17, spare18, spare19, spare20, spare21, spare22, spare23, spare24, spare25, spare26, spare27, spare28, spare29, spare30, spare31, spare32, spare33, spare34, spare35, spare36, spare37, spare38, spare39 from view_in_job_flow
</sql>
<select id="selectViewInJobFlowList" parameterType="ViewInJobFlow" resultMap="ViewInJobFlowResult">
@@ -162,6 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare37 != null and spare37 != ''"> and spare37 like concat('%', #{spare37}, '%')</if>
<if test="spare38 != null and spare38 != ''"> and spare38 like concat('%', #{spare38}, '%')</if>
<if test="spare39 != null and spare39 != ''"> and spare39 like concat('%', #{spare39}, '%')</if>
<if test="lineId != null and lineId != ''"> and line_id like concat('%', #{lineId}, '%')</if>
</where>
</select>

View File

@@ -81,10 +81,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare38" column="spare38" />
<result property="spare39" column="spare39" />
<result property="customerName" column="customer_name" />
<result property="lineId" column="line_id" />
</resultMap>
<sql id="selectViewOutJobFlowVo">
select job_id, job_detail_id, status, task_no, tray_code, roadway_id, cargo_space_id, cargo_space_name, the_platoon, the_column, the_floor, priority, execution_phase, in_or_out, exit_id, wlbh, lot_no, stacking_id, stock_status, out_quantity, give_num, in_or_out_id, in_or_out_d_id, create_time, start_time, finish_time, warehouse_id, product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9, spare10, spare11, spare12, spare13, spare14, spare15, spare16, spare17, spare18, spare19, spare20, spare21, spare22, spare23, spare24, spare25, spare26, spare27, spare28, spare29, spare30, spare31, spare32, spare33, spare34, spare35, spare36, spare37, spare38, spare39, customer_name from view_out_job_flow
select job_id, job_detail_id,line_id, status, task_no, tray_code, roadway_id, cargo_space_id, cargo_space_name, the_platoon, the_column, the_floor, priority, execution_phase, in_or_out, exit_id, wlbh, lot_no, stacking_id, stock_status, out_quantity, give_num, in_or_out_id, in_or_out_d_id, create_time, start_time, finish_time, warehouse_id, product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9, spare10, spare11, spare12, spare13, spare14, spare15, spare16, spare17, spare18, spare19, spare20, spare21, spare22, spare23, spare24, spare25, spare26, spare27, spare28, spare29, spare30, spare31, spare32, spare33, spare34, spare35, spare36, spare37, spare38, spare39, customer_name from view_out_job_flow
</sql>
<select id="selectViewOutJobFlowList" parameterType="ViewOutJobFlow" resultMap="ViewOutJobFlowResult">
@@ -166,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare38 != null and spare38 != ''"> and spare38 like concat('%', #{spare38}, '%')</if>
<if test="spare39 != null and spare39 != ''"> and spare39 like concat('%', #{spare39}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="lineId != null and lineId != ''"> and line_id like concat('%', #{lineId}, '%')</if>
</where>
</select>

View File

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="warehouseName" column="warehouse_name" />
<result property="stockStatus" column="stock_status" />
<result property="productStatus" column="product_status" />
<result property="orderId" column="order_id" />
</resultMap>
<sql id="selectViewStockDetailVo">
@@ -49,7 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s.stockin_detail_id,
s.in_date,
s.warehouse_id,
s.stacking_id,
s.stacking_id,
s.order_id,
cs.cargo_space_name,
cs.roadway_id,
cs.status AS cargo_space_status,
@@ -81,9 +83,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
<include refid="selectViewStockDetailVo"/>
<if test="stockId != null and stockId != ''"> and s.stock_id = #{stockId}</if>
<if test="stockId != null and stockId != ''"> and s.stock_id like concat('%',#{stockId}, '%')</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and s.cargo_space_id = #{cargoSpaceId}</if>
<if test="trayCode != null and trayCode != ''"> and s.tray_code = #{trayCode}</if>
<if test="trayCode != null and trayCode != ''"> and s.tray_code like concat('%',#{trayCode}, '%')</if>
<if test="quantity != null and quantity != ''"> and s.quantity = #{quantity}</if>
<if test="jobId != null and jobId != ''"> and s.job_id = #{jobId}</if>
<if test="lotNo != null and lotNo != ''"> and s.lot_no = #{lotNo}</if>
@@ -98,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockStatus != null and stockStatus != ''"> and s.stock_status = #{stockStatus}</if>
<if test="productStatus != null and productStatus != ''"> and s.product_status = #{productStatus}</if>
<if test="locked != null and locked != ''"> and cs.locked = #{locked}</if>
<if test="productId != null and productId != ''"> and p.product_id = #{productId}</if>
<if test="productId != null and productId != ''"> and p.product_id like concat('%',#{productId}, '%')</if>
<if test="productName != null and productName != ''"> and p.product_name like concat('%', #{productName}, '%')</if>
<if test="spec != null and spec != ''"> and p.spec = #{spec}</if>
<if test="unit != null and unit != ''"> and p.unit = #{unit}</if>
@@ -110,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare7 != null and spare7 != ''"> and p.spare7 = #{spare7}</if>
<if test="spare8 != null and spare8 != ''"> and p.spare8 = #{spare8}</if>
<if test="remark != null and remark != ''"> and p.remark = #{remark}</if>
<if test="orderId != null and orderId != ''"> and s.order_id like concat('%',#{orderId}, '%')</if>
</select>
<select id="selectViewStockDetailByOnlyIdentity" parameterType="Long" resultMap="ViewStockDetailResult">