*/ | */ | ||||
public static String dspURL; | public static String dspURL; | ||||
/** | |||||
* 高德KEY | |||||
*/ | |||||
public static String gaodeKey; | |||||
/** | /** | ||||
* 机场url | * 机场url | ||||
* @param url | * @param url | ||||
public void dspURL(String url) { | public void dspURL(String url) { | ||||
dspURL = url; | dspURL = url; | ||||
} | } | ||||
/** | |||||
* 高德KEY赋值 | |||||
* | |||||
* @param key 高德KEY | |||||
*/ | |||||
@Value("${tuoheng.gaodeKey}") | |||||
public void setGaodeKey(String key) { | |||||
gaodeKey = key; | |||||
} | |||||
} | } |
package com.tuoheng.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.tuoheng.model.entity.TenantEmploy; | |||||
import org.apache.ibatis.annotations.Mapper; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_ employ】的数据库操作Mapper | |||||
* @createDate 2023-03-08 14:33:40 | |||||
* @Entity com.tuoheng.model.entity.Tenant employ | |||||
*/ | |||||
@Mapper | |||||
public interface TenantEmployMapper extends BaseMapper<TenantEmploy> { | |||||
} | |||||
package com.tuoheng.mapper; | |||||
import com.tuoheng.model.entity.TenantItem; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Mapper; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_item】的数据库操作Mapper | |||||
* @createDate 2023-03-08 14:11:43 | |||||
* @Entity com.tuoheng.model.entity.TenantItem | |||||
*/ | |||||
@Mapper | |||||
public interface TenantItemMapper extends BaseMapper<TenantItem> { | |||||
} | |||||
package com.tuoheng.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
import lombok.Data; | |||||
/** | |||||
* | |||||
* @TableName t_tenant_employ | |||||
*/ | |||||
@TableName(value ="t_tenant_employ") | |||||
@Data | |||||
public class TenantEmploy implements Serializable { | |||||
/** | |||||
* | |||||
*/ | |||||
@TableId(type = IdType.ASSIGN_ID) | |||||
private Long id; | |||||
/** | |||||
* | |||||
*/ | |||||
private Date createTime; | |||||
/** | |||||
* | |||||
*/ | |||||
private Date updateTime; | |||||
/** | |||||
* | |||||
*/ | |||||
private Long createUser; | |||||
/** | |||||
* | |||||
*/ | |||||
private Long updateUser; | |||||
/** | |||||
* 租户id | |||||
*/ | |||||
private Long tenantId; | |||||
/** | |||||
* 服务实例id | |||||
*/ | |||||
private String serviceId; | |||||
/** | |||||
* 识别详情 | |||||
*/ | |||||
private String description; | |||||
@TableField(exist = false) | |||||
private static final long serialVersionUID = 1L; | |||||
} |
package com.tuoheng.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
import lombok.Data; | |||||
/** | |||||
* | |||||
* @TableName t_tenant_item | |||||
*/ | |||||
@TableName(value ="t_tenant_item") | |||||
@Data | |||||
public class TenantItem implements Serializable { | |||||
/** | |||||
* | |||||
*/ | |||||
@TableId(type = IdType.ASSIGN_ID) | |||||
private Long id; | |||||
/** | |||||
* | |||||
*/ | |||||
private Date createTime; | |||||
/** | |||||
* | |||||
*/ | |||||
private Date updateTime; | |||||
/** | |||||
* | |||||
*/ | |||||
private Long createUser; | |||||
/** | |||||
* | |||||
*/ | |||||
private Long updateUser; | |||||
/** | |||||
* 销售人员id | |||||
*/ | |||||
private Long mrakerId; | |||||
/** | |||||
* 租户id | |||||
*/ | |||||
private Long tenantId; | |||||
/** | |||||
* 立项编号 | |||||
*/ | |||||
private String projectCode; | |||||
/** | |||||
* 合同编号 | |||||
*/ | |||||
private String contractCode; | |||||
/** | |||||
* 项目起始时间 | |||||
*/ | |||||
private Date beginTime; | |||||
/** | |||||
* 项目失效时间 | |||||
*/ | |||||
private Date endTime; | |||||
@TableField(exist = false) | |||||
private static final long serialVersionUID = 1L; | |||||
} |
*/ | */ | ||||
@Data | @Data | ||||
public class ClientRoleDto { | public class ClientRoleDto { | ||||
/** | |||||
* 平台标识 | |||||
*/ | |||||
private String clientId; | private String clientId; | ||||
/** | |||||
* 该平台对应角色id | |||||
*/ | |||||
private Integer roleId; | private Integer roleId; | ||||
/** | |||||
* 该平台对应服务实例id | |||||
*/ | |||||
private String serviceId; | |||||
/** | |||||
* 识别详情 | |||||
*/ | |||||
private String description; | |||||
} | } |
package com.tuoheng.model.param; | package com.tuoheng.model.param; | ||||
import com.tuoheng.model.entity.TenantItem; | |||||
import lombok.Data; | import lombok.Data; | ||||
import javax.validation.constraints.NotEmpty; | import javax.validation.constraints.NotEmpty; | ||||
* 区县名称 | * 区县名称 | ||||
*/ | */ | ||||
private String districtName; | private String districtName; | ||||
/** | |||||
* 租户对应项目基本信息 | |||||
*/ | |||||
private TenantItem tenantItem; | |||||
private String customer; | |||||
private String customerPhone; | |||||
private String adress; | |||||
private String lng; | |||||
private String lat; | |||||
} | } |
*/ | */ | ||||
private String districtName; | private String districtName; | ||||
private String username; | |||||
private String customer; | |||||
private String customerPhone; | |||||
private String adress; | |||||
private String lng; | |||||
private String lat; | |||||
} | } |
package com.tuoheng.service; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import com.tuoheng.model.entity.TenantEmploy; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_ employ】的数据库操作Service | |||||
* @createDate 2023-03-08 14:33:40 | |||||
*/ | |||||
public interface TenantEmployService extends IService<TenantEmploy> { | |||||
} |
package com.tuoheng.service; | |||||
import com.tuoheng.model.entity.TenantItem; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_item】的数据库操作Service | |||||
* @createDate 2023-03-08 14:11:43 | |||||
*/ | |||||
public interface TenantItemService extends IService<TenantItem> { | |||||
} |
package com.tuoheng.service.impl; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.tuoheng.mapper.TenantEmployMapper; | |||||
import com.tuoheng.model.entity.TenantEmploy; | |||||
import com.tuoheng.service.TenantEmployService; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_ employ】的数据库操作Service实现 | |||||
* @createDate 2023-03-08 14:33:40 | |||||
*/ | |||||
@Service | |||||
public class TenantEmployServiceImpl extends ServiceImpl<TenantEmployMapper, TenantEmploy> | |||||
implements TenantEmployService { | |||||
} | |||||
package com.tuoheng.service.impl; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.tuoheng.model.entity.TenantItem; | |||||
import com.tuoheng.service.TenantItemService; | |||||
import com.tuoheng.mapper.TenantItemMapper; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* @author 小影 | |||||
* @description 针对表【t_tenant_item】的数据库操作Service实现 | |||||
* @createDate 2023-03-08 14:11:43 | |||||
*/ | |||||
@Service | |||||
public class TenantItemServiceImpl extends ServiceImpl<TenantItemMapper, TenantItem> | |||||
implements TenantItemService{ | |||||
} | |||||
package com.tuoheng.service.impl; | package com.tuoheng.service.impl; | ||||
import cn.hutool.core.convert.Convert; | import cn.hutool.core.convert.Convert; | ||||
import cn.hutool.core.date.DateUtil; | |||||
import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.tuoheng.common.CommonConfig; | |||||
import com.tuoheng.common.ServiceException; | import com.tuoheng.common.ServiceException; | ||||
import com.tuoheng.constant.*; | import com.tuoheng.constant.*; | ||||
import com.tuoheng.mapper.*; | import com.tuoheng.mapper.*; | ||||
import com.tuoheng.model.dto.*; | import com.tuoheng.model.dto.*; | ||||
import com.tuoheng.model.entity.TenantEmploy; | |||||
import com.tuoheng.model.entity.TenantItem; | |||||
import com.tuoheng.model.param.*; | import com.tuoheng.model.param.*; | ||||
import com.tuoheng.model.po.AuthoritiesPo; | import com.tuoheng.model.po.AuthoritiesPo; | ||||
import com.tuoheng.model.po.ClientUserRolePo; | import com.tuoheng.model.po.ClientUserRolePo; | ||||
import com.tuoheng.model.vo.BusinessSystemVo; | import com.tuoheng.model.vo.BusinessSystemVo; | ||||
import com.tuoheng.model.vo.TenantVo; | import com.tuoheng.model.vo.TenantVo; | ||||
import com.tuoheng.model.vo.UserVo; | import com.tuoheng.model.vo.UserVo; | ||||
import com.tuoheng.service.TenantEmployService; | |||||
import com.tuoheng.service.TenantService; | import com.tuoheng.service.TenantService; | ||||
import com.tuoheng.until.JsonResult; | import com.tuoheng.until.JsonResult; | ||||
import com.tuoheng.until.MapUtils; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Comparator; | import java.util.Comparator; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@Autowired | @Autowired | ||||
private PlatformMapper platformMapper; | private PlatformMapper platformMapper; | ||||
@Autowired | |||||
private TenantEmployMapper tenantEmployMapper; | |||||
@Autowired | |||||
private TenantItemMapper tenantItemMapper; | |||||
@Override | @Override | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
if (clientUserMapper.judgeCreateByUserName(createClientTenantDto.getUsername()) > 0) { | if (clientUserMapper.judgeCreateByUserName(createClientTenantDto.getUsername()) > 0) { | ||||
return JsonResult.error("该用户名称已存在!"); | return JsonResult.error("该用户名称已存在!"); | ||||
} | } | ||||
//code复用username | |||||
createClientTenantDto.setTenantCode(createClientTenantDto.getTenantName()); | |||||
//用户表 | //用户表 | ||||
UserPo userPo = new UserPo() | UserPo userPo = new UserPo() | ||||
.setIsTenant(1) | .setIsTenant(1) | ||||
.setPassword("{bcrypt}" + new BCryptPasswordEncoder().encode(createClientTenantDto.getPassword())); | .setPassword("{bcrypt}" + new BCryptPasswordEncoder().encode(createClientTenantDto.getPassword())); | ||||
userPo.setCreateUser(loginUser.getUserId()); | userPo.setCreateUser(loginUser.getUserId()); | ||||
clientUserMapper.insertClientUser(userPo); | clientUserMapper.insertClientUser(userPo); | ||||
log.info("用户表添加完毕"); | |||||
//调用高德将地址转换经纬度 | |||||
Map lonAndLat = MapUtils.getLonAndLat(createClientTenantDto.getAdress(), CommonConfig.gaodeKey); | |||||
//租户表 | //租户表 | ||||
TenantPo tenantPo = new TenantPo(); | TenantPo tenantPo = new TenantPo(); | ||||
BeanUtils.copyProperties(createClientTenantDto, tenantPo); | BeanUtils.copyProperties(createClientTenantDto, tenantPo); | ||||
tenantPo.setName(createClientTenantDto.getTenantName()) | tenantPo.setName(createClientTenantDto.getTenantName()) | ||||
.setCode(createClientTenantDto.getTenantCode()) | .setCode(createClientTenantDto.getTenantCode()) | ||||
.setUserId(userPo.getId()); | |||||
.setUserId(userPo.getId()) | |||||
//获取经纬度更新 | |||||
.setLat(lonAndLat.get("lat").toString()) | |||||
.setLng(lonAndLat.get("lng").toString()); | |||||
tenantMapper.insertTenant(tenantPo); | tenantMapper.insertTenant(tenantPo); | ||||
log.info("租户表添加完毕"); | |||||
//添加租户对应项目详细信息表 | |||||
TenantItem tenantItem = createClientTenantDto.getTenantItem(); | |||||
tenantItem.setTenantId(tenantPo.getId()); | |||||
tenantItemMapper.insert(tenantItem); | |||||
log.info("租户项目表添加完毕"); | |||||
for (ClientRoleDto clientRoleDto : createClientTenantDto.getClientRoleDtoList()) { | |||||
//添加租户对应服务的相关表数据 | |||||
TenantEmploy tenantEmploy = new TenantEmploy(); | |||||
tenantEmploy.setTenantId(tenantPo.getId()); | |||||
tenantEmploy.setServiceId(clientRoleDto.getServiceId()); | |||||
tenantEmploy.setDescription(clientRoleDto.getDescription()); | |||||
tenantEmployMapper.insert(tenantEmploy); | |||||
} | |||||
log.info("租户客户表添加完毕"); | |||||
//1.开始判断租户对应需要的平台并进行匹对 | //1.开始判断租户对应需要的平台并进行匹对 | ||||
List<ClientRoleDto> clientRoleDtoList = getClientRoleDtos(createClientTenantDto); | List<ClientRoleDto> clientRoleDtoList = getClientRoleDtos(createClientTenantDto); | ||||
List<AuthoritiesPo> authoritiesPos = new ArrayList<>(); | List<AuthoritiesPo> authoritiesPos = new ArrayList<>(); | ||||
List<ClientUserRolePo> clientUserRolePoArrayList = new ArrayList<>(); | List<ClientUserRolePo> clientUserRolePoArrayList = new ArrayList<>(); | ||||
//添加租户对应相关信息 | |||||
//2.添加租户对应相关信息 | |||||
log.info("开始创建对应各个业务平台的表"); | |||||
for (ClientRoleDto clientRoleDto : clientRoleDtoList) { | for (ClientRoleDto clientRoleDto : clientRoleDtoList) { | ||||
//添加角色权限相关 | |||||
AuthoritiesPo authoritiesPo = new AuthoritiesPo() | AuthoritiesPo authoritiesPo = new AuthoritiesPo() | ||||
.setUserId(userPo.getId()) | .setUserId(userPo.getId()) | ||||
.setUsername(createClientTenantDto.getUsername()) | .setUsername(createClientTenantDto.getUsername()) | ||||
return JsonResult.success(); | return JsonResult.success(); | ||||
} | } | ||||
/** | /** | ||||
* 查询租户以及该租户对应绑定的系统等 | * 查询租户以及该租户对应绑定的系统等 | ||||
* | * |
package com.tuoheng.until; | |||||
import com.alibaba.fastjson.JSONArray; | |||||
import com.alibaba.fastjson.JSONObject; | |||||
import com.tuoheng.common.CommonConfig; | |||||
import java.io.BufferedReader; | |||||
import java.io.InputStreamReader; | |||||
import java.net.URL; | |||||
import java.net.URLConnection; | |||||
import java.util.HashMap; | |||||
import java.util.Map; | |||||
public class MapUtils { | |||||
public static void main(String[] args) { | |||||
try { | |||||
// 1、根据地址获取经纬度 | |||||
Map<String, String> lonAndLat = getLonAndLat("浙江省杭州市滨江区江汉路1515号", CommonConfig.gaodeKey); | |||||
System.out.println("转换后经纬度为:" + lonAndLat); | |||||
// 2、根据经纬度获取地址 | |||||
String formattedAddress = getAMapByLngAndLat("120.204798", "30.201000", CommonConfig.gaodeKey); | |||||
System.out.println("转换后地址为:" + formattedAddress); | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
/** | |||||
* 地址转换为经纬度 | |||||
* | |||||
* @param address 地址 | |||||
* @param key 高德地图应用key | |||||
* @return 经纬度 | |||||
*/ | |||||
public static Map getLonAndLat(String address, String key) { | |||||
// 返回输入地址address的经纬度信息, 格式是 经度,纬度 | |||||
String queryUrl = "http://restapi.amap.com/v3/geocode/geo?key=" + key + "&address=" + address; | |||||
// 高德接口返回的是JSON格式的字符串 | |||||
String queryResult = getResponse(queryUrl); | |||||
Map<String, String> map = new HashMap<String, String>(); | |||||
JSONObject obj = JSONObject.parseObject(queryResult); | |||||
if (obj.get("status").toString().equals("1")) { | |||||
JSONObject jobJSON = JSONObject.parseObject(obj.get("geocodes").toString().substring(1, obj.get("geocodes").toString().length() - 1)); | |||||
String location = jobJSON.get("location").toString(); | |||||
System.out.println("经纬度:" + location); | |||||
String[] lonAndLat = location.split(","); | |||||
if (lonAndLat != null && lonAndLat.length == 2) { | |||||
map.put("lng", lonAndLat[0]); | |||||
map.put("lat", lonAndLat[1]); | |||||
} | |||||
System.out.println(map); | |||||
return map; | |||||
} else { | |||||
throw new RuntimeException("地址转换经纬度失败,错误码:" + obj.get("infocode")); | |||||
} | |||||
} | |||||
/** | |||||
* 将经纬度getLng, getLat 通过getAMapByLngAndLat方法转换地址 | |||||
* | |||||
* @param getLng 经度 | |||||
* @param getLat 纬度 | |||||
* @param key 高德地图应用key | |||||
* @return 地址名称 | |||||
* @throws Exception | |||||
*/ | |||||
public static String getAMapByLngAndLat(String getLng, String getLat, String key) throws Exception { | |||||
String url; | |||||
try { | |||||
url = "http://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + getLng + "," | |||||
+ getLat + "&key=" + key + "&radius=0&extensions=base"; | |||||
String queryResult = getResponse(url); // 高德接品返回的是JSON格式的字符串 | |||||
// 将获取结果转为json数据 | |||||
JSONObject obj = JSONObject.parseObject(queryResult); | |||||
System.out.println("obj为:" + obj); | |||||
if (obj.get("status").toString().equals("1")) { | |||||
// 如果没有返回-1 | |||||
JSONObject regeocode = obj.getJSONObject("regeocode"); | |||||
if (regeocode.size() > 0) { | |||||
// 在regeocode中拿到 formatted_address 具体位置 | |||||
return regeocode.get("formatted_address").toString(); | |||||
} else { | |||||
throw new RuntimeException("未找到相匹配的地址!"); | |||||
} | |||||
} else { | |||||
throw new RuntimeException("请求错误!"); | |||||
} | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
return "-1"; | |||||
} | |||||
/** | |||||
* 根据两个定位点的经纬度算出两点间的距离 | |||||
* | |||||
* @param startLonLat 起始经纬度 | |||||
* @param endLonLat 结束经纬度(目标经纬度) | |||||
* @param key 高德地图应用key | |||||
* @return 两个定位点之间的距离 | |||||
*/ | |||||
private static long getDistance(String startLonLat, String endLonLat, String key) { | |||||
// 返回起始地startAddr与目的地endAddr之间的距离,单位:米 | |||||
Long result = new Long(0); | |||||
String queryUrl = "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat + "&destination=" + endLonLat; | |||||
String queryResult = getResponse(queryUrl); | |||||
JSONObject obj = JSONObject.parseObject(queryResult); | |||||
JSONArray ja = obj.getJSONArray("results"); | |||||
JSONObject jobO = JSONObject.parseObject(ja.getString(0)); | |||||
result = Long.parseLong(jobO.get("distance").toString()); | |||||
System.out.println("距离:" + result); | |||||
return result; | |||||
} | |||||
/** | |||||
* 发送请求 | |||||
* | |||||
* @param serverUrl 请求地址 | |||||
*/ | |||||
private static String getResponse(String serverUrl) { | |||||
// 用JAVA发起http请求,并返回json格式的结果 | |||||
StringBuffer result = new StringBuffer(); | |||||
try { | |||||
URL url = new URL(serverUrl); | |||||
URLConnection conn = url.openConnection(); | |||||
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); | |||||
String line; | |||||
while ((line = in.readLine()) != null) { | |||||
result.append(line); | |||||
} | |||||
in.close(); | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
return result.toString(); | |||||
} | |||||
} | |||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
# 自定义配置 | # 自定义配置 | ||||
tuoheng: | tuoheng: | ||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport.t-aaron.com | |||||
airport-url: https://airport.t-aaron.com | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
<?xml version="1.0" encoding="UTF-8" ?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |||||
<mapper namespace="com.tuoheng.mapper.TenantEmployMapper"> | |||||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.TenantItem"> | |||||
<id property="id" column="id" jdbcType="BIGINT"/> | |||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||||
<result property="createUser" column="create_user" jdbcType="BIGINT"/> | |||||
<result property="updateUser" column="update_user" jdbcType="BIGINT"/> | |||||
<result property="mrakerId" column="mraker_id" jdbcType="BIGINT"/> | |||||
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/> | |||||
<result property="projectCode" column="project_code" jdbcType="VARCHAR"/> | |||||
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/> | |||||
<result property="beginTime" column="begin_time" jdbcType="TIMESTAMP"/> | |||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/> | |||||
</resultMap> | |||||
<sql id="Base_Column_List"> | |||||
id,create_time,update_time, | |||||
create_user,update_user,mraker_id, | |||||
tenant_id,project_code,contract_code, | |||||
begin_time,end_time | |||||
</sql> | |||||
</mapper> |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper | |||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.tuoheng.mapper.TenantItemMapper"> | |||||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.TenantItem"> | |||||
<id property="id" column="id" jdbcType="BIGINT"/> | |||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||||
<result property="createUser" column="create_user" jdbcType="BIGINT"/> | |||||
<result property="updateUser" column="update_user" jdbcType="BIGINT"/> | |||||
<result property="mrakerId" column="mraker_id" jdbcType="BIGINT"/> | |||||
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/> | |||||
<result property="projectCode" column="project_code" jdbcType="VARCHAR"/> | |||||
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/> | |||||
<result property="beginTime" column="begin_time" jdbcType="TIMESTAMP"/> | |||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/> | |||||
</resultMap> | |||||
<sql id="Base_Column_List"> | |||||
id,create_time,update_time, | |||||
create_user,update_user,mraker_id, | |||||
tenant_id,project_code,contract_code, | |||||
begin_time,end_time | |||||
</sql> | |||||
</mapper> |
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | <insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | ||||
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | ||||
district_code, district_name) | |||||
district_code, district_name, customer, customer_phone, adress, lng, lat) | |||||
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}, | VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}, | ||||
#{districtCode}, #{districtName}) | |||||
#{districtCode}, #{districtName}, #{customer}, #{customerPhone}, #{adress}, #{lng}, #{lat}) | |||||
</insert> | </insert> | ||||
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | <update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | ||||
update t_tenant | update t_tenant |
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
# 自定义配置 | # 自定义配置 | ||||
tuoheng: | tuoheng: | ||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport.t-aaron.com | |||||
airport-url: https://airport.t-aaron.com | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||||
# 高德Key | |||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a |
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | <insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | ||||
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | ||||
district_code, district_name) | |||||
district_code, district_name, customer, customer_phone, adress, lng, lat) | |||||
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}, | VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}, | ||||
#{districtCode}, #{districtName}) | |||||
#{districtCode}, #{districtName}, #{customer}, #{customerPhone}, #{adress}, #{lng}, #{lat}) | |||||
</insert> | </insert> | ||||
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | <update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | ||||
update t_tenant | update t_tenant |