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
stock.activation = 1 and product.name like concat('%',#{search},'%')
stock.activation = 1 and product_category.cls_Nm_4 like concat('%',#{search},'%')
order by stock.id desc limit #{start}, #{perPage}
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
stock.activation = 1 and product.name like concat('%',#{search},'%')
stock.activation = 1 and product_category.cls_Nm_4 like concat('%',#{search},'%')
order by stock.id desc limit #{start}, #{perPage}
selct * from stock where id = #{id}
update stock
set quantity = #{dto.quantity}
where id = #{dto.id}
insert into stock (id, warehouse_id, product_id, quantity, activation)
values (#{dto.id}, #{dto.warehouse_id}, #{dto.product_id}, #{dto.quantity}, 1)
delete from stock where no = #{id}