| | |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationInventoryArea"> |
| | | SELECT |
| | | MAX(CAST(REGEXP_REPLACE(glass_shelf_number, '[^0-9]', '')AS UNSIGNED)) AS maxDindex |
| | | ifnull(MAX(CAST(REGEXP_REPLACE(glass_shelf_number, '[^0-9]', '')AS UNSIGNED)),0) AS maxDindex |
| | | FROM |
| | | finished_glass_shelf_information |
| | | WHERE |
| | |
| | | <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 max_weight,max_width,max_height |
| | | group by glass_shelf_name,price,unit,max_weight,max_width,max_height |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | 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 max_weight,max_width,max_height) as zu |
| | | 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"> |
| | |
| | | '' as remarks, |
| | | max_weight as maxWeight, |
| | | max_width as maxWidth, |
| | | max_height as maxHeight |
| | | max_height as maxHeight, |
| | | price, |
| | | unit, |
| | | glass_shelf_name as glassShelfName |
| | | from |
| | | mm.finished_glass_shelf_information where max_weight=#{weight} and max_width=#{width} and max_height=#{height} |
| | | group by max_weight,max_width,max_height |
| | | 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> |
| | | |
| | |
| | | |
| | | <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.emit_number as emitNumber |
| | | from |
| | | mm.finished_glass_shelf_emit_details fed left join |
| | | (select count(*) as quantity,max_weight,max_width,max_height |
| | | from mm.finished_glass_shelf_information where state=0 group by max_weight,max_width,max_height) fi |
| | | on fed.max_weight=fi.max_weight and fed.max_weight=fi.max_weight and fed.max_width=fi.max_width |
| | | (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> |
| | | |
| | |
| | | |
| | | <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) |
| | | 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.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) |
| | | 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} |
| | | #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight},#{glassShelfName},#{operator} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | 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 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> |
| | | |
| | |
| | | <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, |
| | |
| | | |
| | | <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) |
| | | 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.money},#{finishedGlassShelfWithdrawDetails.remarks},#{finishedGlassShelfWithdrawDetails.glassShelfName} |
| | | ) |
| | | </insert> |
| | | |