1.mybatisplus改动参考
This commit is contained in:
parent
998144de47
commit
67748a8c6e
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.bill.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -64,9 +65,9 @@ public class PoundBillController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('measurement:poundbill:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(poundBillService.selectPoundBillById(id));
|
||||
return success(poundBillService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,7 +78,7 @@ public class PoundBillController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PoundBill poundBill)
|
||||
{
|
||||
return toAjax(poundBillService.insertPoundBill(poundBill));
|
||||
return toAjax(poundBillService.save(poundBill));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,7 +89,7 @@ public class PoundBillController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PoundBill poundBill)
|
||||
{
|
||||
return toAjax(poundBillService.updatePoundBill(poundBill));
|
||||
return toAjax(poundBillService.updateById(poundBill));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,8 +98,8 @@ public class PoundBillController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('measurement:poundbill:remove')")
|
||||
@Log(title = "磅单信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(poundBillService.deletePoundBillByIds(ids));
|
||||
return toAjax(poundBillService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,10 @@ package com.ruoyi.bill.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
@ -14,12 +18,14 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
* @author ptt
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@TableName(value = "t_data_poundbill")
|
||||
public class PoundBill extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
|
@ -253,12 +259,12 @@ public class PoundBill extends BaseEntity
|
|||
@Excel(name = "最后修改人")
|
||||
private String lstedtopr;
|
||||
|
||||
public void setId(Long id)
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.bill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.bill.domain.PoundBill;
|
||||
|
||||
/**
|
||||
|
@ -9,7 +11,7 @@ import com.ruoyi.bill.domain.PoundBill;
|
|||
* @author ptt
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface PoundBillMapper
|
||||
public interface PoundBillMapper extends BaseMapper<PoundBill>
|
||||
{
|
||||
/**
|
||||
* 查询磅单信息
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.ruoyi.bill.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.bill.domain.PoundBill;
|
||||
import com.ruoyi.system.domain.SysStudent;
|
||||
|
||||
/**
|
||||
* 磅单信息Service接口
|
||||
|
@ -9,7 +12,7 @@ import com.ruoyi.bill.domain.PoundBill;
|
|||
* @author ptt
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface IPoundBillService
|
||||
public interface IPoundBillService extends IService<PoundBill>
|
||||
{
|
||||
/**
|
||||
* 查询磅单信息
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.ruoyi.bill.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bill.mapper.PoundBillMapper;
|
||||
|
@ -14,7 +19,7 @@ import com.ruoyi.bill.service.IPoundBillService;
|
|||
* @date 2025-06-03
|
||||
*/
|
||||
@Service
|
||||
public class PoundBillServiceImpl implements IPoundBillService
|
||||
public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill> implements IPoundBillService
|
||||
{
|
||||
@Autowired
|
||||
private PoundBillMapper poundBillMapper;
|
||||
|
@ -43,6 +48,8 @@ public class PoundBillServiceImpl implements IPoundBillService
|
|||
return poundBillMapper.selectPoundBillList(poundBill);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增磅单信息
|
||||
*
|
||||
|
|
|
@ -4,6 +4,8 @@ import java.io.Serializable;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
@ -19,20 +21,25 @@ public class BaseEntity implements Serializable
|
|||
|
||||
/** 搜索值 */
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(exist = false)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(exist = false)
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(exist = false)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(exist = false)
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
|
@ -40,6 +47,7 @@ public class BaseEntity implements Serializable
|
|||
|
||||
/** 请求参数 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public String getSearchValue()
|
||||
|
|
Loading…
Reference in New Issue