计划模块(计划新增逻辑修改初版)

highway
wws 1 year ago
parent d6d5ff4ae3
commit 5c6e383e2e

@ -0,0 +1,36 @@
package com.op.plan.controller;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.plan.domain.BaseProduct;
import com.op.plan.service.IBaseProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Controller
*
* @author Open Platform
* @date 2023-09-03
*/
@RestController
@RequestMapping("/product")
public class BaseProductController extends BaseController {
@Autowired
private IBaseProductService baseProductService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(BaseProduct baseProduct) {
startPage();
List<BaseProduct> list = baseProductService.selectBaseProductList(baseProduct);
return getDataTable(list);
}
}

@ -0,0 +1,39 @@
package com.op.plan.domain;
// 订单-物料实体类
public class BaseProduct {
private String productCode;
private String productDescZh;
@Override
public String toString() {
return "BaseProduct{" +
"productCode='" + productCode + '\'' +
", productDescZh='" + productDescZh + '\'' +
'}';
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductDescZh() {
return productDescZh;
}
public void setProductDescZh(String productDescZh) {
this.productDescZh = productDescZh;
}
public BaseProduct(String productCode, String productDescZh) {
this.productCode = productCode;
this.productDescZh = productDescZh;
}
public BaseProduct() {
}
}

@ -0,0 +1,23 @@
package com.op.plan.mapper;
import com.op.plan.domain.BaseProduct;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-09-03
*/
public interface BaseProductMapper {
/**
*
*
* @param baseProduct
* @return
*/
public List<BaseProduct> selectBaseProductList(BaseProduct baseProduct);
}

@ -0,0 +1,21 @@
package com.op.plan.service;
import com.op.plan.domain.BaseProduct;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-09-03
*/
public interface IBaseProductService {
/**
*
*
* @param baseProduct
* @return
*/
public List<BaseProduct> selectBaseProductList(BaseProduct baseProduct);
}

@ -0,0 +1,29 @@
package com.op.plan.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.plan.domain.BaseProduct;
import com.op.plan.mapper.BaseProductMapper;
import com.op.plan.service.IBaseProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BaseProductServiceImpl implements IBaseProductService {
@Autowired
private BaseProductMapper baseProductMapper;
/**
*
*
* @param baseProduct
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseProduct> selectBaseProductList(BaseProduct baseProduct) {
return baseProductMapper.selectBaseProductList(baseProduct);
}
}

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.plan.mapper.BaseProductMapper">
<resultMap type="BaseProduct" id="BaseProductResult">
<result property="productCode" column="product_code" />
<result property="productDescZh" column="product_desc_zh" />
</resultMap>
<sql id="selectBaseProductVo">
select product_code, product_desc_zh from base_product
</sql>
<select id="selectBaseProductList" parameterType="BaseProduct" resultMap="BaseProductResult">
<include refid="selectBaseProductVo"/>
<where>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productDescZh != null and productDescZh != ''"> and product_desc_zh like concat('%', #{productDescZh}, '%')</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save