版权声明:java洪君 https://blog.csdn.net/qq_43532342/article/details/85209644
/**
* 新增 cType?
*
* @param cType
* @return
*/
@RequestMapping("/addType")
public boolean insertcType(@RequestBody cType cType){
return cTypeService.insert(cType);
}
/**
* 删除
* /fd/cost/delType?typeId=4
* @param typeId
* @return
*/
@RequestMapping("/delType")
public boolean deletecTypeById(@RequestParam Integer typeId){
return cTypeService.deleteById(typeId);
}
/**
* 批量删除?
* /fd/cost/delTypes
* @param typeIds
* @return
*/
@RequestMapping("/delTypes")
public boolean deletecTypeBatchIds(@RequestParam List<Integer> typeIds){
return cTypeService.deleteBatchIds(typeIds);
}
/**
* 修改?
* @param cType
* @return
*/
@RequestMapping("/updType")
public boolean updatecTypeById(@RequestParam cType cType){
return cTypeService.updateById(cType);
}
/**
* 费用类型 分页 page=页码,第几页 limit=大小,几条 isAsc排序
* 参数:page=2&limit=2&isAsc=false FatherId=一级 Status=正常
* 路径:/fd/cost/typePage
* @param map
* @return
*/
@RequestMapping("/typePage")
public Page<cType> selectcTypePage(@RequestParam Map<String,Object> map){
cType cType=new cType();
cType.setFatherId(-1);
cType.setStatus(1);
return cTypeService.selectPage(new Query<>(map),new EntityWrapper<>(cType));
}
/**
* 根据id 查 费用类型
*参数:/fd/cost/getTypeById?typeId=3
* @return
*/
@RequestMapping("/getTypeById")
public cType selectTypeById(@RequestParam Integer typeId){
return cTypeService.selectById(typeId);
}
/**
* 所有数据 费用类型
* /fd/cost/types FatherId -1=一级 Status 1=正常
* @return
*/
@RequestMapping("/types")
public List<cType> selectcTypeList(){
cType cType=new cType();
cType.setFatherId(-1);
cType.setStatus(1);
return cTypeService.selectList(new EntityWrapper<>(cType));
}