经纪人

This commit is contained in:
曹磊 2024-08-07 23:01:02 +08:00
parent c815dd365e
commit 39a708b6b2
6 changed files with 183 additions and 0 deletions

View File

@ -0,0 +1,49 @@
package com.sqx.modules.bl.commission.jjr.controller;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel;
import com.sqx.modules.bl.commission.jjr.service.JjrConfigLevelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/commission/jjrConfigLevel")
@Api(value = "分佣管理", tags = {"经纪人配置等级"})
public class JjrConfigLevelController {
@Autowired
private JjrConfigLevelService service;
@GetMapping("/findList")
@ApiOperation("查询列表")
public Result findList(JjrConfigLevel jjrConfigLevel){
return service.findList(jjrConfigLevel);
}
@PostMapping("/add")
@ApiOperation("添加")
public Result add(JjrConfigLevel jjrConfigLevel){
service.add(jjrConfigLevel);
return Result.success();
}
@PostMapping("/update")
@ApiOperation("修改")
public Result update(JjrConfigLevel jjrConfigLevel){
service.update(jjrConfigLevel);
return Result.success();
}
@PostMapping("/delete")
@ApiOperation("删除")
public Result delete(JjrConfigLevel jjrConfigLevel){
service.removeById(jjrConfigLevel.getId());
return Result.success();
}
}

View File

@ -0,0 +1,13 @@
package com.sqx.modules.bl.commission.jjr.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface JjrConfigLevelDao extends BaseMapper<JjrConfigLevel> {
List<JjrConfigLevel> findList(JjrConfigLevel jjrConfigLevel);
int add(JjrConfigLevel jjrConfigLevel);
int update(JjrConfigLevel jjrConfigLevel);
}

View File

@ -0,0 +1,53 @@
package com.sqx.modules.bl.commission.jjr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @description bl_jjr_config_level
* 经纪人配置等级表
* @author caolei
* @date 2024-08-07
*/
@Data
@TableName("bl_jjr_config_level")
public class JjrConfigLevel implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
/**
* ID
*/
private Long id;
/**
*经纪人等级
*/
private String level;
/**
*邀请技师人数
*/
private String peopleNumber;
/**
*经纪人返佣比例
*/
private BigDecimal rate;
/**
*创建时间
*/
private String createTime;
@TableField(exist = false)
private Integer page;
@TableField(exist = false)
private Integer limit;
public JjrConfigLevel() {}
}

View File

@ -0,0 +1,11 @@
package com.sqx.modules.bl.commission.jjr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel;
public interface JjrConfigLevelService extends IService<JjrConfigLevel> {
Result findList(JjrConfigLevel jjrConfigLevel);
int add(JjrConfigLevel jjrConfigLevel);
int update(JjrConfigLevel jjrConfigLevel);
}

View File

@ -0,0 +1,32 @@
package com.sqx.modules.bl.commission.jjr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.jjr.dao.JjrConfigLevelDao;
import com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel;
import com.sqx.modules.bl.commission.jjr.service.JjrConfigLevelService;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service
public class JjrConfigLevelServiceImpl extends ServiceImpl<JjrConfigLevelDao, JjrConfigLevel> implements JjrConfigLevelService {
@Override
public Result findList(JjrConfigLevel jjrConfigLevel){
return Result.success().put("data",baseMapper.findList(jjrConfigLevel));
}
@Override
public int add(JjrConfigLevel jjrConfigLevel){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
jjrConfigLevel.setCreateTime(sdf.format(new Date()));
return baseMapper.add(jjrConfigLevel);
}
@Override
public int update(JjrConfigLevel jjrConfigLevel){
return baseMapper.update(jjrConfigLevel);
}
}

View File

@ -0,0 +1,25 @@
<?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="com.sqx.modules.bl.commission.jjr.dao.JjrConfigLevelDao">
<select id="findList" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel">
select id,level,people_number,rate,create_time
from bl_jjr_config_level
order by id desc
</select>
<insert id="add" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel">
insert into bl_jjr_config_level(level,people_number,rate,create_time)
values(#{level},#{peopleNumber},#{rate},#{createTime})
</insert>
<update id="update" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrConfigLevel">
update bl_jjr_config_level
set level=#{level},
people_number=#{peopleNumber},
rate=#{rate}
where id=#{id}
</update>
</mapper>