mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
#수정
stock.list.jsp StockMapper.xml #추가 stock.create.jsp WarehouseController.java WarehouseDto.java WarehouseMapper.java WarehouseMapper.xml WarehouseService.java
This commit is contained in:
@@ -9,23 +9,23 @@
|
||||
select count(*) from stock left join warehouse on stock.warehouse_id = warehouse.id left join product on stock.product_id = product.id left join product_category on product.kan_code = product_category.kan_code
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> stock.activation = 1 and warehouse.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> stock.activation = 1 and product.name like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 0"> stock.activation = 1 and product.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> stock.activation = 1 and product_category.cls_Nm_4 like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by stock.id desc limit #{start}, #{perPage}
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultType="com.no1.wms.stock.StockDto">
|
||||
select * from stock left join warehouse on stock.warehouse_id = warehouse.id left join product on stock.product_id = product.id left join product_category on product.kan_code = product_category.kan_code
|
||||
<where>
|
||||
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select * from stock left join warehouse on stock.warehouse_id = warehouse.id left join product on stock.product_id = product.id left join product_category on product.kan_code = product_category.kan_code
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> stock.activation = 1 and warehouse.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> stock.activation = 1 and product.name like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 0"> stock.activation = 1 and product.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> stock.activation = 1 and product_category.cls_Nm_4 like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by stock.id desc limit #{start}, #{perPage}
|
||||
</select>
|
||||
</where>
|
||||
order by stock.id desc limit #{start}, #{perPage}
|
||||
</select>
|
||||
|
||||
<select id="stockOne" parameterType="String" resultType="com.no1.wms.stock.StockDto">
|
||||
selct * from stock where id = #{id}
|
||||
|
||||
59
src/main/resources/mappers/WarehouseMapper.xml
Normal file
59
src/main/resources/mappers/WarehouseMapper.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.no1.wms.warehouse.WarehouseMapper">
|
||||
|
||||
<!-- select -->
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select count(*) from warehouse left join account on warehouse.manager_id = account.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> warehouse.activation = 1 and warehouse.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> warehouse.activation = 1 and warehouse.capacity like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 3"> warehouse.activation = 1 and warehouse.current_capacity like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by stock.id desc limit #{start}, #{perPage}
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||
select * from warehouse left join account on warehouse.manager_id = account.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> warehouse.activation = 1 and warehouse.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> warehouse.activation = 1 and warehouse.capacity like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 3"> warehouse.activation = 1 and warehouse.current_capacity like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by stock.id desc limit #{start}, #{perPage}
|
||||
</select>
|
||||
|
||||
<select id="warehouseOne" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||
selct * from warehouse where id = #{id}
|
||||
</select>
|
||||
<!-- select -->
|
||||
|
||||
|
||||
<!-- update -->
|
||||
<update id="updateWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
||||
update warehouse
|
||||
set capacity = #{dto.capacity}, name = #{dto.name}
|
||||
where id = #{dto.id}
|
||||
</update>
|
||||
<!-- update -->
|
||||
|
||||
|
||||
<!-- insert -->
|
||||
<insert id="createWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
||||
insert into warehouse (id, warehouse_id, product_id, quantity, activation)
|
||||
values ((UUID), #{dto.warehouse_id}, #{dto.product_id}, #{dto.quantity}, 1)
|
||||
</insert>
|
||||
<!-- insert -->
|
||||
|
||||
<!-- delete -->
|
||||
<delete id="deleteWarehouse" parameterType="String">
|
||||
delete from warehouse where no = #{id}
|
||||
</delete>
|
||||
<!-- delete -->
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user