¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.mapper.StockProductMapper; |
| | | import com.ruoyi.inventory.service.StockInService; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.project.system.domain.SysPost; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockin") |
| | | public class StockInController extends BaseController { |
| | | @Autowired |
| | | private StockInService stockInService; |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | @PostMapping("/add")// æ°å¢å
¥åºè®°å½ |
| | | public AjaxResult addStockIn(@RequestBody StockIn stockIn) { |
| | | int i = stockInService.addStockIn(stockIn); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @GetMapping("/list")// ååºææå
¥åºè®°å½ |
| | | public AjaxResult listStockIns() { |
| | | List<StockIn> stockIns = stockInService.listStockIns(); |
| | | return success(stockIns); |
| | | } |
| | | @GetMapping("/{id}")// æ ¹æ®IDè·åå
¥åºè®°å½ |
| | | public AjaxResult getStockInById(@PathVariable Long id) { |
| | | StockIn stockIn = stockInService.getStockInById(id); |
| | | return success(stockIn); |
| | | } |
| | | @PutMapping("/update")// æ´æ°å
¥åºè®°å½ |
| | | public AjaxResult updateStockIn(@RequestBody StockIn stockIn) { |
| | | int i = stockInService.updateStockIn(stockIn); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @DeleteMapping("/delete/{id}")// å é¤å
¥åºè®°å½ |
| | | public AjaxResult deleteStockIn(@PathVariable Long id) { |
| | | int i = stockInService.deleteStockIn(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | // @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @GetMapping("/export")// 导åºå
¥åºæ°æ® |
| | | public AjaxResult exportStockInData() { |
| | | List<StockIn> stockIns = stockInService.listStockIns(); |
| | | ExcelUtil<StockIn> util = new ExcelUtil<StockIn>(StockIn.class); |
| | | util.exportExcel(stockIns, "åºåå
¥åºä¿¡æ¯"); |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.service.StockManagementService; |
| | | import inventory.domain.StockManagement; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.framework.web.domain.AjaxResult.error; |
| | | import static com.ruoyi.framework.web.domain.AjaxResult.success; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockmanagement") |
| | | public class StockManagementController { |
| | | @Autowired |
| | | private StockManagementService stockManagementService; |
| | | @RequestMapping("/list")// ååºææåºåºè®°å½ |
| | | public AjaxResult listStockOuts() { |
| | | List<StockManagement> stockManagements = stockManagementService.getStockManagements(); |
| | | return success(stockManagements); |
| | | } |
| | | @GetMapping("/{id}")// æ ¹æ®IDè·ååºåºè®°å½ |
| | | public AjaxResult getStockOutById(@PathVariable Long id) { |
| | | StockManagement stockManagement = stockManagementService.getStockManagementById(id); |
| | | return success(stockManagement); |
| | | } |
| | | @PostMapping("add")// æ°å¢åºåºè®°å½ |
| | | public AjaxResult addStockOut(@RequestBody StockManagement stockManagement) { |
| | | int i = stockManagementService.addStockManagement(stockManagement); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @PutMapping("/update")// æ´æ°åºåºè®°å½ |
| | | public AjaxResult updateStockOut(@RequestBody StockManagement stockManagement) { |
| | | int i = stockManagementService.updateStockManagement(stockManagement); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @DeleteMapping("/delete/{id}")// å é¤åºåºè®°å½ |
| | | public AjaxResult deleteStockOut(@PathVariable Long id) { |
| | | int i = stockManagementService.deleteStockManagement(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.mapper.StockProductMapper; |
| | | import com.ruoyi.inventory.service.StockOutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockOut; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockout") |
| | | public class StockOutController extends BaseController { |
| | | @Autowired |
| | | private StockOutService stockOutService; |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | |
| | | @RequestMapping("/add") |
| | | public AjaxResult addStockOut(StockOut stockOut) { |
| | | int i = stockOutService.addStockOut(stockOut); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @RequestMapping("/list") |
| | | public AjaxResult listStockOuts() { |
| | | List<StockOut> stockOuts = stockOutService.getStockOuts(); |
| | | return success(stockOuts); |
| | | } |
| | | @RequestMapping("/{id}") |
| | | public AjaxResult getStockOutById(@PathVariable Long id) { |
| | | StockOut stockOut = stockOutService.getStockOutById(id); |
| | | return success(stockOut); |
| | | } |
| | | @RequestMapping("/update") |
| | | public AjaxResult updateStockOut(@RequestBody StockOut stockOut) { |
| | | int i = stockOutService.updateStockOut(stockOut); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @RequestMapping("/delete/{id}") |
| | | public AjaxResult deleteStockOut(Long id) { |
| | | int i = stockOutService.deleteStockOut(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | } |
| | |
| | | package inventory.domain; |
| | | package com.ruoyi.inventory.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import inventory.domain.StockProduct; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | private String inboundPerson; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | private List<StockProduct> stockProducts; |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockIn record); |
| | | |
| | | int insertSelective(StockIn record); |
| | | |
| | | StockIn selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(StockIn record); |
| | | |
| | | int updateByPrimaryKey(StockIn record); |
| | | List<StockIn> selectList(); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockManagement; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | * @Entity inventory.domain.StockManagement |
| | | */ |
| | | public interface StockManagementMapper { |
| | | |
| | | List<StockManagement> selectAll(); |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockManagement record); |
| | | |
| | | int insertSelective(StockManagement record); |
| | | |
| | |
| | | |
| | | int updateByPrimaryKeySelective(StockManagement record); |
| | | |
| | | int updateByPrimaryKey(StockManagement record); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockOut; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockOut record); |
| | | |
| | | List<StockOut> selectAll(); |
| | | int insertSelective(StockOut record); |
| | | |
| | | StockOut selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(StockOut record); |
| | | |
| | | int updateByPrimaryKey(StockOut record); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockProduct; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | * @Entity inventory.domain.StockProduct |
| | | */ |
| | | public interface StockProductMapper { |
| | | |
| | | List<StockProduct> selectList(); |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockProduct record); |
| | | |
| | | int insertSelective(StockProduct record); |
| | | |
| | |
| | | |
| | | int updateByPrimaryKeySelective(StockProduct record); |
| | | |
| | | int updateByPrimaryKey(StockProduct record); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface StockInService { |
| | | int addStockIn(StockIn stockIn); |
| | | |
| | | List<StockIn> listStockIns(); |
| | | |
| | | StockIn getStockInById(Long id); |
| | | |
| | | int updateStockIn(StockIn stockIn); |
| | | |
| | | int deleteStockIn(Long id); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockManagement; |
| | | |
| | | public interface StockManagementService { |
| | | List<StockManagement> getStockManagements(); |
| | | StockManagement getStockManagementById(Long id); |
| | | int addStockManagement(StockManagement stockManagement); |
| | | int updateStockManagement(StockManagement stockManagement); |
| | | int deleteStockManagement(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockOut; |
| | | |
| | | public interface StockOutService { |
| | | List<StockOut> getStockOuts(); |
| | | StockOut getStockOutById(Long id); |
| | | int addStockOut(StockOut stockOut); |
| | | int updateStockOut(StockOut stockOut); |
| | | int deleteStockOut(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.mapper.StockInMapper; |
| | | import com.ruoyi.inventory.service.StockInService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | @Service |
| | | public class StockInServiceImpl implements StockInService { |
| | | @Autowired |
| | | private StockInMapper stockInMapper; |
| | | |
| | | @Override//æ·»å åºåå
¥åºä¿¡æ¯ |
| | | public int addStockIn(StockIn stockIn) { |
| | | int i = stockInMapper.insertSelective(stockIn); |
| | | return i; |
| | | } |
| | | |
| | | @Override//ååºææåºåå
¥åºä¿¡æ¯ |
| | | public List<StockIn> listStockIns() { |
| | | List<StockIn> stockIns = stockInMapper.selectList(); |
| | | return stockIns; |
| | | } |
| | | |
| | | @Override//æ ¹æ®idè·ååºåå
¥åºä¿¡æ¯ |
| | | public StockIn getStockInById(Long id) { |
| | | StockIn stockIn = stockInMapper.selectByPrimaryKey(id); |
| | | return stockIn; |
| | | } |
| | | |
| | | @Override//æ´æ°åºåå
¥åºä¿¡æ¯ |
| | | public int updateStockIn(StockIn stockIn) { |
| | | int i = stockInMapper.updateByPrimaryKeySelective(stockIn); |
| | | return i; |
| | | } |
| | | |
| | | @Override//å é¤åºåå
¥åºä¿¡æ¯ |
| | | public int deleteStockIn(Long id) { |
| | | int i = stockInMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.service.StockManagementService; |
| | | import inventory.domain.StockManagement; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class StockManagementServiceImpl implements StockManagementService { |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | |
| | | @Override |
| | | public List<StockManagement> getStockManagements() { |
| | | List<StockManagement> stockManagements = stockManagementMapper.selectAll(); |
| | | return stockManagements; |
| | | } |
| | | |
| | | @Override |
| | | public StockManagement getStockManagementById(Long id) { |
| | | StockManagement stockManagement = stockManagementMapper.selectByPrimaryKey(id); |
| | | return stockManagement; |
| | | } |
| | | |
| | | @Override |
| | | public int addStockManagement(StockManagement stockManagement) { |
| | | int i = stockManagementMapper.insertSelective(stockManagement); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStockManagement(StockManagement stockManagement) { |
| | | int i = stockManagementMapper.updateByPrimaryKeySelective(stockManagement); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStockManagement(Long id) { |
| | | int i = stockManagementMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.mapper.StockOutMapper; |
| | | import com.ruoyi.inventory.service.StockOutService; |
| | | import inventory.domain.StockOut; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class StockOutServiceImpl implements StockOutService { |
| | | @Autowired |
| | | private StockOutMapper stockOutMapper; |
| | | @Override |
| | | public List<StockOut> getStockOuts() { |
| | | List<StockOut> stockOuts = stockOutMapper.selectAll(); |
| | | return stockOuts; |
| | | } |
| | | |
| | | @Override |
| | | public StockOut getStockOutById(Long id) { |
| | | StockOut stockOut = stockOutMapper.selectByPrimaryKey(id); |
| | | return stockOut; |
| | | } |
| | | |
| | | @Override |
| | | public int addStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.insertSelective(stockOut); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.updateByPrimaryKeySelective(stockOut); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStockOut(Long id) { |
| | | int i = stockOutMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | } |
| | |
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | return getDataTable(list);
|
| | | }
|
| | | /**
|
| | | * 导åºå²ä½å表
|
| | | */
|
| | |
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:post:export')")
|
ÎļþÃû´Ó src/main/resources/mapper/StockInMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockInMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockInMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockIn"> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.inventory.domain.StockIn"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="productId" column="product_id" jdbcType="INTEGER"/> |
| | | <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/> |
| | |
| | | <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/> |
| | | <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/> |
| | | <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/> |
| | | <collection property="stockProducts" ofType="com.ruoyi.inventory.domain.StockProduct" |
| | | select="com.ruoyi.inventory.mapper.StockProductMapper.selectByPrimaryKey" column="productId"> |
| | | <id property="id" column="productId" jdbcType="INTEGER"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | from stock_in |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.inventory.domain.StockIn"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_in |
| | | </select> |
| | | <select id="selectListByPage" resultType="com.ruoyi.inventory.domain.StockIn"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_in |
| | | limit #{pageNum},#{pageSize} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_in |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true"> |
| | | insert into stock_in |
| | | ( id,product_id,inbound_time |
| | | ,inbound_batch,supplier_name,inbound_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP} |
| | | ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true"> |
| | | insert into stock_in |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockIn"> |
| | | update stock_in |
| | | <set> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockIn"> |
| | | update stock_in |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | inbound_time = #{inboundTime,jdbcType=TIMESTAMP}, |
| | | inbound_batch = #{inboundBatch,jdbcType=VARCHAR}, |
| | | supplier_name = #{supplierName,jdbcType=VARCHAR}, |
| | | inbound_quantity = #{inboundQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockManagementMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockManagementMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockManagementMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockManagement"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_management |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectAll" resultType="inventory.domain.StockManagement"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_management |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_management |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true"> |
| | | insert into stock_management |
| | | ( id,product_id,stock_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{stockQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true"> |
| | | insert into stock_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockManagement"> |
| | | update stock_management |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | stock_quantity = #{stockQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockOutMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockOutMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockOutMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockOut"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_out |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectAll" resultType="inventory.domain.StockOut"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_out |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_out |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true"> |
| | | insert into stock_out |
| | | ( id,product_id,inbound_time |
| | | ,inbound_batch,supplier_name,inbound_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP} |
| | | ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true"> |
| | | insert into stock_out |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockOut"> |
| | | update stock_out |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | inbound_time = #{inboundTime,jdbcType=TIMESTAMP}, |
| | | inbound_batch = #{inboundBatch,jdbcType=VARCHAR}, |
| | | supplier_name = #{supplierName,jdbcType=VARCHAR}, |
| | | inbound_quantity = #{inboundQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockProductMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockProductMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockProductMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockProduct"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_product |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectList" resultType="inventory.domain.StockProduct"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_product |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_product |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true"> |
| | | insert into stock_product |
| | | ( id,product_category,spec_model |
| | | ,unit) |
| | | values (#{id,jdbcType=INTEGER},#{productCategory,jdbcType=VARCHAR},#{specModel,jdbcType=VARCHAR} |
| | | ,#{unit,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true"> |
| | | insert into stock_product |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockProduct"> |
| | | update stock_product |
| | | set |
| | | product_category = #{productCategory,jdbcType=VARCHAR}, |
| | | spec_model = #{specModel,jdbcType=VARCHAR}, |
| | | unit = #{unit,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |