| | |
| | | * |
| | | from |
| | | mm.finished_glass_shelf_information |
| | | where glass_shelf_number = #{finishedGlassShelfInformation.glassShelfNumber} |
| | | and glass_shelf_name = #{finishedGlassShelfInformation.glassShelfName} |
| | | and price = #{finishedGlassShelfInformation.price} |
| | | and unit = #{finishedGlassShelfInformation.unit} |
| | | and max_weight = #{finishedGlassShelfInformation.maxWeight} |
| | | 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,available_quantity, |
| | | total_quantity,price,money,unit,max_weight,max_width,max_height,remarks,create_time) |
| | | 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 ( |
| | | #{finishedGlassShelfInformation.glassShelfNumber},#{finishedGlassShelfInformation.glassShelfName} |
| | | ,#{finishedGlassShelfInformation.totalQuantity},#{finishedGlassShelfInformation.totalQuantity} |
| | | ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.money} |
| | | ,#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight} |
| | | #{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_number,glass_shelf_name,quantity,price,money,unit, |
| | | 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.glassShelfNumber},#{finishedGlassShelfInformation.glassShelfName} |
| | | ,#{finishedGlassShelfInformation.totalQuantity} |
| | | ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.money} |
| | | ,#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight} |
| | | 3,#{finishedGlassShelfInformation.glassShelfName},#{quantity} |
| | | ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight} |
| | | ,#{finishedGlassShelfInformation.maxWidth},#{finishedGlassShelfInformation.maxHeight},#{finishedGlassShelfInformation.remarks},now() |
| | | ) |
| | | </insert> |
| | |
| | | </update> |
| | | |
| | | <update id="updateFinishedGlassShelfInformation"> |
| | | update mm.finished_glass_shelf_information set glass_shelf_number=#{finishedGlassShelfInformation.glassShelfNumber}, |
| | | update mm.finished_glass_shelf_information set |
| | | glass_shelf_name=#{finishedGlassShelfInformation.glassShelfName}, |
| | | available_quantity=#{finishedGlassShelfInformation.availableQuantity}, |
| | | total_quantity=#{finishedGlassShelfInformation.totalQuantity}, |
| | | price=#{finishedGlassShelfInformation.price}, |
| | | money=#{finishedGlassShelfInformation.money}, |
| | | unit=#{finishedGlassShelfInformation.unit}, |
| | | max_weight=#{finishedGlassShelfInformation.maxWeight}, |
| | | max_width=#{finishedGlassShelfInformation.maxWidth}, |
| | |
| | | |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationDate"> |
| | | select * from mm.finished_glass_shelf_information where available_quantity>0 limit #{offset},#{pageSize}; |
| | | 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(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from |
| | | mm.finished_glass_shelf_information where available_quantity>0 |
| | | 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> |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationByGlassShelfnumber"> |
| | | select |
| | | * |
| | | from |
| | | mm.finished_glass_shelf_information where glass_shelf_number = #{glassShelfnumber} |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationInId"> |
| | | select |
| | | id as informationId, |
| | | glass_shelf_number as glassShelfNumber, |
| | | glass_shelf_name as glassShelfName, |
| | | available_quantity as availableQuantity, |
| | | total_quantity as totalQuantity, |
| | | count(*) as quantity, |
| | | price, |
| | | money, |
| | | unit, |
| | | '' as remarks, |
| | | max_weight as maxWeight, |
| | | max_width as maxWidth, |
| | | max_height as maxHeight, |
| | | remarks |
| | | price, |
| | | unit, |
| | | glass_shelf_name as glassShelfName |
| | | from |
| | | mm.finished_glass_shelf_information where id in |
| | | <foreach item="id" collection="ids" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | 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.information_id as informationId, |
| | | fed.glass_shelf_number as glassShelfNumber, |
| | | fed.glass_shelf_name as glassShelfName, |
| | | fed.quantity as quantity, |
| | | fi.available_quantity+fed.quantity as availableQuantity, |
| | | fi.total_quantity as totalQuantity, |
| | | 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 mm.finished_glass_shelf_information fi on fed.information_id=fi.id |
| | | 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> |
| | | |
| | |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedGlassShelfEmitDetails" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_emit_details(emit_id,emit_number,information_id,glass_shelf_number,glass_shelf_name, |
| | | withdraw_quantity,quantity,price,unit,money,remarks) |
| | | 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.informationId}, |
| | | #{finishedGlassShelfEmitDetails.glassShelfNumber},#{finishedGlassShelfEmitDetails.glassShelfName} |
| | | #{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,glass_shelf_number,glass_shelf_name,quantity,price,money,unit, |
| | | remarks,create_time,max_weight,max_width,max_height) |
| | | 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}, #{glassShelfNumber},#{glassShelfName},#{quantity},#{price},#{money},#{unit}, |
| | | #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight} |
| | | #{emitId},#{emitNumber},#{type},#{quantity},#{price},#{money},#{unit}, |
| | | #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight},#{glassShelfName},#{operator} |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateInformationAvailableQuantityOut"> |
| | | update mm.finished_glass_shelf_information set available_quantity=available_quantity-#{finishedGlassShelfEmitDetails.quantity} |
| | | where id=#{finishedGlassShelfEmitDetails.informationId} |
| | | 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 mm.finished_glass_shelf_information set available_quantity=available_quantity+#{finishedGlassShelfEmitDetails.quantity} |
| | | where id=#{finishedGlassShelfEmitDetails.informationId} |
| | | 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" > |
| | |
| | | <select id="getSelectFinishedGlassShelfWithdrawDetailsBywithdrawId" > |
| | | select |
| | | fgw.emit_id as emitId, |
| | | fgw.emit_number as emitNumber, |
| | | fgw.glass_shelf_number as glassShelfNumber, |
| | | 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, |
| | |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedGlassShelfWithdrawDetails" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_withdraw_details(withdraw_id,withdraw_number,emit_id,emit_number,glass_shelf_number,glass_shelf_name, |
| | | quantity,price,unit,money,remarks) |
| | | 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.emitId},#{finishedGlassShelfWithdrawDetails.emitNumber}, |
| | | #{finishedGlassShelfWithdrawDetails.glassShelfNumber},#{finishedGlassShelfWithdrawDetails.glassShelfName} |
| | | #{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> |
| | | |