提交代码

master
胡锐 5 months ago
parent 18dcf4b5eb
commit 1bc07f518d
  1. 2
      bweb/src/main/java/com/bweb/controller/BsAgentController.java
  2. 208
      bweb/src/main/java/com/bweb/controller/BsAgentMerController.java
  3. 184
      bweb/src/main/java/com/bweb/controller/BsAgentStaffController.java
  4. 4
      bweb/src/main/java/com/bweb/controller/BsGasOrderController.java
  5. 32
      service/src/main/java/com/hfkj/dao/BsAgentMapper.java
  6. 137
      service/src/main/java/com/hfkj/dao/BsAgentMerMapper.java
  7. 80
      service/src/main/java/com/hfkj/dao/BsAgentMerMapperExt.java
  8. 374
      service/src/main/java/com/hfkj/dao/BsAgentMerSqlProvider.java
  9. 133
      service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java
  10. 7
      service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java
  11. 360
      service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java
  12. 28
      service/src/main/java/com/hfkj/dao/BsAgentSqlProvider.java
  13. 122
      service/src/main/java/com/hfkj/dao/BsAgentStaffMapper.java
  14. 7
      service/src/main/java/com/hfkj/dao/BsAgentStaffMapperExt.java
  15. 318
      service/src/main/java/com/hfkj/dao/BsAgentStaffSqlProvider.java
  16. 32
      service/src/main/java/com/hfkj/entity/BsAgent.java
  17. 130
      service/src/main/java/com/hfkj/entity/BsAgentExample.java
  18. 277
      service/src/main/java/com/hfkj/entity/BsAgentMer.java
  19. 1203
      service/src/main/java/com/hfkj/entity/BsAgentMerExample.java
  20. 262
      service/src/main/java/com/hfkj/entity/BsAgentPrice.java
  21. 1124
      service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java
  22. 216
      service/src/main/java/com/hfkj/entity/BsAgentStaff.java
  23. 943
      service/src/main/java/com/hfkj/entity/BsAgentStaffExample.java
  24. 24
      service/src/main/java/com/hfkj/model/AgentMerAllot.java
  25. 69
      service/src/main/java/com/hfkj/service/agent/BsAgentMerService.java
  26. 2
      service/src/main/java/com/hfkj/service/agent/BsAgentService.java
  27. 66
      service/src/main/java/com/hfkj/service/agent/BsAgentStaffService.java
  28. 194
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java
  29. 8
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java
  30. 169
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java
  31. 34
      service/src/main/java/com/hfkj/sysenum/agent/AgentStaffStatusEnum.java

@ -10,7 +10,7 @@ import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAgent;
import com.hfkj.entity.SecUser;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsAgentService;
import com.hfkj.service.agent.BsAgentService;
import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;

@ -0,0 +1,208 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.agent.BsAgentMerService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
@Controller
@RequestMapping(value = "/agentMer")
@Api(value = "代理商商户")
public class BsAgentMerController {
private static Logger log = LoggerFactory.getLogger(BsAgentMerController.class);
@Resource
private BsAgentMerService agentMerService;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/assignAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "分配代理商")
public ResponseData assignAgent(@RequestBody JSONObject body) {
try {
if (body.getLong("agentId") == null
|| body.getJSONArray("merNoList") == null
|| body.getJSONArray("merNoList").size() == 0
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<String> merNoList = new ArrayList<>();
for (Object obj : body.getJSONArray("merNoList")) {
JSONObject objData = (JSONObject)obj;
if (StringUtils.isBlank(objData.getString("merNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
merNoList.add(objData.getString("merNo"));
}
agentMerService.assignAgent(body.getLong("agentId"), merNoList);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("BsAgentMerController --> assignAgent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/unbindAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "解绑代理商")
public ResponseData unbindAgent(@RequestBody JSONObject body) {
try {
if (body.getLong("agentId") == null
|| body.getJSONArray("merNoList") == null
|| body.getJSONArray("merNoList").isEmpty()
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<String> merNoList = new ArrayList<>();
for (Object obj : body.getJSONArray("merNoList")) {
JSONObject objData = (JSONObject)obj;
if (StringUtils.isBlank(objData.getString("merNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
merNoList.add(objData.getString("merNo"));
}
agentMerService.unbindAgent(body.getLong("agentId"), merNoList);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighTyAgentController --> assignOrg() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/assignStaff", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "分配工作人员")
public ResponseData assignStaff(@RequestBody JSONObject body) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (body.getLong("staffId") == null
|| body.getJSONArray("merNoList") == null
|| body.getJSONArray("merNoList").isEmpty()
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<String> merNoList = new ArrayList<>();
for (Object obj : body.getJSONArray("merNoList")) {
JSONObject objData = (JSONObject)obj;
if (StringUtils.isBlank(objData.getString("merNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
merNoList.add(objData.getString("merNo"));
}
agentMerService.assignStaff(body.getLong("staffId"), merNoList);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/unbindStaff", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "解绑业务员")
public ResponseData unbindStaff(@RequestBody JSONObject body) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (body.getLong("staffId") == null
|| body.getJSONArray("merNoList") == null
|| body.getJSONArray("merNoList").isEmpty()
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<String> merNoList = new ArrayList<>();
for (Object obj : body.getJSONArray("merNoList")) {
JSONObject objData = (JSONObject)obj;
if (StringUtils.isBlank(objData.getString("merNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
merNoList.add(objData.getString("merNo"));
}
agentMerService.unbindStaff(body.getLong("staffId"), merNoList);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getAllotList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分配列表")
public ResponseData getAllotList(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "isAgentAllot", required = false) Boolean isAgentAllot,
@RequestParam(name = "agentStaffId", required = false) Long agentStaffId,
@RequestParam(name = "isAgentStaffAllot", required = false) Boolean isAgentStaffAllot,
@RequestParam(name = "provinceCode", required = false) String provinceCode,
@RequestParam(name = "merSourceType", required = false) Long merSourceType,
@RequestParam(name = "merNo", required = false) String merNo,
@RequestParam(name = "merName", required = false) String merName,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
Map<String, Object> param = new HashMap<>();
param.put("provinceCode", provinceCode);
param.put("merSourceType", merSourceType);
param.put("merNo", merNo);
param.put("merName", merName);
if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
param.put("agentId", agentId);
param.put("isAgentAllot", isAgentAllot);
param.put("agentStaffId", agentStaffId);
param.put("isAgentStaffAllot", isAgentStaffAllot);
} else if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
param.put("agentId", userSession.getAccount().getObjectId());
param.put("isAgentAllot", true);
param.put("agentStaffId", agentStaffId);
param.put("isAgentStaffAllot", isAgentStaffAllot);
} else if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) {
param.put("agentStaffId", userSession.getAccount().getObjectId());
param.put("isAgentStaffAllot", true);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(agentMerService.getAllotList(param)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,184 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAgentStaff;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.agent.BsAgentStaffService;
import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/agentStaff")
@Api(value = "代理商管理")
public class BsAgentStaffController {
private static Logger log = LoggerFactory.getLogger(BsAgentStaffController.class);
@Resource
private BsAgentStaffService agentStaffService;
@Resource
private SecUserService secUserService;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/addStaff", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加业务员")
public ResponseData addStaff(@RequestBody JSONObject body) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (StringUtils.isBlank(body.getString("name"))
|| StringUtils.isBlank(body.getString("telephone"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
BsAgentStaff staff = new BsAgentStaff();
staff.setAgentId(userSession.getAccount().getObjectId());
staff.setName(body.getString("name"));
staff.setTelephone(body.getString("telephone"));
agentStaffService.addStaff(staff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateStaff", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改业务员")
public ResponseData updateStaff(@RequestBody JSONObject body) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (body.getLong("id") == null
|| StringUtils.isBlank(body.getString("name"))
|| StringUtils.isBlank(body.getString("telephone"))
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询代理商
BsAgentStaff staff = agentStaffService.getStaffDetailById(body.getLong("id"));
if (staff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商信息");
}
staff.setName(body.getString("name"));
staff.setTelephone(body.getString("telephone"));
agentStaffService.updateStaff(staff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/delStaff", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除业务员")
public ResponseData delStaff(@RequestBody JSONObject body) {
try {
if (body.getLong("id") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
agentStaffService.delStaff(body.getLong("id"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/staffPwdReset", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "业务员密码重置")
public ResponseData staffPwdReset(@RequestBody JSONObject body, HttpServletRequest request) {
try {
if (body.getLong("id") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
agentStaffService.staffPwdReset(body.getLong("id"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getStaffDetail", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询工作人员详情")
public ResponseData getStaffDetail(@RequestParam(name = "id", required = true) Long id) {
try {
BsAgentStaff staff = agentStaffService.getStaffDetailById(id);
if (staff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的工作人员");
}
Map<String,Object> map = new HashMap<>();
map.put("staff",staff);
map.put("account", secUserService.getDetail(SecUserObjectTypeEnum.type5, staff.getId()) );
return ResponseMsgUtil.success(map);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getStaffList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询工作人员列表")
public ResponseData getStaffList(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "telephone", required = false) String telephone,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class);
Map<String, Object> param = new HashMap<>();
if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
param.put("agentId", agentId);
} else if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) {
param.put("agentId", userSession.getAccount().getObjectId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
param.put("name", name);
param.put("telephone", telephone);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(agentStaffService.getStaffList(param)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -44,10 +44,10 @@ public class BsGasOrderController {
@Resource
private BsDeviceService deviceService;
@RequestMapping(value="/queryUserOilOrder",method = RequestMethod.GET)
@RequestMapping(value="/queryOilOrderList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户加油订单")
public ResponseData queryUserOilOrder(@RequestParam(name = "merId", required = false) Long merId,
public ResponseData queryOilOrderList(@RequestParam(name = "merId", required = false) Long merId,
@RequestParam(name = "merName", required = false) String merName,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "status", required = false) Integer status,

@ -39,16 +39,16 @@ public interface BsAgentMapper extends BsAgentMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent (company_id, company_name, ",
"agent_no, `name`, contacts_name, ",
"contacts_telephone, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{agentNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{contactsName,jdbcType=VARCHAR}, ",
"#{contactsTelephone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into bs_agent (agent_no, `name`, ",
"contacts_name, contacts_telephone, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{agentNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{contactsName,jdbcType=VARCHAR}, #{contactsTelephone,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgent record);
@ -60,8 +60,6 @@ public interface BsAgentMapper extends BsAgentMapperExt {
@SelectProvider(type=BsAgentSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_no", property="agentNo", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR),
@ -77,15 +75,13 @@ public interface BsAgentMapper extends BsAgentMapperExt {
@Select({
"select",
"id, company_id, company_name, agent_no, `name`, contacts_name, contacts_telephone, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"id, agent_no, `name`, contacts_name, contacts_telephone, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_agent",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_no", property="agentNo", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR),
@ -110,9 +106,7 @@ public interface BsAgentMapper extends BsAgentMapperExt {
@Update({
"update bs_agent",
"set company_id = #{companyId,jdbcType=BIGINT},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"agent_no = #{agentNo,jdbcType=VARCHAR},",
"set agent_no = #{agentNo,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"contacts_name = #{contactsName,jdbcType=VARCHAR},",
"contacts_telephone = #{contactsTelephone,jdbcType=VARCHAR},",

@ -0,0 +1,137 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentMer;
import com.hfkj.entity.BsAgentMerExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
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.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsAgentMerMapper extends BsAgentMerMapperExt {
@SelectProvider(type=BsAgentMerSqlProvider.class, method="countByExample")
long countByExample(BsAgentMerExample example);
@DeleteProvider(type=BsAgentMerSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAgentMerExample example);
@Delete({
"delete from bs_agent_mer",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent_mer (agent_id, agent_name, ",
"agent_staff_id, agent_staff_name, ",
"mer_id, mer_no, mer_name, ",
"qr_code_img_url, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
"#{agentStaffId,jdbcType=BIGINT}, #{agentStaffName,jdbcType=VARCHAR}, ",
"#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
"#{qrCodeImgUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgentMer record);
@InsertProvider(type=BsAgentMerSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAgentMer record);
@SelectProvider(type=BsAgentMerSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_staff_id", property="agentStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_staff_name", property="agentStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsAgentMer> selectByExample(BsAgentMerExample example);
@Select({
"select",
"id, agent_id, agent_name, agent_staff_id, agent_staff_name, mer_id, mer_no, ",
"mer_name, qr_code_img_url, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from bs_agent_mer",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_staff_id", property="agentStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_staff_name", property="agentStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsAgentMer selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAgentMerSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAgentMer record, @Param("example") BsAgentMerExample example);
@UpdateProvider(type=BsAgentMerSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAgentMer record, @Param("example") BsAgentMerExample example);
@UpdateProvider(type=BsAgentMerSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAgentMer record);
@Update({
"update bs_agent_mer",
"set agent_id = #{agentId,jdbcType=BIGINT},",
"agent_name = #{agentName,jdbcType=VARCHAR},",
"agent_staff_id = #{agentStaffId,jdbcType=BIGINT},",
"agent_staff_name = #{agentStaffName,jdbcType=VARCHAR},",
"mer_id = #{merId,jdbcType=BIGINT},",
"mer_no = #{merNo,jdbcType=VARCHAR},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsAgentMer record);
}

@ -0,0 +1,80 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentMer;
import com.hfkj.model.AgentMerAllot;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface BsAgentMerMapperExt {
@Insert(value = {
"<script>",
"insert into bs_agent_mer (agent_id, agent_name, ",
"agent_staff_id, agent_staff_name, ",
"mer_id, mer_no, mer_name, ",
"qr_code_img_url, `status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values " +
"<foreach collection=\"dataList\" item=\"item\" index=\"idx\" open=\"(\" separator=\"),(\" close=\")\">",
"#{item.agentId,jdbcType=BIGINT}, #{item.agentName,jdbcType=VARCHAR}, ",
"#{item.agentStaffId,jdbcType=BIGINT}, #{item.agentStaffName,jdbcType=VARCHAR}, ",
"#{item.merId,jdbcType=BIGINT}, #{item.merNo,jdbcType=VARCHAR}, #{item.merName,jdbcType=VARCHAR}, ",
"#{qrCodeImgUrl,jdbcType=VARCHAR},#{item.status,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, ",
"#{item.updateTime,jdbcType=TIMESTAMP}, #{item.ext1,jdbcType=VARCHAR}, ",
"#{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR}",
"</foreach>",
"</script>"
})
void addPatch(@Param(value = "dataList") List<BsAgentMer> dataList);
@Select({" <script> " +
" select " +
" a.merSourceType," +
" a.provinceCode," +
" a.provinceName," +
" a.merNo," +
" a.merName," +
" a.merAddress," +
" a.agentName," +
" a.createTime," +
" GROUP_CONCAT(a.agentStaffName) agentStaff" +
" FROM " +
" (SELECT" +
" a.id merId," +
" a.source_type merSourceType," +
" a.province_code provinceCode," +
" a.province_name provinceName," +
" a.mer_no merNo," +
" a.mer_name merName," +
" a.address merAddress," +
" b.agent_id agentId," +
" b.agent_name agentName," +
" b.agent_staff_id agentStaffId," +
" b.agent_staff_name agentStaffName," +
" b.create_time createTime" +
" FROM" +
" bs_merchant a" +
" LEFT JOIN bs_agent_mer b on b.mer_id = a.id" +
" <if test='param.agentId != null'> and b.agent_id = #{param.agentId} </if>" +
" <if test='param.agentStaffId != null'> and b.agent_staff_id = #{param.agentStaffId} </if>" +
" ) a where 1 = 1" +
" <if test='param.provinceCode != null'> and a.provinceCode = #{param.provinceCode} </if>" +
" <if test='param.merSourceType != null'> and a.merSourceType = #{param.merSourceType} </if>" +
" <if test='param.merNo != null'> and a.merNo like concat('%',#{param.merNo},'%') </if>" +
" <if test='param.merName != null'> and a.merName like concat('%',#{param.merName},'%') </if>" +
" <if test='param.isAgentAllot != null and param.isAgentAllot == true'> and a.agentId is not null </if>" +
" <if test='param.isAgentAllot != null and param.isAgentAllot == false'> and a.agentId is null </if>" +
" <if test='param.isAgentStaffAllot != null and param.isAgentStaffAllot == false'> and a.agentStaffId is null </if>" +
" <if test='param.isAgentStaffAllot != null and param.isAgentStaffAllot == false'> and a.agentStaffId is null </if>" +
" GROUP BY a.merId " +
" </script> "})
List<AgentMerAllot> getAllotList(@Param("param") Map<String,Object> param);
}

@ -0,0 +1,374 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentMer;
import com.hfkj.entity.BsAgentMerExample.Criteria;
import com.hfkj.entity.BsAgentMerExample.Criterion;
import com.hfkj.entity.BsAgentMerExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAgentMerSqlProvider {
public String countByExample(BsAgentMerExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_agent_mer");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAgentMerExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_agent_mer");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAgentMer record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent_mer");
if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
}
if (record.getAgentName() != null) {
sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}");
}
if (record.getAgentStaffId() != null) {
sql.VALUES("agent_staff_id", "#{agentStaffId,jdbcType=BIGINT}");
}
if (record.getAgentStaffName() != null) {
sql.VALUES("agent_staff_name", "#{agentStaffName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerNo() != null) {
sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.VALUES("qr_code_img_url", "#{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsAgentMerExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("agent_id");
sql.SELECT("agent_name");
sql.SELECT("agent_staff_id");
sql.SELECT("agent_staff_name");
sql.SELECT("mer_id");
sql.SELECT("mer_no");
sql.SELECT("mer_name");
sql.SELECT("qr_code_img_url");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_agent_mer");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsAgentMer record = (BsAgentMer) parameter.get("record");
BsAgentMerExample example = (BsAgentMerExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_agent_mer");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
}
if (record.getAgentName() != null) {
sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
}
if (record.getAgentStaffId() != null) {
sql.SET("agent_staff_id = #{record.agentStaffId,jdbcType=BIGINT}");
}
if (record.getAgentStaffName() != null) {
sql.SET("agent_staff_name = #{record.agentStaffName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerNo() != null) {
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_mer");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
sql.SET("agent_staff_id = #{record.agentStaffId,jdbcType=BIGINT}");
sql.SET("agent_staff_name = #{record.agentStaffName,jdbcType=VARCHAR}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsAgentMerExample example = (BsAgentMerExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAgentMer record) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_mer");
if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
}
if (record.getAgentName() != null) {
sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}");
}
if (record.getAgentStaffId() != null) {
sql.SET("agent_staff_id = #{agentStaffId,jdbcType=BIGINT}");
}
if (record.getAgentStaffName() != null) {
sql.SET("agent_staff_name = #{agentStaffName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerNo() != null) {
sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsAgentMerExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -0,0 +1,133 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentPrice;
import com.hfkj.entity.BsAgentPriceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
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.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
@SelectProvider(type=BsAgentPriceSqlProvider.class, method="countByExample")
long countByExample(BsAgentPriceExample example);
@DeleteProvider(type=BsAgentPriceSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAgentPriceExample example);
@Delete({
"delete from bs_agent_price",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent_price (`type`, mer_id, ",
"mer_name, agent_mer_id, ",
"oil_no_name, oil_no, ",
"price_rate, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{merId,jdbcType=BIGINT}, ",
"#{merName,jdbcType=VARCHAR}, #{agentMerId,jdbcType=BIGINT}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ",
"#{priceRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgentPrice record);
@InsertProvider(type=BsAgentPriceSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAgentPrice record);
@SelectProvider(type=BsAgentPriceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_mer_id", property="agentMerId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsAgentPrice> selectByExample(BsAgentPriceExample example);
@Select({
"select",
"id, `type`, mer_id, mer_name, agent_mer_id, oil_no_name, oil_no, price_rate, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_agent_price",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_mer_id", property="agentMerId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsAgentPrice selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAgentPriceSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAgentPrice record, @Param("example") BsAgentPriceExample example);
@UpdateProvider(type=BsAgentPriceSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAgentPrice record, @Param("example") BsAgentPriceExample example);
@UpdateProvider(type=BsAgentPriceSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAgentPrice record);
@Update({
"update bs_agent_price",
"set `type` = #{type,jdbcType=INTEGER},",
"mer_id = #{merId,jdbcType=BIGINT},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"agent_mer_id = #{agentMerId,jdbcType=BIGINT},",
"oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},",
"price_rate = #{priceRate,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsAgentPrice record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsAgentPriceMapperExt {
}

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentPrice;
import com.hfkj.entity.BsAgentPriceExample.Criteria;
import com.hfkj.entity.BsAgentPriceExample.Criterion;
import com.hfkj.entity.BsAgentPriceExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAgentPriceSqlProvider {
public String countByExample(BsAgentPriceExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_agent_price");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAgentPriceExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_agent_price");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAgentPrice record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent_price");
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getAgentMerId() != null) {
sql.VALUES("agent_mer_id", "#{agentMerId,jdbcType=BIGINT}");
}
if (record.getOilNoName() != null) {
sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) {
sql.VALUES("price_rate", "#{priceRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsAgentPriceExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("mer_id");
sql.SELECT("mer_name");
sql.SELECT("agent_mer_id");
sql.SELECT("oil_no_name");
sql.SELECT("oil_no");
sql.SELECT("price_rate");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_agent_price");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsAgentPrice record = (BsAgentPrice) parameter.get("record");
BsAgentPriceExample example = (BsAgentPriceExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_agent_price");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getAgentMerId() != null) {
sql.SET("agent_mer_id = #{record.agentMerId,jdbcType=BIGINT}");
}
if (record.getOilNoName() != null) {
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) {
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_price");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("agent_mer_id = #{record.agentMerId,jdbcType=BIGINT}");
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsAgentPriceExample example = (BsAgentPriceExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAgentPrice record) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_price");
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getAgentMerId() != null) {
sql.SET("agent_mer_id = #{agentMerId,jdbcType=BIGINT}");
}
if (record.getOilNoName() != null) {
sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) {
sql.SET("price_rate = #{priceRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsAgentPriceExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -28,14 +28,6 @@ public class BsAgentSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent");
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
}
if (record.getAgentNo() != null) {
sql.VALUES("agent_no", "#{agentNo,jdbcType=VARCHAR}");
}
@ -86,8 +78,6 @@ public class BsAgentSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("company_id");
sql.SELECT("company_name");
sql.SELECT("agent_no");
sql.SELECT("`name`");
sql.SELECT("contacts_name");
@ -119,14 +109,6 @@ public class BsAgentSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
}
if (record.getAgentNo() != null) {
sql.SET("agent_no = #{record.agentNo,jdbcType=VARCHAR}");
}
@ -176,8 +158,6 @@ public class BsAgentSqlProvider {
sql.UPDATE("bs_agent");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("agent_no = #{record.agentNo,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}");
@ -198,14 +178,6 @@ public class BsAgentSqlProvider {
SQL sql = new SQL();
sql.UPDATE("bs_agent");
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
}
if (record.getAgentNo() != null) {
sql.SET("agent_no = #{agentNo,jdbcType=VARCHAR}");
}

@ -0,0 +1,122 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentStaff;
import com.hfkj.entity.BsAgentStaffExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
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.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsAgentStaffMapper extends BsAgentStaffMapperExt {
@SelectProvider(type=BsAgentStaffSqlProvider.class, method="countByExample")
long countByExample(BsAgentStaffExample example);
@DeleteProvider(type=BsAgentStaffSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAgentStaffExample example);
@Delete({
"delete from bs_agent_staff",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent_staff (agent_id, avatar, ",
"`name`, telephone, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{agentId,jdbcType=BIGINT}, #{avatar,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgentStaff record);
@InsertProvider(type=BsAgentStaffSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAgentStaff record);
@SelectProvider(type=BsAgentStaffSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsAgentStaff> selectByExample(BsAgentStaffExample example);
@Select({
"select",
"id, agent_id, avatar, `name`, telephone, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from bs_agent_staff",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsAgentStaff selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAgentStaffSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAgentStaff record, @Param("example") BsAgentStaffExample example);
@UpdateProvider(type=BsAgentStaffSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAgentStaff record, @Param("example") BsAgentStaffExample example);
@UpdateProvider(type=BsAgentStaffSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAgentStaff record);
@Update({
"update bs_agent_staff",
"set agent_id = #{agentId,jdbcType=BIGINT},",
"avatar = #{avatar,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"telephone = #{telephone,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsAgentStaff record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsAgentStaffMapperExt {
}

@ -0,0 +1,318 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentStaff;
import com.hfkj.entity.BsAgentStaffExample.Criteria;
import com.hfkj.entity.BsAgentStaffExample.Criterion;
import com.hfkj.entity.BsAgentStaffExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAgentStaffSqlProvider {
public String countByExample(BsAgentStaffExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_agent_staff");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAgentStaffExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_agent_staff");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAgentStaff record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent_staff");
if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.VALUES("avatar", "#{avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.VALUES("telephone", "#{telephone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsAgentStaffExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("agent_id");
sql.SELECT("avatar");
sql.SELECT("`name`");
sql.SELECT("telephone");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_agent_staff");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsAgentStaff record = (BsAgentStaff) parameter.get("record");
BsAgentStaffExample example = (BsAgentStaffExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_agent_staff");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_staff");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsAgentStaffExample example = (BsAgentStaffExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAgentStaff record) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_staff");
if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.SET("avatar = #{avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.SET("telephone = #{telephone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsAgentStaffExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -18,16 +18,6 @@ public class BsAgent implements Serializable {
*/
private Long id;
/**
* 公司id
*/
private Long companyId;
/**
* 公司名称
*/
private String companyName;
/**
* 代理商编号
*/
@ -79,22 +69,6 @@ public class BsAgent implements Serializable {
this.id = id;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getAgentNo() {
return agentNo;
}
@ -188,8 +162,6 @@ public class BsAgent implements Serializable {
}
BsAgent other = (BsAgent) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getAgentNo() == null ? other.getAgentNo() == null : this.getAgentNo().equals(other.getAgentNo()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getContactsName() == null ? other.getContactsName() == null : this.getContactsName().equals(other.getContactsName()))
@ -207,8 +179,6 @@ public class BsAgent implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getAgentNo() == null) ? 0 : getAgentNo().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getContactsName() == null) ? 0 : getContactsName().hashCode());
@ -229,8 +199,6 @@ public class BsAgent implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", companyName=").append(companyName);
sb.append(", agentNo=").append(agentNo);
sb.append(", name=").append(name);
sb.append(", contactsName=").append(contactsName);

@ -185,136 +185,6 @@ public class BsAgentExample {
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyNameIsNull() {
addCriterion("company_name is null");
return (Criteria) this;
}
public Criteria andCompanyNameIsNotNull() {
addCriterion("company_name is not null");
return (Criteria) this;
}
public Criteria andCompanyNameEqualTo(String value) {
addCriterion("company_name =", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotEqualTo(String value) {
addCriterion("company_name <>", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameGreaterThan(String value) {
addCriterion("company_name >", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameGreaterThanOrEqualTo(String value) {
addCriterion("company_name >=", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLessThan(String value) {
addCriterion("company_name <", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLessThanOrEqualTo(String value) {
addCriterion("company_name <=", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLike(String value) {
addCriterion("company_name like", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotLike(String value) {
addCriterion("company_name not like", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameIn(List<String> values) {
addCriterion("company_name in", values, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotIn(List<String> values) {
addCriterion("company_name not in", values, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameBetween(String value1, String value2) {
addCriterion("company_name between", value1, value2, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotBetween(String value1, String value2) {
addCriterion("company_name not between", value1, value2, "companyName");
return (Criteria) this;
}
public Criteria andAgentNoIsNull() {
addCriterion("agent_no is null");
return (Criteria) this;

@ -0,0 +1,277 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_agent_mer
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAgentMer implements Serializable {
private Long id;
/**
* 代理商id
*/
private Long agentId;
/**
* 代理商名称
*/
private String agentName;
/**
* 工作人员id
*/
private Long agentStaffId;
/**
* 工作人员名称
*/
private String agentStaffName;
/**
* 加油站id
*/
private Long merId;
/**
* 加油站编号
*/
private String merNo;
/**
* 加油站名称
*/
private String merName;
/**
* 二维码图片地址
*/
private String qrCodeImgUrl;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public Long getAgentStaffId() {
return agentStaffId;
}
public void setAgentStaffId(Long agentStaffId) {
this.agentStaffId = agentStaffId;
}
public String getAgentStaffName() {
return agentStaffName;
}
public void setAgentStaffName(String agentStaffName) {
this.agentStaffName = agentStaffName;
}
public Long getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public String getMerNo() {
return merNo;
}
public void setMerNo(String merNo) {
this.merNo = merNo;
}
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public String getQrCodeImgUrl() {
return qrCodeImgUrl;
}
public void setQrCodeImgUrl(String qrCodeImgUrl) {
this.qrCodeImgUrl = qrCodeImgUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsAgentMer other = (BsAgentMer) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName()))
&& (this.getAgentStaffId() == null ? other.getAgentStaffId() == null : this.getAgentStaffId().equals(other.getAgentStaffId()))
&& (this.getAgentStaffName() == null ? other.getAgentStaffName() == null : this.getAgentStaffName().equals(other.getAgentStaffName()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getQrCodeImgUrl() == null ? other.getQrCodeImgUrl() == null : this.getQrCodeImgUrl().equals(other.getQrCodeImgUrl()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode());
result = prime * result + ((getAgentStaffId() == null) ? 0 : getAgentStaffId().hashCode());
result = prime * result + ((getAgentStaffName() == null) ? 0 : getAgentStaffName().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getQrCodeImgUrl() == null) ? 0 : getQrCodeImgUrl().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", agentId=").append(agentId);
sb.append(", agentName=").append(agentName);
sb.append(", agentStaffId=").append(agentStaffId);
sb.append(", agentStaffName=").append(agentStaffName);
sb.append(", merId=").append(merId);
sb.append(", merNo=").append(merNo);
sb.append(", merName=").append(merName);
sb.append(", qrCodeImgUrl=").append(qrCodeImgUrl);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,262 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_agent_price
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAgentPrice implements Serializable {
private Long id;
/**
* 类型 1平台 2代理商
*/
private Integer type;
/**
* 加油站id
*/
private Long merId;
/**
* 加油站名称
*/
private String merName;
/**
* 代理油站数据id
*/
private Long agentMerId;
/**
* 油号名称
*/
private String oilNoName;
/**
* 油号
*/
private String oilNo;
/**
* 优惠比例
*/
private BigDecimal priceRate;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public Long getAgentMerId() {
return agentMerId;
}
public void setAgentMerId(Long agentMerId) {
this.agentMerId = agentMerId;
}
public String getOilNoName() {
return oilNoName;
}
public void setOilNoName(String oilNoName) {
this.oilNoName = oilNoName;
}
public String getOilNo() {
return oilNo;
}
public void setOilNo(String oilNo) {
this.oilNo = oilNo;
}
public BigDecimal getPriceRate() {
return priceRate;
}
public void setPriceRate(BigDecimal priceRate) {
this.priceRate = priceRate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsAgentPrice other = (BsAgentPrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getAgentMerId() == null ? other.getAgentMerId() == null : this.getAgentMerId().equals(other.getAgentMerId()))
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
&& (this.getPriceRate() == null ? other.getPriceRate() == null : this.getPriceRate().equals(other.getPriceRate()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getAgentMerId() == null) ? 0 : getAgentMerId().hashCode());
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
result = prime * result + ((getPriceRate() == null) ? 0 : getPriceRate().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", merId=").append(merId);
sb.append(", merName=").append(merName);
sb.append(", agentMerId=").append(agentMerId);
sb.append(", oilNoName=").append(oilNoName);
sb.append(", oilNo=").append(oilNo);
sb.append(", priceRate=").append(priceRate);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,216 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_agent_staff
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAgentStaff implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 代理商id
*/
private Long agentId;
/**
* 工作人员头像
*/
private String avatar;
/**
* 工作人员名称
*/
private String name;
/**
* 工作人员电话
*/
private String telephone;
/**
* 状态 0删除 1正常 2禁用
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsAgentStaff other = (BsAgentStaff) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", agentId=").append(agentId);
sb.append(", avatar=").append(avatar);
sb.append(", name=").append(name);
sb.append(", telephone=").append(telephone);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,943 @@
package com.hfkj.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsAgentStaffExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsAgentStaffExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andAgentIdIsNull() {
addCriterion("agent_id is null");
return (Criteria) this;
}
public Criteria andAgentIdIsNotNull() {
addCriterion("agent_id is not null");
return (Criteria) this;
}
public Criteria andAgentIdEqualTo(Long value) {
addCriterion("agent_id =", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotEqualTo(Long value) {
addCriterion("agent_id <>", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThan(Long value) {
addCriterion("agent_id >", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("agent_id >=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThan(Long value) {
addCriterion("agent_id <", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThanOrEqualTo(Long value) {
addCriterion("agent_id <=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdIn(List<Long> values) {
addCriterion("agent_id in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotIn(List<Long> values) {
addCriterion("agent_id not in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdBetween(Long value1, Long value2) {
addCriterion("agent_id between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotBetween(Long value1, Long value2) {
addCriterion("agent_id not between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andAvatarIsNull() {
addCriterion("avatar is null");
return (Criteria) this;
}
public Criteria andAvatarIsNotNull() {
addCriterion("avatar is not null");
return (Criteria) this;
}
public Criteria andAvatarEqualTo(String value) {
addCriterion("avatar =", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotEqualTo(String value) {
addCriterion("avatar <>", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarGreaterThan(String value) {
addCriterion("avatar >", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarGreaterThanOrEqualTo(String value) {
addCriterion("avatar >=", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLessThan(String value) {
addCriterion("avatar <", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLessThanOrEqualTo(String value) {
addCriterion("avatar <=", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLike(String value) {
addCriterion("avatar like", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotLike(String value) {
addCriterion("avatar not like", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarIn(List<String> values) {
addCriterion("avatar in", values, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotIn(List<String> values) {
addCriterion("avatar not in", values, "avatar");
return (Criteria) this;
}
public Criteria andAvatarBetween(String value1, String value2) {
addCriterion("avatar between", value1, value2, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotBetween(String value1, String value2) {
addCriterion("avatar not between", value1, value2, "avatar");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTelephoneIsNull() {
addCriterion("telephone is null");
return (Criteria) this;
}
public Criteria andTelephoneIsNotNull() {
addCriterion("telephone is not null");
return (Criteria) this;
}
public Criteria andTelephoneEqualTo(String value) {
addCriterion("telephone =", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneNotEqualTo(String value) {
addCriterion("telephone <>", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneGreaterThan(String value) {
addCriterion("telephone >", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneGreaterThanOrEqualTo(String value) {
addCriterion("telephone >=", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneLessThan(String value) {
addCriterion("telephone <", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneLessThanOrEqualTo(String value) {
addCriterion("telephone <=", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneLike(String value) {
addCriterion("telephone like", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneNotLike(String value) {
addCriterion("telephone not like", value, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneIn(List<String> values) {
addCriterion("telephone in", values, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneNotIn(List<String> values) {
addCriterion("telephone not in", values, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneBetween(String value1, String value2) {
addCriterion("telephone between", value1, value2, "telephone");
return (Criteria) this;
}
public Criteria andTelephoneNotBetween(String value1, String value2) {
addCriterion("telephone not between", value1, value2, "telephone");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;
}
public Criteria andExt1IsNotNull() {
addCriterion("ext_1 is not null");
return (Criteria) this;
}
public Criteria andExt1EqualTo(String value) {
addCriterion("ext_1 =", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotEqualTo(String value) {
addCriterion("ext_1 <>", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThan(String value) {
addCriterion("ext_1 >", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThanOrEqualTo(String value) {
addCriterion("ext_1 >=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThan(String value) {
addCriterion("ext_1 <", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThanOrEqualTo(String value) {
addCriterion("ext_1 <=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1Like(String value) {
addCriterion("ext_1 like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotLike(String value) {
addCriterion("ext_1 not like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1In(List<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> values) {
addCriterion("ext_1 not in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1Between(String value1, String value2) {
addCriterion("ext_1 between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotBetween(String value1, String value2) {
addCriterion("ext_1 not between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt2IsNull() {
addCriterion("ext_2 is null");
return (Criteria) this;
}
public Criteria andExt2IsNotNull() {
addCriterion("ext_2 is not null");
return (Criteria) this;
}
public Criteria andExt2EqualTo(String value) {
addCriterion("ext_2 =", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotEqualTo(String value) {
addCriterion("ext_2 <>", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThan(String value) {
addCriterion("ext_2 >", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThanOrEqualTo(String value) {
addCriterion("ext_2 >=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThan(String value) {
addCriterion("ext_2 <", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThanOrEqualTo(String value) {
addCriterion("ext_2 <=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2Like(String value) {
addCriterion("ext_2 like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotLike(String value) {
addCriterion("ext_2 not like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2In(List<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> values) {
addCriterion("ext_2 not in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2Between(String value1, String value2) {
addCriterion("ext_2 between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotBetween(String value1, String value2) {
addCriterion("ext_2 not between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt3IsNull() {
addCriterion("ext_3 is null");
return (Criteria) this;
}
public Criteria andExt3IsNotNull() {
addCriterion("ext_3 is not null");
return (Criteria) this;
}
public Criteria andExt3EqualTo(String value) {
addCriterion("ext_3 =", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotEqualTo(String value) {
addCriterion("ext_3 <>", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThan(String value) {
addCriterion("ext_3 >", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThanOrEqualTo(String value) {
addCriterion("ext_3 >=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThan(String value) {
addCriterion("ext_3 <", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThanOrEqualTo(String value) {
addCriterion("ext_3 <=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3Like(String value) {
addCriterion("ext_3 like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotLike(String value) {
addCriterion("ext_3 not like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3In(List<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> values) {
addCriterion("ext_3 not in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3Between(String value1, String value2) {
addCriterion("ext_3 between", value1, value2, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotBetween(String value1, String value2) {
addCriterion("ext_3 not between", value1, value2, "ext3");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,24 @@
package com.hfkj.model;
import lombok.Data;
import java.util.Date;
/**
* @className: AgentMerAllot
* @author: HuRui
* @date: 2024/6/18
**/
@Data
public class AgentMerAllot {
private String provinceCode;
private String provinceName;
private Integer merSourceType;
private String merNo;
private String merName;
private String merAddress;
private String agentName;
private Date createTime;
private String agentStaff;
}

@ -0,0 +1,69 @@
package com.hfkj.service.agent;
import com.hfkj.entity.BsAgentMer;
import com.hfkj.model.AgentMerAllot;
import java.util.List;
import java.util.Map;
/**
* @className: BsAgentMerService
* @author: HuRui
* @date: 2024/6/15
**/
public interface BsAgentMerService {
/**
* 编辑数据
* @param data
*/
void editData(BsAgentMer data);
/**
* 批量增加
* @param dataList
*/
void addData(List<BsAgentMer> dataList);
/**
* 分配代理商
* @param agentId
* @param merNoArray
*/
void assignAgent(Long agentId, List<String> merNoArray);
/**
* 解绑代理商
* @param agentId
* @param merNoArray
*/
void unbindAgent(Long agentId, List<String> merNoArray);
/**
*
* @param param
* @return
*/
List<AgentMerAllot> getAllotList(Map<String,Object> param);
/**
* 查询列表
* @param param
* @return
*/
List<BsAgentMer> getList(Map<String,Object> param);
/**
* 分配工作人员
* @param staffId
* @param merNoArray
*/
void assignStaff(Long staffId, List<String> merNoArray);
/**
* 解绑工作人员
* @param staffId
* @param merNoArray
*/
void unbindStaff(Long staffId, List<String> merNoArray);
}

@ -1,4 +1,4 @@
package com.hfkj.service;
package com.hfkj.service.agent;
import com.hfkj.entity.BsAgent;

@ -0,0 +1,66 @@
package com.hfkj.service.agent;
import com.hfkj.entity.BsAgentStaff;
import java.util.List;
import java.util.Map;
/**
* @className: BsAgentStaffService
* @author: HuRui
* @date: 2024/6/17
**/
public interface BsAgentStaffService {
/**
* 编辑工作人员数据
* @param agentStaff
*/
void editData(BsAgentStaff agentStaff);
/**
* 增加工作人员
* @param agentStaff
*/
void addStaff(BsAgentStaff agentStaff) throws Exception;
/**
* 修改工作人员
* @param agentStaff
*/
void updateStaff(BsAgentStaff agentStaff);
/**
* 删除工作人员
* @param id
*/
void delStaff(Long id);
/**
* 工作人员密码重置
* @param id
*/
void staffPwdReset(Long id);
/**
* 根据id查询
* @param id
* @return
*/
BsAgentStaff getStaffDetailById(Long id);
/**
* 查询工作人员列表
* @param param
* @return
*/
List<BsAgentStaff> getStaffList(Map<String, Object> param);
/**
* 查询工作人员
* @param agentId
* @return
*/
List<BsAgentStaff> getStaffList(Long agentId);
}

@ -0,0 +1,194 @@
package com.hfkj.service.agent.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsAgentMerMapper;
import com.hfkj.entity.*;
import com.hfkj.model.AgentMerAllot;
import com.hfkj.service.BsMerchantService;
import com.hfkj.service.agent.BsAgentMerService;
import com.hfkj.service.agent.BsAgentService;
import com.hfkj.service.agent.BsAgentStaffService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
/**
* @className: BsAgentMerServiceImpl
* @author: HuRui
* @date: 2024/6/15
**/
@Service("agentMerService")
public class BsAgentMerServiceImpl implements BsAgentMerService {
@Resource
private BsAgentMerMapper agentMerMapper;
@Resource
private BsAgentService agentService;
@Resource
private BsAgentMerService agentMerService;
@Resource
private BsAgentStaffService agentStaffService;
@Resource
private BsMerchantService merchantService;
@Override
public void editData(BsAgentMer data) {
data.setUpdateTime(new Date());
if (data.getId() == null) {
data.setCreateTime(new Date());
agentMerMapper.insert(data);
} else {
agentMerMapper.updateByPrimaryKey(data);
}
}
@Override
public void addData(List<BsAgentMer> dataList) {
agentMerMapper.addPatch(dataList);
}
@Override
public void assignAgent(Long agentId, List<String> merNoArray) {
// 代理商
BsAgent agent = agentService.getAgentById(agentId);
if (agent == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的代理商");
}
// 查询代理商的油站
Map<String,Object> param = new HashMap<>();
param.put("agentId", agent.getId());
List<BsAgentMer> agentMerList = getList(param);
List<BsAgentMer> dataList = new ArrayList<>();
BsAgentMer agentMer;
for (String merNo : merNoArray) {
// 查询门店
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
}
List<BsAgentMer> collect = agentMerList.stream().filter(o -> o.getMerNo().equals(merNo)).collect(Collectors.toList());
if (collect.isEmpty()) {
agentMer = new BsAgentMer();
agentMer.setAgentId(agent.getId());
agentMer.setAgentName(agent.getName());
agentMer.setAgentName(agent.getName());
agentMer.setMerId(merchant.getId());
agentMer.setMerNo(merchant.getMerNo());
agentMer.setMerName(merchant.getMerName());
agentMer.setStatus(1);
agentMer.setCreateTime(new Date());
agentMer.setUpdateTime(new Date());
dataList.add(agentMer);
}
}
agentMerService.addData(dataList);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void unbindAgent(Long agentId, List<String> merNoArray) {
// 删除代理商商户
BsAgentMer agentMer = new BsAgentMer();
agentMer.setStatus(0);
BsAgentMerExample example = new BsAgentMerExample();
example.createCriteria().andAgentIdEqualTo(agentId).andMerNoIn(merNoArray).andStatusNotEqualTo(0);
agentMerMapper.updateByExampleSelective(agentMer, example);
// 删除代理商下的工作人员商户
List<Long> staffIdList = agentStaffService.getStaffList(agentId)
.stream()
.flatMapToLong(num -> LongStream.of(num.getId())).boxed()
.collect(Collectors.toList());
example.clear();
example.createCriteria().andAgentStaffIdIn(staffIdList).andMerNoIn(merNoArray).andStatusNotEqualTo(0);
agentMerMapper.updateByExampleSelective(agentMer, example);
}
@Override
public List<AgentMerAllot> getAllotList(Map<String, Object> param) {
return agentMerMapper.getAllotList(param);
}
@Override
public List<BsAgentMer> getList(Map<String, Object> param) {
BsAgentMerExample example = new BsAgentMerExample();
BsAgentMerExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "agentId") != null) {
criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId"));
}
if (MapUtils.getLong(param, "agentStaffId") != null) {
criteria.andAgentStaffIdEqualTo(MapUtils.getLong(param, "agentStaffId"));
}
example.setOrderByClause("create_time desc");
return agentMerMapper.selectByExample(example);
}
@Override
public void assignStaff(Long staffId, List<String> merNoArray) {
// 代理商工作人员
BsAgentStaff staff = agentStaffService.getStaffDetailById(staffId);
if (staff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的代理商");
}
// 代理商
BsAgent agent = agentService.getAgentById(staff.getAgentId());
if (agent == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的代理商");
}
// 查询代理商工作人员的油站
Map<String,Object> param = new HashMap<>();
param.put("agentStaffId", agent.getId());
List<BsAgentMer> agentMerList = getList(param);
List<BsAgentMer> dataList = new ArrayList<>();
BsAgentMer agentMer;
for (String merNo : merNoArray) {
// 查询门店
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
}
List<BsAgentMer> collect = agentMerList.stream().filter(o -> o.getMerNo().equals(merNo)).collect(Collectors.toList());
if (collect.isEmpty()) {
agentMer = new BsAgentMer();
agentMer.setAgentId(agent.getId());
agentMer.setAgentName(agent.getName());
agentMer.setAgentName(agent.getName());
agentMer.setAgentStaffId(staff.getId());
agentMer.setAgentStaffName(staff.getName());
agentMer.setMerId(merchant.getId());
agentMer.setMerNo(merchant.getMerNo());
agentMer.setMerName(merchant.getMerName());
agentMer.setStatus(1);
agentMer.setCreateTime(new Date());
agentMer.setUpdateTime(new Date());
dataList.add(agentMer);
}
}
agentMerService.addData(dataList);
}
@Override
public void unbindStaff(Long staffId, List<String> merNoArray) {
// 删除商户
BsAgentMer agentMer = new BsAgentMer();
agentMer.setStatus(0);
BsAgentMerExample example = new BsAgentMerExample();
example.createCriteria().andAgentStaffIdEqualTo(staffId).andMerNoIn(merNoArray).andStatusNotEqualTo(0);
agentMerMapper.updateByExampleSelective(agentMer, example);
}
}

@ -1,4 +1,4 @@
package com.hfkj.service.impl;
package com.hfkj.service.agent.impl;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.common.utils.RedisUtil;
@ -6,7 +6,7 @@ import com.hfkj.dao.BsAgentMapper;
import com.hfkj.entity.BsAgent;
import com.hfkj.entity.BsAgentExample;
import com.hfkj.entity.SecUser;
import com.hfkj.service.BsAgentService;
import com.hfkj.service.agent.BsAgentService;
import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import org.apache.commons.collections4.MapUtils;
@ -111,10 +111,6 @@ public class BsAgentServiceImpl implements BsAgentService {
BsAgentExample example = new BsAgentExample();
BsAgentExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "agentNo"))) {
criteria.andAgentNoLike("%" + MapUtils.getString(param, "agentNo") + "%");
}

@ -0,0 +1,169 @@
package com.hfkj.service.agent.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.dao.BsAgentStaffMapper;
import com.hfkj.entity.BsAgentStaff;
import com.hfkj.entity.BsAgentStaffExample;
import com.hfkj.entity.SecUser;
import com.hfkj.service.agent.BsAgentStaffService;
import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.SecUserStatusEnum;
import com.hfkj.sysenum.agent.AgentStaffStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsAgentStaffServiceImpl
* @author: HuRui
* @date: 2024/6/17
**/
@Service("agentStaffService")
public class BsAgentStaffServiceImpl implements BsAgentStaffService {
@Resource
private BsAgentStaffMapper agentStaffMapper;
@Resource
private SecUserService userService;
@Override
public void editData(BsAgentStaff agentStaff) {
if (agentStaff.getId() == null) {
agentStaff.setCreateTime(new Date());
agentStaff.setUpdateTime(new Date());
agentStaffMapper.insert(agentStaff);
} else {
agentStaff.setUpdateTime(new Date());
agentStaffMapper.updateByPrimaryKey(agentStaff);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void addStaff(BsAgentStaff agentStaff) throws Exception {
if (userService.getDetailByLoginName(agentStaff.getTelephone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "电话已存在,请更换");
}
agentStaff.setStatus(AgentStaffStatusEnum.status1.getStatus());
editData(agentStaff);
SecUser secUser = new SecUser();
secUser.setAvatar(agentStaff.getAvatar());
secUser.setUserName(agentStaff.getName());
secUser.setLoginName(agentStaff.getTelephone());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setStatus(1);
secUser.setRoleId(6L);
secUser.setObjectType(SecUserObjectTypeEnum.type5.getCode());
secUser.setObjectId(agentStaff.getId());
secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date());
userService.editUser(secUser);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateStaff(BsAgentStaff gasStaff) {
// 查询账户
SecUser account = userService.getDetail(SecUserObjectTypeEnum.type5, gasStaff.getId());
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户信息");
}
if (!account.getLoginName().equals(gasStaff.getTelephone())) {
if (userService.getDetailByLoginName(gasStaff.getTelephone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换");
}
account.setLoginName(gasStaff.getTelephone());
}
editData(gasStaff);
account.setUserName(gasStaff.getName());
userService.editUser(account);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void delStaff(Long id) {
BsAgentStaff agentStaff = getStaffDetailById(id);
if (agentStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到工作人员");
}
agentStaff.setStatus(AgentStaffStatusEnum.status0.getStatus());
editData(agentStaff);
// 查询账户
SecUser account = userService.getDetail(SecUserObjectTypeEnum.type5, agentStaff.getId());
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户");
}
account.setStatus(SecUserStatusEnum.status0.getCode());
userService.editUser(account);
}
@Override
public void staffPwdReset(Long id) {
try {
BsAgentStaff staff = getStaffDetailById(id);
if (staff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到工作人员信息");
}
// 查询账户
SecUser account = userService.getDetail(SecUserObjectTypeEnum.type5, staff.getId());
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到工作人员账户信息");
}
account.setPassword(MD5Util.encode("123456".getBytes()));
userService.editUser(account);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public BsAgentStaff getStaffDetailById(Long id) {
return agentStaffMapper.selectByPrimaryKey(id);
}
@Override
public List<BsAgentStaff> getStaffList(Map<String, Object> param) {
BsAgentStaffExample example = new BsAgentStaffExample();
BsAgentStaffExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "agentId") != null) {
criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "name"))) {
criteria.andNameLike("%" + MapUtils.getString(param, "name") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "telephone"))) {
criteria.andTelephoneLike("%" + MapUtils.getString(param, "telephone") + "%");
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
example.setOrderByClause("create_time desc");
return agentStaffMapper.selectByExample(example);
}
@Override
public List<BsAgentStaff> getStaffList(Long agentId) {
BsAgentStaffExample example = new BsAgentStaffExample();
example.createCriteria().andAgentIdEqualTo(agentId).andStatusNotEqualTo(0);
return agentStaffMapper.selectByExample(example);
}
}

@ -0,0 +1,34 @@
package com.hfkj.sysenum.agent;
import lombok.Getter;
/**
* 代理商工作人员状态
* @author hurui
*/
@Getter
public enum AgentStaffStatusEnum {
/**
* 删除
*/
status0(0 , "删除"),
/**
* 正常
*/
status1(1 , "正常"),
/**
* 禁用
*/
status2(2 , "禁用"),
;
private Integer status;
private String name;
AgentStaffStatusEnum(int status , String name) {
this.status = status;
this.name = name;
}
}
Loading…
Cancel
Save