资产管理CRUD
This commit is contained in:
parent
f6bc245454
commit
061989c1ab
@ -21,4 +21,11 @@ public class DictBaseConstants {
|
||||
public static final String COMPANY_STAFF_EDU = "company_staff_edu";
|
||||
/**企业资质临期判定时间*/
|
||||
public static final String COMPANY_QUALS_EXPIRED = "company_quals_expired";
|
||||
/** 价值类型 */
|
||||
public static final String COMPANY_COST_TYPE = "company_cost_type";
|
||||
/** 资产状态 */
|
||||
public static final String COMPANY_PROP_STATUS = "company_prop_status";
|
||||
/** 时间周期字典 */
|
||||
public static final String CYCLE_DICT = "cycle_dict";
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,17 @@
|
||||
package cn.iocoder.yudao.module.property.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.property.entity.Property;
|
||||
import cn.iocoder.yudao.module.property.service.PropertyService;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyReqVO;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyRespVO;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -19,14 +21,24 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 企业管理-资产")
|
||||
/**
|
||||
* 企业管理-资产管理 控制层
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:41 2024/8/15
|
||||
**/
|
||||
@RestController
|
||||
@Tag(name = "企业管理 - 资产管理")
|
||||
@RequestMapping("/company/property")
|
||||
@Validated
|
||||
public class PropertyController {
|
||||
@ -34,30 +46,49 @@ public class PropertyController {
|
||||
@Resource
|
||||
private PropertyService propertyService;
|
||||
|
||||
/**
|
||||
* 企业管理-资产分页
|
||||
*
|
||||
* @param pageReqVO 查询对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
* @author 小李
|
||||
* @date 16:15 2024/8/15
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得企业管理-资产分页")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:query')")
|
||||
public CommonResult<IPage<?>> getPropertyPage(PropertyReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<Property> page = new Page<>(pageNo, pageSize);
|
||||
IPage<Property> pageResult = propertyService.getPropertyPage(pageReqVO, page);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建资产
|
||||
*
|
||||
* @param createReqVO
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/15
|
||||
**/
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建企业管理-资产")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:create')")
|
||||
public CommonResult<String> createProperty(@RequestBody PropertyReqVO createReqVO) {
|
||||
return success(propertyService.createProperty(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新企业管理-资产")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:update')")
|
||||
public CommonResult<Boolean> updateProperty(@RequestBody PropertyReqVO updateReqVO) {
|
||||
propertyService.updateProperty(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除企业管理-资产")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('company:property:delete')")
|
||||
public CommonResult<Boolean> deleteProperty(@RequestParam("id") String id) {
|
||||
propertyService.deleteProperty(id);
|
||||
return success(true);
|
||||
public CommonResult createProperty(@RequestBody PropertyReqVO createReqVO) {
|
||||
propertyService.createProperty(createReqVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得资产记录
|
||||
*
|
||||
* @param id 资产ID
|
||||
* @author 小李
|
||||
* @date 18:45 2024/8/15
|
||||
**/
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得企业管理-资产")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@ -67,24 +98,66 @@ public class PropertyController {
|
||||
return success(BeanUtils.toBean(property, PropertyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得企业管理-资产分页")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:query')")
|
||||
public CommonResult<IPage<PropertyRespVO>> getPropertyPage(PropertyReqVO pageReqVO) {
|
||||
IPage<PropertyRespVO> pageResult = propertyService.getPropertyPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
/**
|
||||
* 更新资产
|
||||
* @author 小李
|
||||
* @date 18:57 2024/8/15
|
||||
* @param updateReqVO 资产对象
|
||||
**/
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新企业管理-资产")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:update')")
|
||||
public CommonResult<Boolean> updateProperty(@RequestBody PropertyReqVO updateReqVO) {
|
||||
propertyService.updateProperty(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
* @author 小李
|
||||
* @date 19:20 2024/8/15
|
||||
* @param id 资产ID
|
||||
**/
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除企业管理-资产")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('company:property:delete')")
|
||||
public CommonResult<Boolean> deleteProperty(@RequestParam("id") String id) {
|
||||
propertyService.deleteProperty(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产数据
|
||||
* @author 小李
|
||||
* @date 20:02 2024/8/15
|
||||
* @param pageReqVO
|
||||
* @param response
|
||||
**/
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出企业管理-资产 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('company:property:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPropertyExcel(PropertyReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PropertyRespVO> list = propertyService.getPropertyPage(pageReqVO).getRecords();
|
||||
int pageNo = 1, pageSize = 100;
|
||||
List<Property> list = new ArrayList<>();
|
||||
while (true){
|
||||
Page<Property> page = new Page<>(pageNo, pageSize);
|
||||
IPage<Property> propertyPage = propertyService.getPropertyPage(pageReqVO, page);
|
||||
if (ObjectUtil.isNotEmpty(propertyPage) && !propertyPage.getRecords().isEmpty()){
|
||||
list.addAll(propertyPage.getRecords());
|
||||
pageNo++;
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "企业管理-资产.xls", "数据", PropertyRespVO.class, list);
|
||||
Map<Integer, Integer> columnWidthMap = new HashMap<>();
|
||||
// 第一列的索引是0,宽度设置为20个字符宽
|
||||
columnWidthMap.put(9, 20);
|
||||
columnWidthMap.put(10, 20);
|
||||
ExcelUtils.write(response, "企业管理-资产.xls", "数据", Property.class, list, columnWidthMap);
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +1,11 @@
|
||||
package cn.iocoder.yudao.module.property.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.property.entity.PropertyPos;
|
||||
import cn.iocoder.yudao.module.property.service.PropertyPosService;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyPosReqVO;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyPosRespVO;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -21,11 +16,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 企业管理-资产存放位置")
|
||||
|
@ -1,151 +1,165 @@
|
||||
package cn.iocoder.yudao.module.property.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.*;
|
||||
|
||||
/**
|
||||
* 企业管理-资产 DO
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
* 企业管理-资产管理
|
||||
* @author 小李
|
||||
* @date 16:37 2024/8/15
|
||||
**/
|
||||
@TableName("company_property")
|
||||
@KeySequence("company_property_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ExcelIgnoreUnannotated
|
||||
public class Property extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
/** 主键标识 */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
|
||||
/** 企业id(base_company表中的id) */
|
||||
private String corpId;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
|
||||
/** 部门id(system_dept表中的id,用来做数据权限控制) */
|
||||
private Long deptId;
|
||||
/**
|
||||
* 存放位置
|
||||
*/
|
||||
|
||||
/** 存放位置id(company_property_pos) */
|
||||
private String posId;
|
||||
/**
|
||||
* 使用人id
|
||||
*/
|
||||
|
||||
/** 使用人id(sys_users) */
|
||||
private String userId;
|
||||
/**
|
||||
* 资产编号
|
||||
*/
|
||||
|
||||
/** 资产编号 */
|
||||
@ExcelProperty("资产编号")
|
||||
private String propNo;
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
|
||||
/** 资产名称 */
|
||||
@ExcelProperty("资产名称")
|
||||
private String propName;
|
||||
/**
|
||||
* 资产分类
|
||||
*/
|
||||
|
||||
/** 资产分类(分类字典) */
|
||||
@ExcelProperty("资产分类")
|
||||
private String propCatg;
|
||||
/**
|
||||
* 预计使用年限
|
||||
*/
|
||||
|
||||
/** 预计使用年限 */
|
||||
@ExcelProperty("预计使用年限")
|
||||
private Integer useYear;
|
||||
/**
|
||||
* 价值类型
|
||||
*
|
||||
* 枚举 {@link TODO company_cost_type 对应的类}
|
||||
*/
|
||||
|
||||
/** 价值类型 */
|
||||
@ExcelProperty(value = "价值类型", converter = DictConvert.class)
|
||||
@DictFormat(COMPANY_COST_TYPE)
|
||||
private String costType;
|
||||
/**
|
||||
* 资产数量
|
||||
*/
|
||||
|
||||
/** 资产数量 */
|
||||
@ExcelProperty("资产数量")
|
||||
private Integer propNum;
|
||||
/**
|
||||
* 资产原值(元)
|
||||
*/
|
||||
|
||||
/** 资产原值(元) */
|
||||
@ExcelProperty("资产原值")
|
||||
private BigDecimal costTotal;
|
||||
/**
|
||||
* 资产状态
|
||||
*
|
||||
* 枚举 {@link TODO company_prop_status 对应的类}
|
||||
*/
|
||||
|
||||
/** 资产状态 */
|
||||
@ExcelProperty(value = "资产状态", converter = DictConvert.class)
|
||||
@DictFormat(COMPANY_PROP_STATUS)
|
||||
private String propStatus;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
|
||||
/** 品牌 */
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
|
||||
/** 规格型号 */
|
||||
@ExcelProperty("规格型号")
|
||||
private String spec;
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
|
||||
/** 生产厂家 */
|
||||
@ExcelProperty("生产厂家")
|
||||
private String factory;
|
||||
/**
|
||||
* 出场序列号/编号
|
||||
*/
|
||||
|
||||
/** 出场序列号/编号 */
|
||||
@ExcelProperty("出场序列号/编号")
|
||||
private String serialNo;
|
||||
/**
|
||||
* 数量计量单位
|
||||
*/
|
||||
|
||||
/** 数量计量单位 */
|
||||
@ExcelProperty("数量计量单位")
|
||||
private String unit;
|
||||
/**
|
||||
* 取得日期
|
||||
*/
|
||||
private LocalDateTime getDate;
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
private LocalDate prodDate;
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
|
||||
/** 取得日期 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("取得日期")
|
||||
private Date getDate;
|
||||
|
||||
/** 出厂日期 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("出厂日期")
|
||||
private Date prodDate;
|
||||
|
||||
/** 供应商 */
|
||||
@ExcelProperty("供应商")
|
||||
private String supplier;
|
||||
/**
|
||||
* 启用日期
|
||||
*/
|
||||
private LocalDate openDate;
|
||||
/**
|
||||
* 净值(元)
|
||||
*/
|
||||
|
||||
/** 启用日期 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("启用日期")
|
||||
private Date openDate;
|
||||
|
||||
/** 净值(元) */
|
||||
@ExcelProperty("净值")
|
||||
private BigDecimal netValue;
|
||||
/**
|
||||
* 凭证号
|
||||
*/
|
||||
|
||||
/** 凭证号 */
|
||||
@ExcelProperty("凭证号")
|
||||
private String voucherNo;
|
||||
/**
|
||||
* 维修/保养周期单位
|
||||
*/
|
||||
|
||||
/** 维修/保养周期单位(年/月/天) */
|
||||
@ExcelProperty(value = "维修/保养周期单位", converter = DictConvert.class)
|
||||
@DictFormat(CYCLE_DICT)
|
||||
private String keepCycleType;
|
||||
/**
|
||||
* 维修/保养周期
|
||||
*/
|
||||
|
||||
/** 维修/保养周期(具体数字) */
|
||||
@ExcelProperty("维修/保养周期")
|
||||
private Integer keepCycle;
|
||||
/**
|
||||
* 上次维修/保养日期
|
||||
*/
|
||||
private LocalDate lastKeepDate;
|
||||
/**
|
||||
* 下次维修/保养日期
|
||||
*/
|
||||
private LocalDate nextKeepDate;
|
||||
/**
|
||||
* 附件urls
|
||||
*/
|
||||
|
||||
/** 上次维修/保养日期 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("上次维修/保养日期")
|
||||
private Date lastKeepDate;
|
||||
|
||||
/** 下次维修/保养日期 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("下次维修/保养日期")
|
||||
private Date nextKeepDate;
|
||||
|
||||
/** 附件urls(infra_file表中的url,多个英文逗号拼接) */
|
||||
@ExcelProperty("附件")
|
||||
private String fileUrls;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("使用人")
|
||||
private String staffName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("存放位置")
|
||||
private String posName;
|
||||
}
|
@ -5,18 +5,23 @@ import cn.iocoder.yudao.module.property.vo.PropertyReqVO;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 企业管理-资产 Mapper
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
* 企业管理-资产管理 mapper
|
||||
* @author 小李
|
||||
* @date 16:40 2024/8/15
|
||||
**/
|
||||
@Mapper
|
||||
public interface PropertyMapper extends BaseMapper<Property> {
|
||||
|
||||
default IPage<PropertyRespVO> selectPage(PropertyReqVO reqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业管理-资产分页
|
||||
* @author 小李
|
||||
* @date 16:15 2024/8/15
|
||||
* @param pageReqVO 查询对象
|
||||
**/
|
||||
IPage<Property> getPropertyPage(@Param("map") PropertyReqVO pageReqVO, Page<Property> page);
|
||||
}
|
@ -2,53 +2,55 @@ package cn.iocoder.yudao.module.property.service;
|
||||
|
||||
import cn.iocoder.yudao.module.property.entity.Property;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyReqVO;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 企业管理-资产 Service 接口
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
* 企业管理-资产管理 接口
|
||||
* @author 小李
|
||||
* @date 16:40 2024/8/15
|
||||
**/
|
||||
public interface PropertyService extends IService<Property> {
|
||||
|
||||
/**
|
||||
* 创建企业管理-资产
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createProperty(PropertyReqVO createReqVO);
|
||||
* 企业管理-资产分页
|
||||
* @author 小李
|
||||
* @date 16:15 2024/8/15
|
||||
* @param pageReqVO 查询对象
|
||||
**/
|
||||
IPage<Property> getPropertyPage(PropertyReqVO pageReqVO, Page<Property> page);
|
||||
|
||||
/**
|
||||
* 更新企业管理-资产
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProperty(PropertyReqVO updateReqVO);
|
||||
* 创建资产
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/15
|
||||
* @param createReqVO
|
||||
**/
|
||||
void createProperty(PropertyReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 删除企业管理-资产
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProperty(String id);
|
||||
|
||||
/**
|
||||
* 获得企业管理-资产
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 企业管理-资产
|
||||
*/
|
||||
* 获得资产记录
|
||||
* @author 小李
|
||||
* @date 18:45 2024/8/15
|
||||
* @param id 资产ID
|
||||
**/
|
||||
Property getProperty(String id);
|
||||
|
||||
/**
|
||||
* 获得企业管理-资产分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 企业管理-资产分页
|
||||
*/
|
||||
IPage<PropertyRespVO> getPropertyPage(PropertyReqVO pageReqVO);
|
||||
* 更新资产
|
||||
* @author 小李
|
||||
* @date 18:57 2024/8/15
|
||||
* @param updateReqVO 资产对象
|
||||
**/
|
||||
void updateProperty(PropertyReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
* @author 小李
|
||||
* @date 19:20 2024/8/15
|
||||
* @param id 资产ID
|
||||
**/
|
||||
void deleteProperty(String id);
|
||||
|
||||
}
|
@ -1,58 +1,98 @@
|
||||
package cn.iocoder.yudao.module.property.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.property.entity.Property;
|
||||
import cn.iocoder.yudao.module.property.mapper.PropertyMapper;
|
||||
import cn.iocoder.yudao.module.property.service.PropertyService;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyReqVO;
|
||||
import cn.iocoder.yudao.module.property.vo.PropertyRespVO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 企业管理-资产 Service 实现类
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
* 企业管理-资产管理 接口实现类
|
||||
* @author 小李
|
||||
* @date 16:41 2024/8/15
|
||||
**/
|
||||
@Service
|
||||
@Validated
|
||||
public class PropertyServiceImpl extends ServiceImpl<PropertyMapper, Property> implements PropertyService {
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
/**
|
||||
* 企业管理-资产分页
|
||||
* @author 小李
|
||||
* @date 16:15 2024/8/15
|
||||
* @param pageReqVO 查询对象
|
||||
**/
|
||||
@Override
|
||||
public String createProperty(PropertyReqVO createReqVO) {
|
||||
// 插入
|
||||
Property property = BeanUtils.toBean(createReqVO, Property.class);
|
||||
baseMapper.insert(property);
|
||||
// 返回
|
||||
return property.getId();
|
||||
public IPage<Property> getPropertyPage(PropertyReqVO pageReqVO, Page<Property> page){
|
||||
return baseMapper.getPropertyPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建资产
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/15
|
||||
* @param createReqVO
|
||||
**/
|
||||
@Override
|
||||
public void updateProperty(PropertyReqVO updateReqVO) {
|
||||
// 更新
|
||||
Property updateObj = BeanUtils.toBean(updateReqVO, Property.class);
|
||||
baseMapper.updateById(updateObj);
|
||||
@DSTransactional
|
||||
public void createProperty(PropertyReqVO createReqVO){
|
||||
// 获取当前登录用户部门ID和企业ID
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
createReqVO.setDeptId(user.getDeptId());
|
||||
DeptRespDTO dept = deptApi.getDept(user.getDeptId());
|
||||
createReqVO.setCorpId(dept.getCorpId());
|
||||
|
||||
// 创建资产
|
||||
baseMapper.insert(createReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得资产记录
|
||||
* @author 小李
|
||||
* @date 18:45 2024/8/15
|
||||
* @param id 资产ID
|
||||
**/
|
||||
@Override
|
||||
public void deleteProperty(String id) {
|
||||
// 删除
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty(String id) {
|
||||
public Property getProperty(String id){
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资产
|
||||
* @author 小李
|
||||
* @date 18:57 2024/8/15
|
||||
* @param updateReqVO 资产对象
|
||||
**/
|
||||
@Override
|
||||
public IPage<PropertyRespVO> getPropertyPage(PropertyReqVO pageReqVO) {
|
||||
Page<Property> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
|
||||
return null;
|
||||
public void updateProperty(PropertyReqVO updateReqVO){
|
||||
baseMapper.updateById(updateReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
* @author 小李
|
||||
* @date 19:20 2024/8/15
|
||||
* @param id 资产ID
|
||||
**/
|
||||
public void deleteProperty(String id){
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
}
|
@ -1,114 +1,27 @@
|
||||
package cn.iocoder.yudao.module.property.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.property.entity.Property;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 企业管理-资产分页 Request VO")
|
||||
/**
|
||||
* 企业管理-资产管理 查询VO
|
||||
* @author 小李
|
||||
* @date 16:37 2024/8/15
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PropertyReqVO extends PageParam {
|
||||
public class PropertyReqVO extends Property {
|
||||
|
||||
@Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "22729")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "企业id", example = "9124")
|
||||
private String corpId;
|
||||
|
||||
@Schema(description = "部门id", example = "2480")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "存放位置", example = "7241")
|
||||
private String posId;
|
||||
|
||||
@Schema(description = "使用人id", example = "6217")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "资产编号")
|
||||
private String propNo;
|
||||
|
||||
@Schema(description = "资产名称", example = "芋艿")
|
||||
private String propName;
|
||||
|
||||
@Schema(description = "资产分类")
|
||||
private String propCatg;
|
||||
|
||||
@Schema(description = "预计使用年限")
|
||||
private Integer useYear;
|
||||
|
||||
@Schema(description = "价值类型", example = "01")
|
||||
private String costType;
|
||||
|
||||
@Schema(description = "资产数量")
|
||||
private Integer propNum;
|
||||
|
||||
@Schema(description = "资产原值(元)")
|
||||
private BigDecimal costTotal;
|
||||
|
||||
@Schema(description = "资产状态", example = "02")
|
||||
private String propStatus;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "生产厂家")
|
||||
private String factory;
|
||||
|
||||
@Schema(description = "出场序列号/编号")
|
||||
private String serialNo;
|
||||
|
||||
@Schema(description = "数量计量单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "取得日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime getDate;
|
||||
|
||||
@Schema(description = "出厂日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime prodDate;
|
||||
|
||||
@Schema(description = "供应商")
|
||||
private String supplier;
|
||||
|
||||
@Schema(description = "启用日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime openDate;
|
||||
|
||||
@Schema(description = "净值(元)")
|
||||
private BigDecimal netValue;
|
||||
|
||||
@Schema(description = "凭证号")
|
||||
private String voucherNo;
|
||||
|
||||
@Schema(description = "维修/保养周期单位", example = "2")
|
||||
private String keepCycleType;
|
||||
|
||||
@Schema(description = "维修/保养周期")
|
||||
private Integer keepCycle;
|
||||
|
||||
@Schema(description = "上次维修/保养日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime lastKeepDate;
|
||||
|
||||
@Schema(description = "下次维修/保养日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime nextKeepDate;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "取得日期查询范围")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] getDateArray;
|
||||
|
||||
@Schema(description = "启用日期查询范围")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] openDateArray;
|
||||
}
|
@ -1,20 +1,13 @@
|
||||
package cn.iocoder.yudao.module.property.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.property.entity.Property;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 企业管理-资产 Response VO")
|
||||
/**
|
||||
* 企业管理-资产管理 响应或提交VO
|
||||
* @author 小李
|
||||
* @date 16:38 2024/8/15
|
||||
**/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PropertyRespVO extends Property {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.staff.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -137,12 +139,19 @@ public class CompanyStaffController {
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCompanyStaffExcel(CompanyStaffReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletResponse response) throws IOException {
|
||||
Page<CompanyStaff> page = new Page<>(pageNo, pageSize);
|
||||
IPage<CompanyStaff> staffIPage = staffService.queryListPage(pageReqVO, page);
|
||||
List<CompanyStaff> list = staffIPage.getRecords();
|
||||
int pageNo = 1, pageSize = 100;
|
||||
List<CompanyStaff> list = new ArrayList<>();
|
||||
while (true){
|
||||
Page<CompanyStaff> page = new Page<>(pageNo, pageSize);
|
||||
IPage<CompanyStaff> staffIPage = staffService.queryListPage(pageReqVO, page);
|
||||
if (ObjectUtil.isNotEmpty(staffIPage) && !staffIPage.getRecords().isEmpty()){
|
||||
list.addAll(staffIPage.getRecords());
|
||||
pageNo++;
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 导出 Excel
|
||||
Map<Integer, Integer> columnWidthMap = new HashMap<>();
|
||||
// 第一列的索引是0,宽度设置为20个字符宽
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.staff.entity;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
@ -17,11 +16,11 @@ import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.*;
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.COMPANY_STAFF_EDU;
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.DICT_SYS_USER_SEX;
|
||||
|
||||
/**
|
||||
* 企业管理-员工信息实体
|
||||
|
@ -1,12 +1,119 @@
|
||||
<?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="cn.iocoder.yudao.module.company.dal.mysql.property.PropertyMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.property.mapper.PropertyMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.property.entity.Property">
|
||||
<id property="id" column="cp_id" jdbcType="VARCHAR"/>
|
||||
<result property="corpId" column="cp_corp_id" jdbcType="VARCHAR"/>
|
||||
<result property="deptId" column="cp_dept_id" jdbcType="BIGINT"/>
|
||||
<result property="posId" column="cp_pos_id" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="cp_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="propNo" column="cp_prop_no" jdbcType="VARCHAR"/>
|
||||
<result property="propName" column="cp_prop_name" jdbcType="VARCHAR"/>
|
||||
<result property="propCatg" column="cp_prop_catg" jdbcType="VARCHAR"/>
|
||||
<result property="useYear" column="cp_use_year" jdbcType="INTEGER"/>
|
||||
<result property="costType" column="cp_cost_type" jdbcType="VARCHAR"/>
|
||||
<result property="propNum" column="cp_prop_num" jdbcType="INTEGER"/>
|
||||
<result property="costTotal" column="cp_cost_total" jdbcType="DECIMAL"/>
|
||||
<result property="propStatus" column="cp_prop_status" jdbcType="VARCHAR"/>
|
||||
<result property="brand" column="cp_brand" jdbcType="VARCHAR"/>
|
||||
<result property="spec" column="cp_spec" jdbcType="VARCHAR"/>
|
||||
<result property="factory" column="cp_factory" jdbcType="VARCHAR"/>
|
||||
<result property="serialNo" column="cp_serial_no" jdbcType="VARCHAR"/>
|
||||
<result property="unit" column="cp_unit" jdbcType="VARCHAR"/>
|
||||
<result property="getDate" column="cp_get_date" jdbcType="DATE"/>
|
||||
<result property="prodDate" column="cp_prod_date" jdbcType="DATE"/>
|
||||
<result property="supplier" column="cp_supplier" jdbcType="VARCHAR"/>
|
||||
<result property="openDate" column="cp_open_date" jdbcType="DATE"/>
|
||||
<result property="netValue" column="cp_net_value" jdbcType="DECIMAL"/>
|
||||
<result property="voucherNo" column="cp_voucher_no" jdbcType="VARCHAR"/>
|
||||
<result property="keepCycleType" column="cp_keep_cycle_type" jdbcType="VARCHAR"/>
|
||||
<result property="keepCycle" column="cp_keep_cycle" jdbcType="INTEGER"/>
|
||||
<result property="lastKeepDate" column="cp_last_keep_date" jdbcType="DATE"/>
|
||||
<result property="nextKeepDate" column="cp_next_keep_date" jdbcType="DATE"/>
|
||||
<result property="fileUrls" column="cp_file_urls" jdbcType="VARCHAR"/>
|
||||
<result property="staffName" column="staff_name" jdbcType="VARCHAR" />
|
||||
<result property="posName" column="pos_name" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
SELECT cp.id AS cp_id,
|
||||
cp.corp_id AS cp_corp_id,
|
||||
cp.dept_id AS cp_dept_id,
|
||||
cp.pos_id AS cp_pos_id,
|
||||
cp.user_id AS cp_user_id,
|
||||
cp.prop_no AS cp_prop_no,
|
||||
cp.prop_name AS cp_prop_name,
|
||||
cp.prop_catg AS cp_prop_catg,
|
||||
cp.use_year AS cp_use_year,
|
||||
cp.cost_type AS cp_cost_type,
|
||||
cp.prop_num AS cp_prop_num,
|
||||
cp.cost_total AS cp_cost_total,
|
||||
cp.prop_status AS cp_prop_status,
|
||||
cp.brand AS cp_brand,
|
||||
cp.spec AS cp_spec,
|
||||
cp.factory AS cp_factory,
|
||||
cp.serial_no AS cp_serial_no,
|
||||
cp.unit AS cp_unit,
|
||||
cp.get_date AS cp_get_date,
|
||||
cp.prod_date AS cp_prod_date,
|
||||
cp.supplier AS cp_supplier,
|
||||
cp.open_date AS cp_open_date,
|
||||
cp.net_value AS cp_net_value,
|
||||
cp.voucher_no AS cp_voucher_no,
|
||||
cp.keep_cycle_type AS cp_keep_cycle_type,
|
||||
cp.keep_cycle AS cp_keep_cycle,
|
||||
cp.last_keep_date AS cp_last_keep_date,
|
||||
cp.next_keep_date AS cp_next_keep_date,
|
||||
cp.file_urls AS cp_file_urls,
|
||||
cs.name AS staff_name,
|
||||
cpp.pos_name AS pos_name
|
||||
FROM company_property cp
|
||||
LEFT JOIN company_staff cs ON cp.user_id = cs.user_id
|
||||
LEFT JOIN company_property_pos cpp ON cp.pos_id = cpp.id
|
||||
WHERE cp.deleted = '0'
|
||||
</sql>
|
||||
|
||||
<select id="getPropertyPage" resultMap="BaseResultMap">
|
||||
<include refid="Base_SQL"/>
|
||||
<if test="map.propNo != null and map.propNo != ''">
|
||||
ANd (cp.prop_no like concat('%', #{map.propNo}, '%'))
|
||||
</if>
|
||||
<if test="map.propName != null and map.propName != ''">
|
||||
AND (cp.prop_name like concat('%', #{map.propName}, '%'))
|
||||
</if>
|
||||
<if test="map.brand != null and map.brand != ''">
|
||||
AND (cp.brand like concat('%', #{map.brand}, '%'))
|
||||
</if>
|
||||
<if test="map.supplier != null and map.supplier != ''">
|
||||
AND (cp.supplier like concat('%', #{map.supplier}, '%'))
|
||||
</if>
|
||||
<if test="map.propCatg != null and map.propCatg != ''">
|
||||
AND (cp.prop_catg = #{map.propCatg})
|
||||
</if>
|
||||
<if test="map.costType != null and map.costType != ''">
|
||||
AND (cp.cost_type = #{map.costType})
|
||||
</if>
|
||||
<if test="map.propStatus != null and map.propStatus != ''">
|
||||
AND (cp.prop_status = #{map.propStatus})
|
||||
</if>
|
||||
<if test="map.voucherNo != null and map.voucherNo != ''">
|
||||
AND (cp.voucher_no like concat('%', #{map.voucherNo}, '%'))
|
||||
</if>
|
||||
<if test="map.factory != null and map.factory != ''">
|
||||
AND (cp.factory like concat('%', #{map.factory}, '%'))
|
||||
</if>
|
||||
<if test="map.posId != null and map.posId != ''">
|
||||
AND (cp.pos_id = #{map.posId})
|
||||
</if>
|
||||
<if test="map.userId != null and map.userId != ''">
|
||||
AND (cp.user_id = #{map.userId})
|
||||
</if>
|
||||
<if test="map.getDateArray != null and map.getDateArray.length > 0">
|
||||
AND (cp.get_date BETWEEN #{map.getDateArray[0]} AND #{map.getDateArray[1]})
|
||||
</if>
|
||||
<if test="map.openDateArray != null and map.openDateArray != ''">
|
||||
AND (cp.open_date BETWEEN #{map.openDateArray[0]} AND #{map.openDateArray[1]})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user