Commit 56293328 authored by hezhen's avatar hezhen

Merge branch 'master-tiande' into dev-tiande

parents a2322abd d908168c
package com.xxfc.platform.vehicle.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
@Table(name = "branch_company_apply")
public class BranchCompanyApply {
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("公司名称")
private String name;
@ApiModelProperty("联系人")
private String contact;
@ApiModelProperty("联系电话")
private String moblie;
@ApiModelProperty("入驻类型:1-公司入驻;2-个人入驻")
private Integer type;
@ApiModelProperty("状态:0-未读;1-已读")
private Integer status;
@Column(name = "crt_time")
private Long crtTime;
@Column(name = "upd_time")
private Long updTime;
@Column(name = "is_del")
private Integer isDel;
}
\ No newline at end of file
package com.xxfc.platform.vehicle.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 16:27
*/
@Data
public class BranchCompanyApplyFindDTO extends PageParam {
private Integer status;
private Integer type;
private Long startTime;
private Long endTime;
}
package com.xxfc.platform.vehicle.biz;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.BranchCompanyApplyMapper;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyApplyFindDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
@Slf4j
public class BranchCompanyApplyBiz extends BaseBiz<BranchCompanyApplyMapper, BranchCompanyApply>{
public ObjectRestResponse addOrUpd(BranchCompanyApply branchCompanyApply){
Long id = branchCompanyApply.getId() == null ? 0L :branchCompanyApply.getId();
if (id > 0L){
updateSelectiveById(branchCompanyApply);
}else {
insertSelective(branchCompanyApply);
}
return ObjectRestResponse.succ();
}
public List<BranchCompanyApply> getList(BranchCompanyApplyFindDTO applyFindDTO){
Example example=new Example(BranchCompanyApply.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
if (applyFindDTO.getStatus() != null ){
criteria.andEqualTo("status",applyFindDTO.getStatus());
}
if (applyFindDTO.getType() != null ){
criteria.andEqualTo("type",applyFindDTO.getType());
}
if (applyFindDTO.getStartTime() != null && applyFindDTO.getStartTime() > 0 ){
criteria.andGreaterThanOrEqualTo("crtTime",applyFindDTO.getStartTime());
}
if (applyFindDTO.getEndTime() != null && applyFindDTO.getEndTime() > 0 ){
criteria.andLessThanOrEqualTo("crtTime",applyFindDTO.getEndTime());
}
example.setOrderByClause("crt_time desc ");
return selectByExample(example);
}
public ObjectRestResponse selectList(BranchCompanyApplyFindDTO applyFindDTO){
PageHelper.startPage(applyFindDTO.getPage(), applyFindDTO.getLimit());
PageInfo<BranchCompanyApply> pageInfo = new PageInfo<>(getList(applyFindDTO));
return ObjectRestResponse.succ(PageDataVO.pageInfo(pageInfo));
}
}
package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.BranchCompanyApply;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
public interface BranchCompanyApplyMapper extends Mapper<BranchCompanyApply>, SelectByIdListMapper<BranchCompanyApply,Long> {
}
\ No newline at end of file
package com.xxfc.platform.vehicle.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.BranchCompanyApplyBiz;
import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.entity.BranchCompanyApply;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyApplyFindDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("company/apply")
public class CompanyApplyController extends BaseController<BranchCompanyApplyBiz> {
@ApiOperation("查询入驻公司列表")
@RequestMapping(value = "/selectList", method = RequestMethod.GET)
public ObjectRestResponse getList(BranchCompanyApplyFindDTO applyFindDTO){
return baseBiz.selectList(applyFindDTO);
}
@ApiOperation("更新入驻公司")
@RequestMapping(value = "/upd", method = RequestMethod.POST)
public ObjectRestResponse updCompany(@RequestBody BranchCompanyApply branchCompanyApply){
return baseBiz.addOrUpd(branchCompanyApply);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment