| | |
| | | public Result<IPage<Car>> getByPage(String carNo,PageVo page) { |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | if(!StrUtil.isEmpty(carNo)){ |
| | | wrapper.like("a.car_no","%"+carNo+"%"); |
| | | wrapper.like("car_no","%"+carNo+"%"); |
| | | } |
| | | IPage<Car> data = iCarService.page2(PageUtil.initMpPage(page),wrapper); |
| | | IPage<Car> data = iCarService.page(PageUtil.initMpPage(page),wrapper); |
| | | return new ResultUtil<IPage<Car>>().setData(data); |
| | | } |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/getByPage", method = RequestMethod.GET) |
| | | @ApiOperation(value = "分页获取") |
| | | public Result<IPage<CustomerReceive>> getByPage(String name,PageVo page) { |
| | | QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>(); |
| | | if (!StrUtil.isEmpty(name)) |
| | | wrapper.like("b.name","%"+name+"%"); |
| | | IPage<CustomerReceive> data = iCustomerReceiveService.page2(PageUtil.initMpPage(page),wrapper); |
| | | public Result<IPage<CustomerReceive>> getByPage(PageVo page) { |
| | | |
| | | IPage<CustomerReceive> data = iCustomerReceiveService.page(PageUtil.initMpPage(page)); |
| | | return new ResultUtil<IPage<CustomerReceive>>().setData(data); |
| | | } |
| | | |
| | |
| | | package cn.exrick.xboot.your.entity; |
| | | |
| | | import cn.exrick.xboot.core.base.XbootBaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.Transient; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiModelProperty(value = "当前跟车人id") |
| | | private String followUserId; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String nickName; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String followNickName; |
| | | |
| | | } |
| | |
| | | package cn.exrick.xboot.your.entity; |
| | | |
| | | import cn.exrick.xboot.core.base.XbootBaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.Transient; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | @ApiModelProperty(value = "区域id") |
| | | private String customerId; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "状态(0:待审核 1:审核通过 2:审核未通过)") |
| | | private int status; |
| | | |
| | | @ApiModelProperty(value = "未通过原因") |
| | | private String content; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String customerName; |
| | | } |
| | |
| | | package cn.exrick.xboot.your.mapper; |
| | | import cn.exrick.xboot.your.entity.Area; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import org.apache.ibatis.annotations.Result; |
| | | import org.apache.ibatis.annotations.Results; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhangzeli |
| | | */ |
| | | public interface CarMapper extends BaseMapper<Car> { |
| | | |
| | | @Select("SELECT a.*,b1.nickname AS temp,b2.nickname AS followNickName FROM t_car a LEFT JOIN t_user AS b1 ON a.user_id = b1.id LEFT JOIN t_user AS b2 ON a.follow_user_id = b2.id ${ew.customSqlSegment} ") |
| | | @Results({@Result(column="temp", property="nickName", jdbcType = JdbcType.VARCHAR)}) |
| | | IPage<Car> page2(Page initMpPage, @Param(Constants.WRAPPER) QueryWrapper<Car> wrapper); |
| | | } |
| | |
| | | package cn.exrick.xboot.your.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.exrick.xboot.your.entity.CustomerReceive; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Result; |
| | | import org.apache.ibatis.annotations.Results; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | public interface CustomerReceiveMapper extends BaseMapper<CustomerReceive> { |
| | | |
| | | @Select("SELECT a.*,b.name as temp FROM t_customer_receive a LEFT JOIN t_customer b ON a.customer_id=b.id ${ew.customSqlSegment} ORDER BY a.status ASC,a.create_time DESC") |
| | | @Results({@Result(column="temp", property="customerName", jdbcType = JdbcType.VARCHAR)}) |
| | | IPage<CustomerReceive> page2(Page initMpPage, @Param(Constants.WRAPPER) QueryWrapper<CustomerReceive> wrapper); |
| | | } |
| | |
| | | package cn.exrick.xboot.your.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | |
| | |
| | | */ |
| | | public interface ICarService extends IService<Car> { |
| | | |
| | | IPage<Car> page2(Page initMpPage, QueryWrapper<Car> wrapper); |
| | | } |
| | |
| | | package cn.exrick.xboot.your.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.exrick.xboot.your.entity.CustomerReceive; |
| | | |
| | |
| | | */ |
| | | public interface ICustomerReceiveService extends IService<CustomerReceive> { |
| | | |
| | | IPage<CustomerReceive> page2(Page initMpPage, QueryWrapper<CustomerReceive> wrapper); |
| | | } |
| | |
| | | import cn.exrick.xboot.your.mapper.CarMapper; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import cn.exrick.xboot.your.service.ICarService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private CarMapper carMapper; |
| | | |
| | | @Override |
| | | public IPage<Car> page2(Page initMpPage, QueryWrapper<Car> wrapper) { |
| | | return carMapper.page2(initMpPage,wrapper); |
| | | } |
| | | } |
| | |
| | | import cn.exrick.xboot.your.mapper.CustomerReceiveMapper; |
| | | import cn.exrick.xboot.your.entity.CustomerReceive; |
| | | import cn.exrick.xboot.your.service.ICustomerReceiveService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private CustomerReceiveMapper customerReceiveMapper; |
| | | |
| | | @Override |
| | | public IPage<CustomerReceive> page2(Page initMpPage, QueryWrapper<CustomerReceive> wrapper) { |
| | | return customerReceiveMapper.page2(initMpPage,wrapper); |
| | | } |
| | | } |