
controller.CheckInformationController
package com.lc.modules.fin.checkInformation.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lc.modules.fin.checkInformation.entity.CheckInformation;
import com.lc.modules.fin.checkInformation.mapper.CheckInformationMapper;
import com.lc.modules.fin.checkInformation.service.ICheckInformationService;
import com.lc.modules.fin.system.entity.DocumentItemConfig;
import org.apache.catalina.User;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/checkInformation")
public class CheckInformationController {
@Autowired
CheckInformationMapper mapper;
@Resource
ICheckInformationService iCheckInformationService;
@GetMapping(value = "/getCheckInformationList")
public Result checkInformationDataQuery(@RequestParam(name = "orgId", required = true) String orgId,
@RequestParam(name = "pageNo", required = true) Integer pageNo,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
@RequestParam(name = "keyword", required = false) String keyword
) {
Result<IPage<CheckInformation>> result = new Result<>();
LambdaQueryWrapper<CheckInformation> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(CheckInformation::getOrgId,orgId).orderByDesc(CheckInformation::getOperateTime);
if(StringUtils.isNotBlank(keyword)){
queryWrapper.like(CheckInformation::getPayee,keyword).
or().like(CheckInformation::getAmount,keyword).
or().like(CheckInformation::getPurpose,keyword).
or().like(CheckInformation::getCreateBy,keyword).
or().like(CheckInformation::getCreateBy,keyword).
or().like(CheckInformation::getOperateTime,keyword).
or().like(CheckInformation::getChequeNum,keyword).
or().like(CheckInformation::getIssuingBankNum,keyword).
or().like(CheckInformation::getDraftData,keyword);
}
IPage<CheckInformation> pageList = null;
Page<CheckInformation> page = new Page<CheckInformation>(pageNo, pageSize);
pageList = mapper.selectPage(page, queryWrapper);
result.setResult(pageList);
return result;
}
@PostMapping(value = "/addCheckInformationList")
public Boolean saveUser(@RequestBody CheckInformation checkInformation){
System.out.println(checkInformation);
int i = mapper.insert(checkInformation);
return i == 1;
}
@PutMapping(value = "/updateCheckInformationList/{uid}")
public Boolean updateUser(@PathVariable("uid") String uid ,@RequestBody CheckInformation checkInformation){
System.out.println(checkInformation);
int update =mapper.updateById(checkInformation);
return update == 1;
}
@DeleteMapping(value = "/delList/{id}")
public Boolean deleteUser(@PathVariable("id") String id) {
int delete = mapper.deleteById(id);
return delete == 1;
}
}
entity.CheckInformation
package com.lc.modules.fin.checkInformation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("check_information")
public class CheckInformation implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "ID", type = IdType.ASSIGN_ID)
private String id;
private String createBy;
private Date createTime;
private String orgId;
private String workstation;
private String uid;
private String payee;
private String amount;
private String purpose;
private String draftData;
private String operator;
private String chequeNum;
private String operateTime;
private String issuingBankNum;
private boolean disabled;
}
mapper.CheckInformationMapper
package com.lc.modules.fin.checkInformation.mapper;
import com.lc.modules.fin.checkInformation.entity.CheckInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CheckInformationMapper extends BaseMapper<CheckInformation>{
}
mapper.xml.CheckInformation.xml
<?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.lc.modules.fin.checkInformation.mapper">
</mapper>
service.ICheckInformationService
package com.lc.modules.fin.checkInformation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lc.modules.fin.checkInformation.entity.CheckInformation;
public interface ICheckInformationService extends IService<CheckInformation> {
}
service.impl.ICheckInformationServiceImpl
package com.lc.modules.fin.checkInformation.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lc.modules.fin.checkInformation.entity.CheckInformation;
import com.lc.modules.fin.checkInformation.mapper.CheckInformationMapper;
import com.lc.modules.fin.checkInformation.service.ICheckInformationService;
import org.springframework.stereotype.Service;
@Service
public class ICheckInformationServiceImpl extends ServiceImpl<CheckInformationMapper, CheckInformation> implements ICheckInformationService {
}
数据库表头
CREATE TABLE "check_information"
(
"id" VARCHAR(100) NOT NULL,
"payee" VARCHAR(150),
"amount" VARCHAR(150),
"purpose" VARCHAR(150),
"draft_data" VARCHAR(150),
"operator" VARCHAR(150),
"cheque_num" VARCHAR(60),
"operate_time" VARCHAR(60),
"UID" VARCHAR(150) NOT NULL,
"CREATE_BY" VARCHAR(150),
"CREATE_TIME" TIMESTAMP(0),
"ORG_ID" VARCHAR(150),
"WORKSTATION" VARCHAR(200) DEFAULT '',
"disabled" BIT DEFAULT 0,
"issuing_bank_num" VARCHAR(100)) STORAGE(ON "MAIN", CLUSTERBTR) ;