| src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/dto/DispatcherDTO.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/entity/Dispatcher.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/service/IDispatcherService.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
| src/main/java/org/springblade/modules/dispatcher/vo/DispatcherVO.java | ●●●●● patch | view | raw | blame | history |
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java
New file @@ -0,0 +1,126 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; import javax.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.dispatcher.entity.Dispatcher; import org.springblade.modules.dispatcher.vo.DispatcherVO; import org.springblade.modules.dispatcher.service.IDispatcherService; import org.springblade.core.boot.ctrl.BladeController; /** * 控制器 * * @author BladeX * @since 2021-07-07 */ @RestController @AllArgsConstructor @RequestMapping("/dispatcher") @Api(value = "", tags = "接口") public class DispatcherController extends BladeController { private final IDispatcherService dispatcherService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入dispatcher") public R<Dispatcher> detail(Dispatcher dispatcher) { Dispatcher detail = dispatcherService.getOne(Condition.getQueryWrapper(dispatcher)); return R.data(detail); } /** * 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入dispatcher") public R<IPage<Dispatcher>> list(Dispatcher dispatcher, Query query) { IPage<Dispatcher> pages = dispatcherService.page(Condition.getPage(query), Condition.getQueryWrapper(dispatcher)); return R.data(pages); } /** * 自定义分页 */ @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入dispatcher") public R<IPage<DispatcherVO>> page(DispatcherVO dispatcher, Query query) { IPage<DispatcherVO> pages = dispatcherService.selectDispatcherPage(Condition.getPage(query), dispatcher); return R.data(pages); } /** * 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入dispatcher") public R save(@Valid @RequestBody Dispatcher dispatcher) { return R.status(dispatcherService.save(dispatcher)); } /** * 修改 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入dispatcher") public R update(@Valid @RequestBody Dispatcher dispatcher) { return R.status(dispatcherService.updateById(dispatcher)); } /** * 新增或修改 */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入dispatcher") public R submit(@Valid @RequestBody Dispatcher dispatcher) { return R.status(dispatcherService.saveOrUpdate(dispatcher)); } /** * 删除 */ @PostMapping("/remove") @ApiOperationSupport(order = 8) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(dispatcherService.removeByIds(Func.toLongList(ids))); } } src/main/java/org/springblade/modules/dispatcher/dto/DispatcherDTO.java
New file @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.dto; import org.springblade.modules.dispatcher.entity.Dispatcher; import lombok.Data; import lombok.EqualsAndHashCode; /** * 数据传输对象实体类 * * @author BladeX * @since 2021-07-07 */ @Data @EqualsAndHashCode(callSuper = true) public class DispatcherDTO extends Dispatcher { private static final long serialVersionUID = 1L; } src/main/java/org/springblade/modules/dispatcher/entity/Dispatcher.java
New file @@ -0,0 +1,80 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * 实体类 * * @author BladeX * @since 2021-07-07 */ @Data @TableName("sys_dispatcher") @ApiModel(value = "Dispatcher对象", description = "Dispatcher对象") public class Dispatcher implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 身份证 */ @ApiModelProperty(value = "身份证") private String cardid; /** * 保安人名称 */ @ApiModelProperty(value = "保安人名称") private String name; /** * 派遣人 */ @ApiModelProperty(value = "派遣人") private String dispatcher; /** * 派遣时间 */ @ApiModelProperty(value = "派遣时间") @TableField("dispatcherTime") private LocalDateTime dispatchertime; /** * 派遣地址 */ @ApiModelProperty(value = "派遣地址") @TableField("dispatcherAddress") private String dispatcheraddress; /** * 派遣地址 */ @ApiModelProperty(value = "派遣单位") @TableField("dispatcherCompany") private String dispatchercompany; } src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.java
New file @@ -0,0 +1,42 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.mapper; import org.springblade.modules.dispatcher.entity.Dispatcher; import org.springblade.modules.dispatcher.vo.DispatcherVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; /** * Mapper 接口 * * @author BladeX * @since 2021-07-07 */ public interface DispatcherMapper extends BaseMapper<Dispatcher> { /** * 自定义分页 * * @param page * @param dispatcher * @return */ List<DispatcherVO> selectDispatcherPage(IPage page, DispatcherVO dispatcher); } src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
New file @@ -0,0 +1,21 @@ <?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="org.springblade.modules.dispatcher.mapper.DispatcherMapper"> <!-- 通用查询映射结果 --> <resultMap id="dispatcherResultMap" type="org.springblade.modules.dispatcher.entity.Dispatcher"> <id column="id" property="id"/> <result column="cardid" property="cardid"/> <result column="name" property="name"/> <result column="dispatcher" property="dispatcher"/> <result column="dispatcherTime" property="dispatchertime"/> <result column="dispatcherAddress" property="dispatcheraddress"/> <result column="dispatchercompany" property="dispatchercompany"/> </resultMap> <select id="selectDispatcherPage" resultMap="dispatcherResultMap"> select * from sys_dispatcher where is_deleted = 0 </select> </mapper> src/main/java/org/springblade/modules/dispatcher/service/IDispatcherService.java
New file @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.service; import org.springblade.modules.dispatcher.entity.Dispatcher; import org.springblade.modules.dispatcher.vo.DispatcherVO; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; /** * 服务类 * * @author BladeX * @since 2021-07-07 */ public interface IDispatcherService extends IService<Dispatcher> { /** * 自定义分页 * * @param page * @param dispatcher * @return */ IPage<DispatcherVO> selectDispatcherPage(IPage<DispatcherVO> page, DispatcherVO dispatcher); } src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherServiceImpl.java
New file @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.service.impl; import org.springblade.modules.dispatcher.entity.Dispatcher; import org.springblade.modules.dispatcher.vo.DispatcherVO; import org.springblade.modules.dispatcher.mapper.DispatcherMapper; import org.springblade.modules.dispatcher.service.IDispatcherService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; /** * 服务实现类 * * @author BladeX * @since 2021-07-07 */ @Service public class DispatcherServiceImpl extends ServiceImpl<DispatcherMapper, Dispatcher> implements IDispatcherService { @Override public IPage<DispatcherVO> selectDispatcherPage(IPage<DispatcherVO> page, DispatcherVO dispatcher) { return page.setRecords(baseMapper.selectDispatcherPage(page, dispatcher)); } } src/main/java/org/springblade/modules/dispatcher/vo/DispatcherVO.java
New file @@ -0,0 +1,36 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.dispatcher.vo; import org.springblade.modules.dispatcher.entity.Dispatcher; import lombok.Data; import lombok.EqualsAndHashCode; import io.swagger.annotations.ApiModel; /** * 视图实体类 * * @author BladeX * @since 2021-07-07 */ @Data @EqualsAndHashCode(callSuper = true) @ApiModel(value = "DispatcherVO对象", description = "DispatcherVO对象") public class DispatcherVO extends Dispatcher { private static final long serialVersionUID = 1L; }