| | |
| | | </update> |
| | | |
| | | |
| | | <select id="getSelectSurplusMaterialsDate" > |
| | | select * |
| | | from mm.surplus_materials |
| | | <where> |
| | | and date(create_time)>=#{startDate} and date(create_time) <= #{endDate} and quantity>0 |
| | | <if test="surplusMaterials.width != null and surplusMaterials.width != ''"> |
| | | and width regexp #{surplusMaterials.width} |
| | | </if> |
| | | <if test="surplusMaterials.height != null and surplusMaterials.height != ''"> |
| | | and height regexp #{surplusMaterials.height} |
| | | </if> |
| | | <if test="surplusMaterials.thickness != null and surplusMaterials.thickness != ''"> |
| | | and thickness regexp #{surplusMaterials.thickness} |
| | | </if> |
| | | <if test="surplusMaterials.quantity != null and surplusMaterials.quantity != ''"> |
| | | and quantity regexp #{surplusMaterials.quantity} |
| | | </if> |
| | | <if test="surplusMaterials.colour != null and surplusMaterials.colour != ''"> |
| | | and colour regexp #{surplusMaterials.colour} |
| | | </if> |
| | | <if test="surplusMaterials.remarks != null and surplusMaterials.remarks != ''"> |
| | | and remarks regexp #{surplusMaterials.remarks} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectSurplusMaterialsDatePageTotal" > |
| | | select CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from mm.surplus_materials |
| | | <where> |
| | | and date(create_time)>=#{startDate} and date(create_time) <= #{endDate} and quantity>0 |
| | | <if test="surplusMaterials.width != null and surplusMaterials.width != ''"> |
| | | and width regexp #{surplusMaterials.width} |
| | | </if> |
| | | <if test="surplusMaterials.height != null and surplusMaterials.height != ''"> |
| | | and height regexp #{surplusMaterials.height} |
| | | </if> |
| | | <if test="surplusMaterials.thickness != null and surplusMaterials.thickness != ''"> |
| | | and thickness regexp #{surplusMaterials.thickness} |
| | | </if> |
| | | <if test="surplusMaterials.quantity != null and surplusMaterials.quantity != ''"> |
| | | and quantity regexp #{surplusMaterials.quantity} |
| | | </if> |
| | | <if test="surplusMaterials.colour != null and surplusMaterials.colour != ''"> |
| | | and colour regexp #{surplusMaterials.colour} |
| | | </if> |
| | | <if test="surplusMaterials.remarks != null and surplusMaterials.remarks != ''"> |
| | | and remarks regexp #{surplusMaterials.remarks} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSurplusMaterialsCount" > |
| | | select * |
| | | from mm.surplus_materials |
| | | where width=#{surplusMaterials.width} and height=#{surplusMaterials.height} |
| | | and thickness=#{surplusMaterials.thickness} and colour=#{surplusMaterials.colour} limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertSurplusMaterials"> |
| | | insert into mm.surplus_materials (width,height,thickness,quantity,colour,create_time) |
| | | values (#{surplusMaterials.width},#{surplusMaterials.height},#{surplusMaterials.thickness},#{surplusMaterials.quantity},#{surplusMaterials.colour},now()) |
| | | </insert> |
| | | |
| | | <insert id="insertSurplusMaterialsLog"> |
| | | insert into mm.surplus_materials_log (width,height,thickness,quantity,colour,type,creator,create_time) |
| | | values (#{surplusMaterials.width},#{surplusMaterials.height},#{surplusMaterials.thickness}, |
| | | #{surplusMaterials.quantity},#{surplusMaterials.colour},#{type},#{creator},now()) |
| | | </insert> |
| | | |
| | | <update id="updateSurplusMaterialsOutQuantity"> |
| | | update mm.surplus_materials set quantity=quantity-#{surplusMaterials.quantity} where id=#{surplusMaterials.id} |
| | | </update> |
| | | |
| | | <update id="updateSurplusMaterialsIntQuantity"> |
| | | update mm.surplus_materials set quantity=quantity+#{surplusMaterials.quantity} where id=#{surplusMaterials.id} |
| | | </update> |
| | | |
| | | |
| | | </mapper> |