From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml |  573 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 573 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml
new file mode 100644
index 0000000..ff6017c
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml
@@ -0,0 +1,573 @@
+<?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.example.erp.mapper.mm.FinishedGlassShelfMapper">
+
+    <resultMap id="selectFinishedGlassShelfEmitDetails" type="com.example.erp.entity.mm.FinishedGlassShelfEmitDetails">
+        <id column="id" property="id"/>
+        <result column="emit_id" property="emitId"/>
+        <result column="emit_number" property="emitNumber"/>
+        <result column="information_id" property="informationId"/>
+        <result column="glass_shelf_number" property="glassShelfNumber"/>
+        <result column="glass_shelf_name" property="glassShelfName"/>
+        <result column="withdraw_quantity" property="withdrawQuantity"/>
+        <result column="quantity" property="quantity"/>
+        <result column="unit" property="unit"/>
+        <result column="price" property="price"/>
+        <result column="money" property="money"/>
+        <result column="remarks" property="remarks"/>
+
+        <result column="available_quantity" property="finishedGlassShelfInformation.availableQuantity"/>
+        <result column="total_quantity" property="finishedGlassShelfInformation.totalQuantity"/>
+
+    </resultMap>
+
+    <select id="getSelectFinishedGlassShelfInformation">
+        select
+        *
+        from
+        mm.finished_glass_shelf_information
+        where
+             max_weight = #{finishedGlassShelfInformation.maxWeight}
+            and max_width = #{finishedGlassShelfInformation.maxWidth}
+            and max_height = #{finishedGlassShelfInformation.maxHeight}
+
+    </select>
+
+    <select id="getSelectFinishedGlassShelfInformationInventoryArea">
+        SELECT
+            ifnull(MAX(CAST(REGEXP_REPLACE(glass_shelf_number, '[^0-9]', '')AS UNSIGNED)),0) AS maxDindex
+        FROM
+            finished_glass_shelf_information
+        WHERE
+            glass_shelf_number regexp #{inventoryArea}
+
+    </select>
+
+
+    <insert id="insetFinishedGlassShelfInformation"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_information(glass_shelf_number,glass_shelf_name,price,unit,max_weight,max_width,max_height,remarks,create_time)
+        values (
+                   #{inventoryAreaNumber},#{finishedGlassShelfInformation.glassShelfName}
+                   ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight}
+                   ,#{finishedGlassShelfInformation.maxWidth},#{finishedGlassShelfInformation.maxHeight},#{finishedGlassShelfInformation.remarks},now()
+               )
+    </insert>
+
+    <insert id="insetFinishedGlassShelfLog"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_log(type,glass_shelf_name,quantity,price,unit,
+                                                max_weight,max_width,max_height,remarks,create_time)
+        values (
+                  3,#{finishedGlassShelfInformation.glassShelfName},#{quantity}
+               ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight}
+               ,#{finishedGlassShelfInformation.maxWidth},#{finishedGlassShelfInformation.maxHeight},#{finishedGlassShelfInformation.remarks},now()
+               )
+    </insert>
+
+    <update id="updateFinishedGlassShelfInformationQuantity">
+        update mm.finished_glass_shelf_information set available_quantity=available_quantity+ #{quantity},
+                                                       total_quantity=total_quantity+#{quantity} where id=#{id}
+    </update>
+
+    <update id="updateFinishedGlassShelfInformation">
+        update mm.finished_glass_shelf_information set
+                                                       glass_shelf_name=#{finishedGlassShelfInformation.glassShelfName},
+                                                       price=#{finishedGlassShelfInformation.price},
+                                                       unit=#{finishedGlassShelfInformation.unit},
+                                                       max_weight=#{finishedGlassShelfInformation.maxWeight},
+                                                       max_width=#{finishedGlassShelfInformation.maxWidth},
+                                                       max_height=#{finishedGlassShelfInformation.maxHeight},
+                                                       remarks=#{finishedGlassShelfInformation.remarks},
+                                                       create_time=now()
+                                                   where id=#{id}
+    </update>
+
+
+    <select id="getSelectFinishedGlassShelfInformationDate">
+        select
+            id,
+            glass_shelf_name as glassShelfName,
+            price,
+            unit,
+            count(*) as quantity,
+            max_weight as maxWeight,
+            max_width as maxWidth,
+            max_height as maxHeight
+        from mm.finished_glass_shelf_information
+        where state=0
+        group by glass_shelf_name,price,unit,max_weight,max_width,max_height
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectFinishedGlassShelfInformationDatePageTotal">
+        select
+            CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
+            count(zu.id) as 'total'
+        from ( select id as id from mm.finished_glass_shelf_information where state=0
+                                                                        group by glass_shelf_name,price,unit,max_weight,max_width,max_height) as zu
+    </select>
+
+    <select id="getSelectFinishedGlassShelfInformationDateDetail">
+        select
+            *
+        from mm.finished_glass_shelf_information
+        where state=0
+            limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectFinishedGlassShelfInformationDateDetailPageTotal">
+        select
+            CEILING(count(id)/#{pageSize}) as 'pageTotal',
+                count(id) as 'total'
+        from  mm.finished_glass_shelf_information where state=0
+    </select>
+
+    <select id="getSelectFinishedGlassShelfInformationById">
+        select
+        *
+        from
+        mm.finished_glass_shelf_information  where id = #{id}
+
+    </select>
+
+
+
+    <select id="getSelectFinishedGlassShelfInformationInId">
+        select
+        count(*) as quantity,
+        price,
+        unit,
+        '' as remarks,
+        max_weight as maxWeight,
+        max_width as maxWidth,
+        max_height as maxHeight,
+        price,
+        unit,
+        glass_shelf_name as glassShelfName
+        from
+            mm.finished_glass_shelf_information  where state=0 and max_weight=#{weight} and max_width=#{width} and max_height=#{height}
+                                                 and glass_shelf_name=#{glassShelfName} and price=#{price} and unit=#{unit}
+        group by max_weight,max_width,max_height,glass_shelf_name,price,unit
+
+    </select>
+
+
+    <delete id="deleteFinishedGlassShelfInformationById">
+        delete  from mm.finished_glass_shelf_information  where id=#{id}
+
+    </delete>
+
+    <select id="getSelectFinishedGlassShelfEmitByemitId">
+        select * from
+        mm.finished_glass_shelf_emit
+        where emit_id=#{emitId}
+    </select>
+
+    <select id="getSelectFinishedGlassShelfEmitDetailsByemitId" >
+        select
+            fed.glass_shelf_name as glassShelfName,
+            fed.quantity as quantity,
+            ifnull(fi.quantity+fed.quantity,fed.quantity) as availableQuantity,
+            fed.price,
+            fed.money,
+            fed.unit,
+            fed.remarks,
+            fed.max_weight as maxWeight,
+            fed.max_width as maxWidth,
+            fed.max_height as maxHeight,
+            fed.withdraw_quantity as withdrawQuantity,
+            fed.quantity-fed.withdraw_quantity as quantity2,
+            fed.emit_id as emitId,
+            fed.emit_number as emitNumber
+        from
+            mm.finished_glass_shelf_emit_details fed left join
+            (select count(*) as quantity,max_weight,max_width,max_height,glass_shelf_name,unit,price
+             from mm.finished_glass_shelf_information
+             where state=0
+             group by max_weight,max_width,max_height,glass_shelf_name,unit,price
+             ) fi
+            on fed.max_weight=fi.max_weight and fed.max_weight=fi.max_weight and fed.max_width=fi.max_width and
+               fed.glass_shelf_name=fi.glass_shelf_name and fed.unit=fi.unit and fed.price=fi.price
+        where emit_id=#{emitId}
+    </select>
+
+
+    <select id="getSelectFinishedGlassShelfEmitDetailsByemitId1" >
+        select * from mm.finished_glass_shelf_emit_details where emit_id=#{emitId}
+    </select>
+
+
+    <select id="getmaximumEmit" >
+        select ifnull(SUBSTR(max(right(emit_id,8)) from 7),0) from  mm.finished_glass_shelf_emit where  date(create_time)=CURDATE()
+    </select>
+
+    <select id="getmaximumWithdraw" >
+        select ifnull(SUBSTR(max(right(withdraw_id,8)) from 7),0) from  mm.finished_glass_shelf_withdraw where  date(create_time)=CURDATE()
+    </select>
+
+
+    <insert id="insertFinishedGlassShelfEmit"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_emit(emit_id,create_time,withdraw_time,customer_name,project,operator,state,remarks)
+        values (
+                   #{emitId},now(),#{finishedGlassShelfEmit.withdrawTime},#{finishedGlassShelfEmit.customerName}
+               ,#{finishedGlassShelfEmit.project},#{finishedGlassShelfEmit.operator},0,#{finishedGlassShelfEmit.remarks}
+               )
+    </insert>
+
+    <insert id="insertFinishedGlassShelfEmitDetails"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_emit_details(emit_id,emit_number,max_weight,max_width,max_height,
+                                                         withdraw_quantity,quantity,price,unit,money,remarks,glass_shelf_name)
+        values (
+                   #{emitId},#{emitNumber},#{finishedGlassShelfEmitDetails.maxWeight},
+                #{finishedGlassShelfEmitDetails.maxWidth},#{finishedGlassShelfEmitDetails.maxHeight}
+               ,0,#{finishedGlassShelfEmitDetails.quantity},#{finishedGlassShelfEmitDetails.price},#{finishedGlassShelfEmitDetails.unit},
+                #{finishedGlassShelfEmitDetails.money},#{finishedGlassShelfEmitDetails.remarks},#{finishedGlassShelfEmitDetails.glassShelfName}
+               )
+    </insert>
+
+    <insert id="insertFinishedGlassShelfEmitDetailsLog"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_log(document_id,document_number,type,quantity,price,money,unit,
+                                                remarks,create_time,max_weight,max_width,max_height,glass_shelf_name,operator)
+        values (
+                   #{emitId},#{emitNumber},#{type},#{quantity},#{price},#{money},#{unit},
+                #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight},#{glassShelfName},#{operator}
+               )
+    </insert>
+
+    <update id="updateInformationAvailableQuantityOut">
+        update finished_glass_shelf_information set state=1 where state=0 and max_weight=#{maxWeight}
+                                                              and max_width=#{maxWidth}
+                                                              and max_height=#{maxHeight}
+                                                              and price=#{price}
+                                                              and unit=#{unit}
+                                                              and glass_shelf_name=#{glassShelfName}
+         order by id limit #{quantity}
+    </update>
+
+    <update id="updateInformationAvailableQuantityInt">
+        update finished_glass_shelf_information set state=0 where state=1 and max_weight=#{maxWeight}
+                                                              and max_width=#{maxWidth}
+                                                              and max_height=#{maxHeight}
+                                                              and price=#{price}
+                                                              and unit=#{unit}
+                                                              and glass_shelf_name=#{glassShelfName}
+         order by id limit #{quantity}
+    </update>
+
+    <update id="updateFinishedGlassShelfEmit"  >
+        update mm.finished_glass_shelf_emit set create_time=now(),
+                                                withdraw_time=#{finishedGlassShelfEmit.withdrawTime},
+                                                customer_name=#{finishedGlassShelfEmit.customerName},
+                                                project=#{finishedGlassShelfEmit.project},
+                                                operator=#{finishedGlassShelfEmit.operator},
+                                                remarks=#{finishedGlassShelfEmit.remarks}
+                                            where emit_id=#{emitId}
+    </update>
+
+    <delete id="deleteFinishedGlassShelfEmitDetails"  >
+        delete from mm.finished_glass_shelf_emit_details  where emit_id=#{emitId}
+    </delete>
+
+    <delete id="deleteFinishedGlassShelfEmit"  >
+        delete from mm.finished_glass_shelf_emit  where emit_id=#{emitId}
+    </delete>
+
+    <delete id="deleteFinishedGlassShelfEmitDetailsLog"  >
+        delete from mm.finished_glass_shelf_log  where document_id=#{emitId}
+    </delete>
+
+    <update id="updateFinishedGlassShelfEmitDetailsLog"  >
+        update mm.finished_glass_shelf_log set state=1  where document_id=#{emitId}
+    </update>
+
+
+    <select id="getSelectFinishedGlassShelfEmit">
+        select * from mm.finished_glass_shelf_emit
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate}
+            <if test="emit.emitId != null and emit.emitId != ''">
+                and emit_id regexp #{emit.emitId}
+            </if>
+            <if test="emit.customerName != null and emit.customerName != ''">
+                and customer_name regexp #{emit.customerName}
+            </if>
+            <if test="emit.project != null and emit.project != ''">
+                and project regexp #{emit.project}
+            </if>
+            <if test="emit.operator != null and emit.operator != ''">
+                and operator regexp #{emit.operator}
+            </if>
+            <if test="emit.state != null">
+                and `state` = #{emit.state}
+            </if>
+            <if test="emit.remarks != null and emit.remarks != ''">
+                and remarks regexp #{emit.remarks}
+            </if>
+
+        </where>
+        group by emit_id
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectFinishedGlassShelfEmitPageTotal">
+        select
+        CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from mm.finished_glass_shelf_emit
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate}
+            <if test="emit.emitId != null and emit.emitId != ''">
+                and emit_id regexp #{emit.emitId}
+            </if>
+            <if test="emit.customerName != null and emit.customerName != ''">
+                and customer_name regexp #{emit.customerName}
+            </if>
+            <if test="emit.project != null and emit.project != ''">
+                and project regexp #{emit.project}
+            </if>
+            <if test="emit.operator != null and emit.operator != ''">
+                and operator regexp #{emit.operator}
+            </if>
+            <if test="emit.state != null">
+                and state = #{emit.state}
+            </if>
+            <if test="emit.remarks != null and emit.remarks != ''">
+                and remarks regexp #{emit.remarks}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+
+    <select id="getSelectFinishedGlassShelfWithdrawByemitId">
+        select * from
+            mm.finished_glass_shelf_withdraw
+        where withdraw_id=#{withdrawId}
+    </select>
+
+    <select id="getSelectFinishedGlassShelfWithdrawDetailsBywithdrawId1" >
+        select * from mm.finished_glass_shelf_withdraw_details where withdraw_id=#{withdrawId}
+    </select>
+
+    <select id="getSelectFinishedGlassShelfWithdrawDetailsBywithdrawId" >
+        select
+            fgw.emit_id as emitId,
+            fgw.glass_shelf_name as glassShelfName,
+            fgw.emit_number as emitNumber,
+            fgw.max_weight as maxWeight,
+            fgw.max_width as maxWidth,
+            fgw.max_height as maxHeight,
+            fgw.quantity,
+            fge.quantity-fge.withdraw_quantity+fgw.quantity as quantity2,
+            fgw.unit,
+            fgw.price,
+            fgw.money,
+            fgw.remarks
+        from mm.finished_glass_shelf_withdraw_details fgw
+            left join mm.finished_glass_shelf_emit_details fge
+                 on fgw.emit_id=fge.emit_id and fgw.emit_number=fge.emit_number
+                 where withdraw_id=#{withdrawId}
+    </select>
+
+    <select id="getSelectFinishedGlassShelfWithdraw">
+        select * from mm.finished_glass_shelf_withdraw
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate}
+            <if test="withdraw.withdrawId != null and withdraw.withdrawId != ''">
+                and withdraw_id regexp #{withdraw.withdrawId}
+            </if>
+            <if test="withdraw.customerName != null and withdraw.customerName != ''">
+                and customer_name regexp #{withdraw.customerName}
+            </if>
+            <if test="withdraw.project != null and withdraw.project != ''">
+                and project regexp #{withdraw.project}
+            </if>
+            <if test="withdraw.operator != null and withdraw.operator != ''">
+                and operator regexp #{withdraw.operator}
+            </if>
+            <if test="withdraw.remarks != null and withdraw.remarks != ''">
+                and remarks regexp #{withdraw.remarks}
+            </if>
+
+        </where>
+        group by withdraw_id
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectFinishedGlassShelfWithdrawPageTotal">
+        select
+        CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from mm.finished_glass_shelf_withdraw
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate}
+            <if test="withdraw.withdrawId != null and withdraw.withdrawId != ''">
+                and withdraw_id regexp #{withdraw.withdrawId}
+            </if>
+            <if test="withdraw.customerName != null and withdraw.customerName != ''">
+                and customer_name regexp #{withdraw.customerName}
+            </if>
+            <if test="withdraw.project != null and withdraw.project != ''">
+                and project regexp #{withdraw.project}
+            </if>
+            <if test="withdraw.operator != null and withdraw.operator != ''">
+                and operator regexp #{withdraw.operator}
+            </if>
+            <if test="withdraw.remarks != null and withdraw.remarks != ''">
+                and remarks regexp #{withdraw.remarks}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+
+    <update id="updateEmitDetailsWithdrawQuantityInt">
+        update mm.finished_glass_shelf_emit_details set withdraw_quantity=withdraw_quantity+#{finishedGlassShelfWithdrawDetails.quantity}
+        where emit_id=#{finishedGlassShelfWithdrawDetails.emitId} and emit_number=#{finishedGlassShelfWithdrawDetails.emitNumber}
+    </update>
+
+    <update id="updateEmitDetailsWithdrawQuantityOut">
+        update mm.finished_glass_shelf_emit_details set withdraw_quantity=withdraw_quantity-#{finishedGlassShelfWithdrawDetails.quantity}
+        where emit_id=#{finishedGlassShelfWithdrawDetails.emitId} and emit_number=#{finishedGlassShelfWithdrawDetails.emitNumber}
+    </update>
+
+    <delete id="deleteFinishedGlassShelfWithdrawDetails"  >
+        delete from mm.finished_glass_shelf_withdraw_details  where withdraw_id=#{withdrawId}
+    </delete>
+
+    <delete id="deleteFinishedGlassShelfWithdraw"  >
+        delete from mm.finished_glass_shelf_withdraw  where withdraw_id=#{withdrawId}
+    </delete>
+
+
+    <update id="updateFinishedGlassShelfWithdraw"  >
+        update mm.finished_glass_shelf_withdraw set create_time=now() where withdraw_id=#{withdrawId}
+    </update>
+
+    <insert id="insertFinishedGlassShelfWithdraw"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_withdraw(withdraw_id,create_time,customer_name,project,operator,remarks)
+        values (
+                   #{withdrawId},now(),#{finishedGlassShelfWithdraw.customerName}
+               ,#{finishedGlassShelfWithdraw.project},#{finishedGlassShelfWithdraw.operator},#{finishedGlassShelfWithdraw.remarks}
+               )
+    </insert>
+
+    <insert id="insertFinishedGlassShelfWithdrawDetails"  useGeneratedKeys="true" >
+        insert into mm.finished_glass_shelf_withdraw_details(withdraw_id,withdraw_number,max_weight,emit_id,emit_number,max_width,max_height,
+                                                         quantity,price,unit,money,remarks,glass_shelf_name)
+        values (
+                   #{withdrawId},#{withdrawNumber},#{finishedGlassShelfWithdrawDetails.maxWeight},#{finishedGlassShelfWithdrawDetails.emitId},#{finishedGlassShelfWithdrawDetails.emitNumber},
+                    #{finishedGlassShelfWithdrawDetails.maxWidth},#{finishedGlassShelfWithdrawDetails.maxHeight}
+                   ,#{finishedGlassShelfWithdrawDetails.quantity},#{finishedGlassShelfWithdrawDetails.price},#{finishedGlassShelfWithdrawDetails.unit},
+                   #{finishedGlassShelfWithdrawDetails.money},#{finishedGlassShelfWithdrawDetails.remarks},#{finishedGlassShelfWithdrawDetails.glassShelfName}
+               )
+    </insert>
+
+    <update id="updateFinishedGlassShelfEmitState">
+        update mm.finished_glass_shelf_emit set state=#{state}
+        where emit_id=#{emitId}
+    </update>
+
+
+
+    <select id="getFinishedGlassShelfLogReport">
+        select *
+        from mm.finished_glass_shelf_log
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate} and type=#{type} and state=0
+            <if test="finishedGlassShelfLog.documentId != null and finishedGlassShelfLog.documentId != ''">
+                and document_id regexp #{finishedGlassShelfLog.documentId}
+            </if>
+            <if test="finishedGlassShelfLog.documentNumber != null and finishedGlassShelfLog.documentNumber != ''">
+                and document_number regexp #{finishedGlassShelfLog.documentNumber}
+            </if>
+            <if test="finishedGlassShelfLog.glassShelfNumber != null and finishedGlassShelfLog.glassShelfNumber != ''">
+                and glass_shelf_number regexp #{finishedGlassShelfLog.glassShelfNumber}
+            </if>
+            <if test="finishedGlassShelfLog.glassShelfName != null and finishedGlassShelfLog.glassShelfName != ''">
+                and glass_shelf_name regexp #{finishedGlassShelfLog.glassShelfName}
+            </if>
+            <if test="finishedGlassShelfLog.quantity != null and finishedGlassShelfLog.quantity != ''">
+                and quantity regexp #{finishedGlassShelfLog.quantity}
+            </if>
+            <if test="finishedGlassShelfLog.unit != null and finishedGlassShelfLog.unit != ''">
+                and unit regexp #{finishedGlassShelfLog.unit}
+            </if>
+            <if test="finishedGlassShelfLog.price != null and finishedGlassShelfLog.price != ''">
+                and price regexp REGEXP_REPLACE(#{finishedGlassShelfLog.price},'\\.0+$','')
+            </if>
+            <if test="finishedGlassShelfLog.money != null and finishedGlassShelfLog.money != ''">
+                and money regexp REGEXP_REPLACE(#{finishedGlassShelfLog.money},'\\.0+$','')
+            </if>
+            <if test="finishedGlassShelfLog.remarks != null and finishedGlassShelfLog.remarks != ''">
+                and remarks regexp #{finishedGlassShelfLog.remarks}
+            </if>
+            <if test="finishedGlassShelfLog.maxWeight != null and finishedGlassShelfLog.maxWeight != ''">
+                and max_weight regexp #{finishedGlassShelfLog.maxWeight}
+            </if>
+            <if test="finishedGlassShelfLog.maxWidth != null and finishedGlassShelfLog.maxWidth != ''">
+                and max_width regexp #{finishedGlassShelfLog.maxWidth}
+            </if>
+            <if test="finishedGlassShelfLog.maxHeight != null and finishedGlassShelfLog.maxHeight != ''">
+                and max_height regexp #{finishedGlassShelfLog.maxHeight}
+            </if>
+        </where>
+        order by id desc
+        limit #{offset},#{pageSize};
+    </select>
+
+
+    <select id="getFinishedGlassShelfLogReportTotal">
+        select CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from finished_glass_shelf_log
+        <where>
+            date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate} and type=#{type} and state=0
+            <if test="finishedGlassShelfLog.documentId != null and finishedGlassShelfLog.documentId != ''">
+                and document_id regexp #{finishedGlassShelfLog.documentId}
+            </if>
+            <if test="finishedGlassShelfLog.documentNumber != null and finishedGlassShelfLog.documentNumber != ''">
+                and document_number regexp #{finishedGlassShelfLog.documentNumber}
+            </if>
+            <if test="finishedGlassShelfLog.glassShelfNumber != null and finishedGlassShelfLog.glassShelfNumber != ''">
+                and glass_shelf_number regexp #{finishedGlassShelfLog.glassShelfNumber}
+            </if>
+            <if test="finishedGlassShelfLog.glassShelfName != null and finishedGlassShelfLog.glassShelfName != ''">
+                and glass_shelf_name regexp #{finishedGlassShelfLog.glassShelfName}
+            </if>
+            <if test="finishedGlassShelfLog.quantity != null and finishedGlassShelfLog.quantity != ''">
+                and quantity regexp #{finishedGlassShelfLog.quantity}
+            </if>
+            <if test="finishedGlassShelfLog.unit != null and finishedGlassShelfLog.unit != ''">
+                and unit regexp #{finishedGlassShelfLog.unit}
+            </if>
+            <if test="finishedGlassShelfLog.price != null and finishedGlassShelfLog.price != ''">
+                and price regexp REGEXP_REPLACE(#{finishedGlassShelfLog.price},'\\.0+$','')
+            </if>
+            <if test="finishedGlassShelfLog.money != null and finishedGlassShelfLog.money != ''">
+                and money regexp REGEXP_REPLACE(#{finishedGlassShelfLog.money},'\\.0+$','')
+            </if>
+            <if test="finishedGlassShelfLog.remarks != null and finishedGlassShelfLog.remarks != ''">
+                and remarks regexp #{finishedGlassShelfLog.remarks}
+            </if>
+            <if test="finishedGlassShelfLog.maxWeight != null and finishedGlassShelfLog.maxWeight != ''">
+                and max_weight regexp #{finishedGlassShelfLog.maxWeight}
+            </if>
+            <if test="finishedGlassShelfLog.maxWidth != null and finishedGlassShelfLog.maxWidth != ''">
+                and max_width regexp #{finishedGlassShelfLog.maxWidth}
+            </if>
+            <if test="finishedGlassShelfLog.maxHeight != null and finishedGlassShelfLog.maxHeight != ''">
+                and max_height regexp #{finishedGlassShelfLog.maxHeight}
+            </if>
+        </where>
+    </select>
+
+    <select id="exportFinishedGlassShelfLogReport">
+        select * from mm.finished_glass_shelf_log
+        where  date(create_time)>=#{dates[0]} and date(create_time) &lt;= #{dates[1]} and type=#{type} and state=0
+
+    </select>
+
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.8.0