优化代码

This commit is contained in:
dataprince 2023-07-11 17:26:39 +08:00
parent 88d1974e2b
commit c7b1f50f11
22 changed files with 86 additions and 82 deletions

View File

@ -3,7 +3,7 @@ package com.ruoyi.demo.controller;
import java.util.List; import java.util.List;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -19,6 +19,7 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.demo.domain.DemoCustomer; import com.ruoyi.demo.domain.DemoCustomer;
import com.ruoyi.demo.service.IDemoCustomerService; import com.ruoyi.demo.service.IDemoCustomerService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
/** /**
@ -31,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping("/demo/customer") @RequestMapping("/demo/customer")
public class DemoCustomerController extends BaseController public class DemoCustomerController extends BaseController
{ {
@Autowired @Resource
private IDemoCustomerService demoCustomerService; private IDemoCustomerService demoCustomerService;
/** /**

View File

@ -3,7 +3,7 @@ package com.ruoyi.demo.controller;
import java.util.List; import java.util.List;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -20,17 +20,18 @@ import com.ruoyi.demo.domain.DemoProduct;
import com.ruoyi.demo.service.IDemoProductService; import com.ruoyi.demo.service.IDemoProductService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
/** /**
* 产品树表mbController * 产品树表mbController
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * @date 2023-07-11
*/ */
@RestController @RestController
@RequestMapping("/demo/product") @RequestMapping("/demo/product")
public class DemoProductController extends BaseController public class DemoProductController extends BaseController
{ {
@Autowired @Resource
private IDemoProductService demoProductService; private IDemoProductService demoProductService;
/** /**

View File

@ -3,7 +3,7 @@ package com.ruoyi.demo.controller;
import java.util.List; import java.util.List;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -19,19 +19,20 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.demo.domain.DemoStudent; import com.ruoyi.demo.domain.DemoStudent;
import com.ruoyi.demo.service.IDemoStudentService; import com.ruoyi.demo.service.IDemoStudentService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 学生信息单表(mb)Controller * 学生信息单表(mb)Controller
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * @date 2023-07-11
*/ */
@RestController @RestController
@RequestMapping("/demo/student") @RequestMapping("/demo/student")
public class DemoStudentController extends BaseController public class DemoStudentController extends BaseController
{ {
@Autowired @Resource
private IDemoStudentService demoStudentService; private IDemoStudentService demoStudentService;
/** /**

View File

@ -12,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 客户主表(mb)对象 demo_customer * 客户主表(mb)对象 demo_customer
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-11 * 2023-07-11
*/ */
public class DemoCustomer extends BaseEntity public class DemoCustomer extends BaseEntity
{ {

View File

@ -12,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 商品子对象 demo_goods * 商品子对象 demo_goods
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-11 * 2023-07-11
*/ */
public class DemoGoods extends BaseEntity public class DemoGoods extends BaseEntity
{ {

View File

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
* 产品树表mb对象 demo_product * 产品树表mb对象 demo_product
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public class DemoProduct extends TreeEntity public class DemoProduct extends TreeEntity
{ {

View File

@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 学生信息单表(mb)对象 demo_student * 学生信息单表(mb)对象 demo_student
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public class DemoStudent extends BaseEntity public class DemoStudent extends BaseEntity
{ {

View File

@ -8,7 +8,7 @@ import com.ruoyi.demo.domain.DemoGoods;
* 客户主表(mb)Mapper接口 * 客户主表(mb)Mapper接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-11 * 2023-07-11
*/ */
public interface DemoCustomerMapper public interface DemoCustomerMapper
{ {
@ -26,7 +26,7 @@ public interface DemoCustomerMapper
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 客户主表(mb)集合 * @return 客户主表(mb)集合
*/ */
public List<DemoCustomer> selectDemoCustomerList(DemoCustomer demoCustomer); List<DemoCustomer> selectDemoCustomerList(DemoCustomer demoCustomer);
/** /**
* 新增客户主表(mb) * 新增客户主表(mb)
@ -34,7 +34,7 @@ public interface DemoCustomerMapper
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 结果 * @return 结果
*/ */
public int insertDemoCustomer(DemoCustomer demoCustomer); int insertDemoCustomer(DemoCustomer demoCustomer);
/** /**
* 修改客户主表(mb) * 修改客户主表(mb)
@ -42,7 +42,7 @@ public interface DemoCustomerMapper
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 结果 * @return 结果
*/ */
public int updateDemoCustomer(DemoCustomer demoCustomer); int updateDemoCustomer(DemoCustomer demoCustomer);
/** /**
* 删除客户主表(mb) * 删除客户主表(mb)
@ -50,7 +50,7 @@ public interface DemoCustomerMapper
* @param customerId 客户主表(mb)主键 * @param customerId 客户主表(mb)主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoCustomerByCustomerId(Long customerId); int deleteDemoCustomerByCustomerId(Long customerId);
/** /**
* 批量删除客户主表(mb) * 批量删除客户主表(mb)
@ -58,7 +58,7 @@ public interface DemoCustomerMapper
* @param customerIds 需要删除的数据主键集合 * @param customerIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoCustomerByCustomerIds(Long[] customerIds); int deleteDemoCustomerByCustomerIds(Long[] customerIds);
/** /**
* 批量删除商品子 * 批量删除商品子
@ -66,7 +66,7 @@ public interface DemoCustomerMapper
* @param customerIds 需要删除的数据主键集合 * @param customerIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoGoodsByCustomerIds(Long[] customerIds); int deleteDemoGoodsByCustomerIds(Long[] customerIds);
/** /**
* 批量新增商品子 * 批量新增商品子
@ -74,7 +74,7 @@ public interface DemoCustomerMapper
* @param demoGoodsList 商品子列表 * @param demoGoodsList 商品子列表
* @return 结果 * @return 结果
*/ */
public int batchDemoGoods(List<DemoGoods> demoGoodsList); int batchDemoGoods(List<DemoGoods> demoGoodsList);
/** /**
@ -83,5 +83,5 @@ public interface DemoCustomerMapper
* @param customerId 客户主表(mb)ID * @param customerId 客户主表(mb)ID
* @return 结果 * @return 结果
*/ */
public int deleteDemoGoodsByCustomerId(Long customerId); int deleteDemoGoodsByCustomerId(Long customerId);
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.demo.domain.DemoProduct;
* 产品树表mbMapper接口 * 产品树表mbMapper接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public interface DemoProductMapper public interface DemoProductMapper
{ {
@ -25,7 +25,7 @@ public interface DemoProductMapper
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 产品树表mb集合 * @return 产品树表mb集合
*/ */
public List<DemoProduct> selectDemoProductList(DemoProduct demoProduct); List<DemoProduct> selectDemoProductList(DemoProduct demoProduct);
/** /**
* 新增产品树表mb * 新增产品树表mb
@ -33,7 +33,7 @@ public interface DemoProductMapper
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 结果 * @return 结果
*/ */
public int insertDemoProduct(DemoProduct demoProduct); int insertDemoProduct(DemoProduct demoProduct);
/** /**
* 修改产品树表mb * 修改产品树表mb
@ -41,7 +41,7 @@ public interface DemoProductMapper
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 结果 * @return 结果
*/ */
public int updateDemoProduct(DemoProduct demoProduct); int updateDemoProduct(DemoProduct demoProduct);
/** /**
* 删除产品树表mb * 删除产品树表mb
@ -49,7 +49,7 @@ public interface DemoProductMapper
* @param productId 产品树表mb主键 * @param productId 产品树表mb主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoProductByProductId(Long productId); int deleteDemoProductByProductId(Long productId);
/** /**
* 批量删除产品树表mb * 批量删除产品树表mb
@ -57,5 +57,5 @@ public interface DemoProductMapper
* @param productIds 需要删除的数据主键集合 * @param productIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoProductByProductIds(Long[] productIds); int deleteDemoProductByProductIds(Long[] productIds);
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.demo.domain.DemoStudent;
* 学生信息单表(mb)Mapper接口 * 学生信息单表(mb)Mapper接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public interface DemoStudentMapper public interface DemoStudentMapper
{ {
@ -25,7 +25,7 @@ public interface DemoStudentMapper
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 学生信息单表(mb)集合 * @return 学生信息单表(mb)集合
*/ */
public List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent); List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent);
/** /**
* 新增学生信息单表(mb) * 新增学生信息单表(mb)
@ -33,7 +33,7 @@ public interface DemoStudentMapper
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 结果 * @return 结果
*/ */
public int insertDemoStudent(DemoStudent demoStudent); int insertDemoStudent(DemoStudent demoStudent);
/** /**
* 修改学生信息单表(mb) * 修改学生信息单表(mb)
@ -41,7 +41,7 @@ public interface DemoStudentMapper
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 结果 * @return 结果
*/ */
public int updateDemoStudent(DemoStudent demoStudent); int updateDemoStudent(DemoStudent demoStudent);
/** /**
* 删除学生信息单表(mb) * 删除学生信息单表(mb)
@ -49,7 +49,7 @@ public interface DemoStudentMapper
* @param studentId 学生信息单表(mb)主键 * @param studentId 学生信息单表(mb)主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoStudentByStudentId(Long studentId); int deleteDemoStudentByStudentId(Long studentId);
/** /**
* 批量删除学生信息单表(mb) * 批量删除学生信息单表(mb)
@ -57,5 +57,5 @@ public interface DemoStudentMapper
* @param studentIds 需要删除的数据主键集合 * @param studentIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoStudentByStudentIds(Long[] studentIds); int deleteDemoStudentByStudentIds(Long[] studentIds);
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.demo.domain.DemoCustomer;
* 客户主表(mb)Service接口 * 客户主表(mb)Service接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-11 * 2023-07-11
*/ */
public interface IDemoCustomerService public interface IDemoCustomerService
{ {
@ -25,7 +25,7 @@ public interface IDemoCustomerService
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 客户主表(mb)集合 * @return 客户主表(mb)集合
*/ */
public List<DemoCustomer> selectDemoCustomerList(DemoCustomer demoCustomer); List<DemoCustomer> selectDemoCustomerList(DemoCustomer demoCustomer);
/** /**
* 新增客户主表(mb) * 新增客户主表(mb)
@ -33,7 +33,7 @@ public interface IDemoCustomerService
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 结果 * @return 结果
*/ */
public int insertDemoCustomer(DemoCustomer demoCustomer); int insertDemoCustomer(DemoCustomer demoCustomer);
/** /**
* 修改客户主表(mb) * 修改客户主表(mb)
@ -41,7 +41,7 @@ public interface IDemoCustomerService
* @param demoCustomer 客户主表(mb) * @param demoCustomer 客户主表(mb)
* @return 结果 * @return 结果
*/ */
public int updateDemoCustomer(DemoCustomer demoCustomer); int updateDemoCustomer(DemoCustomer demoCustomer);
/** /**
* 批量删除客户主表(mb) * 批量删除客户主表(mb)
@ -49,7 +49,7 @@ public interface IDemoCustomerService
* @param customerIds 需要删除的客户主表(mb)主键集合 * @param customerIds 需要删除的客户主表(mb)主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoCustomerByCustomerIds(Long[] customerIds); int deleteDemoCustomerByCustomerIds(Long[] customerIds);
/** /**
* 删除客户主表(mb)信息 * 删除客户主表(mb)信息
@ -57,5 +57,5 @@ public interface IDemoCustomerService
* @param customerId 客户主表(mb)主键 * @param customerId 客户主表(mb)主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoCustomerByCustomerId(Long customerId); int deleteDemoCustomerByCustomerId(Long customerId);
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.demo.domain.DemoProduct;
* 产品树表mbService接口 * 产品树表mbService接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public interface IDemoProductService public interface IDemoProductService
{ {
@ -25,7 +25,7 @@ public interface IDemoProductService
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 产品树表mb集合 * @return 产品树表mb集合
*/ */
public List<DemoProduct> selectDemoProductList(DemoProduct demoProduct); List<DemoProduct> selectDemoProductList(DemoProduct demoProduct);
/** /**
* 新增产品树表mb * 新增产品树表mb
@ -33,7 +33,7 @@ public interface IDemoProductService
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 结果 * @return 结果
*/ */
public int insertDemoProduct(DemoProduct demoProduct); int insertDemoProduct(DemoProduct demoProduct);
/** /**
* 修改产品树表mb * 修改产品树表mb
@ -41,7 +41,7 @@ public interface IDemoProductService
* @param demoProduct 产品树表mb * @param demoProduct 产品树表mb
* @return 结果 * @return 结果
*/ */
public int updateDemoProduct(DemoProduct demoProduct); int updateDemoProduct(DemoProduct demoProduct);
/** /**
* 批量删除产品树表mb * 批量删除产品树表mb
@ -49,7 +49,7 @@ public interface IDemoProductService
* @param productIds 需要删除的产品树表mb主键集合 * @param productIds 需要删除的产品树表mb主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoProductByProductIds(Long[] productIds); int deleteDemoProductByProductIds(Long[] productIds);
/** /**
* 删除产品树表mb信息 * 删除产品树表mb信息
@ -57,5 +57,5 @@ public interface IDemoProductService
* @param productId 产品树表mb主键 * @param productId 产品树表mb主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoProductByProductId(Long productId); int deleteDemoProductByProductId(Long productId);
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.demo.domain.DemoStudent;
* 学生信息单表(mb)Service接口 * 学生信息单表(mb)Service接口
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
public interface IDemoStudentService public interface IDemoStudentService
{ {
@ -25,7 +25,7 @@ public interface IDemoStudentService
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 学生信息单表(mb)集合 * @return 学生信息单表(mb)集合
*/ */
public List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent); List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent);
/** /**
* 新增学生信息单表(mb) * 新增学生信息单表(mb)
@ -33,7 +33,7 @@ public interface IDemoStudentService
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 结果 * @return 结果
*/ */
public int insertDemoStudent(DemoStudent demoStudent); int insertDemoStudent(DemoStudent demoStudent);
/** /**
* 修改学生信息单表(mb) * 修改学生信息单表(mb)
@ -41,7 +41,7 @@ public interface IDemoStudentService
* @param demoStudent 学生信息单表(mb) * @param demoStudent 学生信息单表(mb)
* @return 结果 * @return 结果
*/ */
public int updateDemoStudent(DemoStudent demoStudent); int updateDemoStudent(DemoStudent demoStudent);
/** /**
* 批量删除学生信息单表(mb) * 批量删除学生信息单表(mb)
@ -49,7 +49,7 @@ public interface IDemoStudentService
* @param studentIds 需要删除的学生信息单表(mb)主键集合 * @param studentIds 需要删除的学生信息单表(mb)主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDemoStudentByStudentIds(Long[] studentIds); int deleteDemoStudentByStudentIds(Long[] studentIds);
/** /**
* 删除学生信息单表(mb)信息 * 删除学生信息单表(mb)信息
@ -57,5 +57,5 @@ public interface IDemoStudentService
* @param studentId 学生信息单表(mb)主键 * @param studentId 学生信息单表(mb)主键
* @return 结果 * @return 结果
*/ */
public int deleteDemoStudentByStudentId(Long studentId); int deleteDemoStudentByStudentId(Long studentId);
} }

View File

@ -1,7 +1,7 @@
package com.ruoyi.demo.service.impl; package com.ruoyi.demo.service.impl;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
@ -15,12 +15,12 @@ import com.ruoyi.demo.service.IDemoCustomerService;
* 客户主表(mb)Service业务层处理 * 客户主表(mb)Service业务层处理
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-11 * 2023-07-11
*/ */
@Service @Service
public class DemoCustomerServiceImpl implements IDemoCustomerService public class DemoCustomerServiceImpl implements IDemoCustomerService
{ {
@Autowired @Resource
private DemoCustomerMapper demoCustomerMapper; private DemoCustomerMapper demoCustomerMapper;
/** /**

View File

@ -1,7 +1,7 @@
package com.ruoyi.demo.service.impl; package com.ruoyi.demo.service.impl;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.DemoProductMapper; import com.ruoyi.demo.mapper.DemoProductMapper;
import com.ruoyi.demo.domain.DemoProduct; import com.ruoyi.demo.domain.DemoProduct;
@ -11,12 +11,12 @@ import com.ruoyi.demo.service.IDemoProductService;
* 产品树表mbService业务层处理 * 产品树表mbService业务层处理
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
@Service @Service
public class DemoProductServiceImpl implements IDemoProductService public class DemoProductServiceImpl implements IDemoProductService
{ {
@Autowired @Resource
private DemoProductMapper demoProductMapper; private DemoProductMapper demoProductMapper;
/** /**

View File

@ -1,7 +1,7 @@
package com.ruoyi.demo.service.impl; package com.ruoyi.demo.service.impl;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.DemoStudentMapper; import com.ruoyi.demo.mapper.DemoStudentMapper;
import com.ruoyi.demo.domain.DemoStudent; import com.ruoyi.demo.domain.DemoStudent;
@ -11,12 +11,12 @@ import com.ruoyi.demo.service.IDemoStudentService;
* 学生信息单表(mb)Service业务层处理 * 学生信息单表(mb)Service业务层处理
* *
* @author 数据小王子 * @author 数据小王子
* @date 2023-07-09 * 2023-07-11
*/ */
@Service @Service
public class DemoStudentServiceImpl implements IDemoStudentService public class DemoStudentServiceImpl implements IDemoStudentService
{ {
@Autowired @Resource
private DemoStudentMapper demoStudentMapper; private DemoStudentMapper demoStudentMapper;
/** /**

View File

@ -3,7 +3,7 @@ package ${packageName}.controller;
import java.util.List; import java.util.List;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -19,6 +19,7 @@ import com.ruoyi.common.enums.BusinessType;
import ${packageName}.domain.${ClassName}; import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service; import ${packageName}.service.I${ClassName}Service;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
#if($table.crud || $table.sub) #if($table.crud || $table.sub)
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
#elseif($table.tree) #elseif($table.tree)
@ -34,7 +35,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping("/${moduleName}/${businessName}") @RequestMapping("/${moduleName}/${businessName}")
public class ${ClassName}Controller extends BaseController public class ${ClassName}Controller extends BaseController
{ {
@Autowired @Resource
private I${ClassName}Service ${className}Service; private I${ClassName}Service ${className}Service;
/** /**

View File

@ -16,7 +16,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
* ${functionName}对象 ${tableName} * ${functionName}对象 ${tableName}
* *
* @author ${author} * @author ${author}
* @date ${datetime} * ${datetime}
*/ */
#if($table.crud || $table.sub) #if($table.crud || $table.sub)
#set($Entity="BaseEntity") #set($Entity="BaseEntity")

View File

@ -10,7 +10,7 @@ import ${packageName}.domain.${subClassName};
* ${functionName}Mapper接口 * ${functionName}Mapper接口
* *
* @author ${author} * @author ${author}
* @date ${datetime} * ${datetime}
*/ */
public interface ${ClassName}Mapper public interface ${ClassName}Mapper
{ {
@ -28,7 +28,7 @@ public interface ${ClassName}Mapper
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return ${functionName}集合 * @return ${functionName}集合
*/ */
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); List<${ClassName}> select${ClassName}List(${ClassName} ${className});
/** /**
* 新增${functionName} * 新增${functionName}
@ -36,7 +36,7 @@ public interface ${ClassName}Mapper
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int insert${ClassName}(${ClassName} ${className}); int insert${ClassName}(${ClassName} ${className});
/** /**
* 修改${functionName} * 修改${functionName}
@ -44,7 +44,7 @@ public interface ${ClassName}Mapper
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int update${ClassName}(${ClassName} ${className}); int update${ClassName}(${ClassName} ${className});
/** /**
* 删除${functionName} * 删除${functionName}
@ -52,7 +52,7 @@ public interface ${ClassName}Mapper
* @param ${pkColumn.javaField} ${functionName}主键 * @param ${pkColumn.javaField} ${functionName}主键
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
/** /**
* 批量删除${functionName} * 批量删除${functionName}
@ -60,7 +60,7 @@ public interface ${ClassName}Mapper
* @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @param ${pkColumn.javaField}s 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
#if($table.sub) #if($table.sub)
/** /**
@ -69,7 +69,7 @@ public interface ${ClassName}Mapper
* @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @param ${pkColumn.javaField}s 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
/** /**
* 批量新增${subTable.functionName} * 批量新增${subTable.functionName}
@ -77,7 +77,7 @@ public interface ${ClassName}Mapper
* @param ${subclassName}List ${subTable.functionName}列表 * @param ${subclassName}List ${subTable.functionName}列表
* @return 结果 * @return 结果
*/ */
public int batch${subClassName}(List<${subClassName}> ${subclassName}List); int batch${subClassName}(List<${subClassName}> ${subclassName}List);
/** /**
@ -86,6 +86,6 @@ public interface ${ClassName}Mapper
* @param ${pkColumn.javaField} ${functionName}ID * @param ${pkColumn.javaField} ${functionName}ID
* @return 结果 * @return 结果
*/ */
public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
#end #end
} }

View File

@ -7,7 +7,7 @@ import ${packageName}.domain.${ClassName};
* ${functionName}Service接口 * ${functionName}Service接口
* *
* @author ${author} * @author ${author}
* @date ${datetime} * ${datetime}
*/ */
public interface I${ClassName}Service public interface I${ClassName}Service
{ {
@ -25,7 +25,7 @@ public interface I${ClassName}Service
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return ${functionName}集合 * @return ${functionName}集合
*/ */
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); List<${ClassName}> select${ClassName}List(${ClassName} ${className});
/** /**
* 新增${functionName} * 新增${functionName}
@ -33,7 +33,7 @@ public interface I${ClassName}Service
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int insert${ClassName}(${ClassName} ${className}); int insert${ClassName}(${ClassName} ${className});
/** /**
* 修改${functionName} * 修改${functionName}
@ -41,7 +41,7 @@ public interface I${ClassName}Service
* @param ${className} ${functionName} * @param ${className} ${functionName}
* @return 结果 * @return 结果
*/ */
public int update${ClassName}(${ClassName} ${className}); int update${ClassName}(${ClassName} ${className});
/** /**
* 批量删除${functionName} * 批量删除${functionName}
@ -49,7 +49,7 @@ public interface I${ClassName}Service
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
/** /**
* 删除${functionName}信息 * 删除${functionName}信息
@ -57,5 +57,5 @@ public interface I${ClassName}Service
* @param ${pkColumn.javaField} ${functionName}主键 * @param ${pkColumn.javaField} ${functionName}主键
* @return 结果 * @return 结果
*/ */
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
} }

View File

@ -7,7 +7,7 @@ import com.ruoyi.common.utils.DateUtils;
#break #break
#end #end
#end #end
import org.springframework.beans.factory.annotation.Autowired; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
#if($table.sub) #if($table.sub)
import java.util.ArrayList; import java.util.ArrayList;
@ -23,12 +23,12 @@ import ${packageName}.service.I${ClassName}Service;
* ${functionName}Service业务层处理 * ${functionName}Service业务层处理
* *
* @author ${author} * @author ${author}
* @date ${datetime} * ${datetime}
*/ */
@Service @Service
public class ${ClassName}ServiceImpl implements I${ClassName}Service public class ${ClassName}ServiceImpl implements I${ClassName}Service
{ {
@Autowired @Resource
private ${ClassName}Mapper ${className}Mapper; private ${ClassName}Mapper ${className}Mapper;
/** /**

View File

@ -12,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* ${subTable.functionName}对象 ${subTableName} * ${subTable.functionName}对象 ${subTableName}
* *
* @author ${author} * @author ${author}
* @date ${datetime} * ${datetime}
*/ */
public class ${subClassName} extends BaseEntity public class ${subClassName} extends BaseEntity
{ {