| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import com.panzhihua.service_property.service.ComPropertyEquipmentService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param comPropertyEquipment 查询实体 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping("queryAll") |
| | | public R selectAll(Page<ComPropertyEquipment> page, ComPropertyEquipment comPropertyEquipment) { |
| | | return R.ok(this.comPropertyEquipmentService.page(page, new QueryWrapper<>(comPropertyEquipment))); |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comPropertyEquipmentService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyEquipment comPropertyEquipment) { |
| | | return R.ok(this.comPropertyEquipmentService.save(comPropertyEquipment)); |
| | | public R insert(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | ComPropertyEquipment comPropertyEquipment=new ComPropertyEquipment(); |
| | | BeanUtils.copyProperties(comPropertyEquipmentVO,comPropertyEquipment); |
| | | return this.comPropertyEquipmentService.insert(comPropertyEquipment); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyEquipment comPropertyEquipment) { |
| | | public R update(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | ComPropertyEquipment comPropertyEquipment=new ComPropertyEquipment(); |
| | | BeanUtils.copyProperties(comPropertyEquipmentVO,comPropertyEquipment); |
| | | return R.ok(this.comPropertyEquipmentService.updateById(comPropertyEquipment)); |
| | | } |
| | | |