短信搜索,公司信息展示。

master
Administrator 2 years ago
parent f5485c2158
commit be0f197160

@ -11,5 +11,10 @@ public interface WebMasterConstants {
*/ */
String KAPTCHA = "kaptcha"; String KAPTCHA = "kaptcha";
/**
*
*/
String ROOT = "管理员";
} }

@ -0,0 +1,73 @@
package com.mashibing.webmaster.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.alibaba.druid.util.StringUtils;
import com.mashibing.common.constant.WebMasterConstants;
import com.mashibing.common.enums.ExceptionEnums;
import com.mashibing.common.util.R;
import com.mashibing.common.vo.ResultVO;
import com.mashibing.webmaster.entity.ClientBusiness;
import com.mashibing.webmaster.entity.SmsUser;
import com.mashibing.webmaster.service.ClientBusinessService;
import com.mashibing.webmaster.service.SmsRoleService;
import com.mashibing.webmaster.vo.ClientBusinessVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Controller
* @author zjw
* @description
*/
@RestController
@Slf4j
public class ClientBusinessController {
@Autowired
private SmsRoleService roleService;
@Autowired
private ClientBusinessService clientBusinessService;
@GetMapping("/sys/clientbusiness/all")
public ResultVO all(){
//1、拿到当前登录用户的信息
SmsUser smsUser = (SmsUser) SecurityUtils.getSubject().getPrincipal();
if(smsUser == null){
log.info("【获取客户信息】 用户未登录!!");
return R.error(ExceptionEnums.NOT_LOGIN);
}
Integer userId = smsUser.getId();
//2、查询当前用户的角色信息
Set<String> roleNameSet = roleService.getRoleName(userId);
//3、根据角色信息查询数据即可。
List<ClientBusiness> list = null;
if(roleNameSet != null && roleNameSet.contains(WebMasterConstants.ROOT)){
// 查询全部即可
list = clientBusinessService.findAll();
}else{
// 根据用户id查询指定的公司信息
list = clientBusinessService.findByUserId(userId);
}
List<ClientBusinessVO> data = new ArrayList<>();
for (ClientBusiness clientBusiness : list) {
ClientBusinessVO vo = new ClientBusinessVO();
BeanUtils.copyProperties(clientBusiness,vo);
data.add(vo);
}
//4、响应数据
return R.ok(data);
}
}

@ -0,0 +1,188 @@
package com.mashibing.webmaster.entity;
import lombok.ToString;
import java.util.Date;
@ToString
public class ClientBusiness {
private Long id;
private String corpname;
private String apikey;
private String ipAddress;
private Byte isCallback;
private String callbackUrl;
private String clientLinkname;
private String clientPhone;
private String clientFilters;
private Date created;
private Long createId;
private Date updated;
private Long updateId;
private Byte isDelete;
private String extend1;
private String extend2;
private String extend3;
private String extend4;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCorpname() {
return corpname;
}
public void setCorpname(String corpname) {
this.corpname = corpname == null ? null : corpname.trim();
}
public String getApikey() {
return apikey;
}
public void setApikey(String apikey) {
this.apikey = apikey == null ? null : apikey.trim();
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress == null ? null : ipAddress.trim();
}
public Byte getIsCallback() {
return isCallback;
}
public void setIsCallback(Byte isCallback) {
this.isCallback = isCallback;
}
public String getCallbackUrl() {
return callbackUrl;
}
public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = callbackUrl == null ? null : callbackUrl.trim();
}
public String getClientLinkname() {
return clientLinkname;
}
public void setClientLinkname(String clientLinkname) {
this.clientLinkname = clientLinkname == null ? null : clientLinkname.trim();
}
public String getClientPhone() {
return clientPhone;
}
public void setClientPhone(String clientPhone) {
this.clientPhone = clientPhone == null ? null : clientPhone.trim();
}
public String getClientFilters() {
return clientFilters;
}
public void setClientFilters(String clientFilters) {
this.clientFilters = clientFilters == null ? null : clientFilters.trim();
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Byte getIsDelete() {
return isDelete;
}
public void setIsDelete(Byte isDelete) {
this.isDelete = isDelete;
}
public String getExtend1() {
return extend1;
}
public void setExtend1(String extend1) {
this.extend1 = extend1 == null ? null : extend1.trim();
}
public String getExtend2() {
return extend2;
}
public void setExtend2(String extend2) {
this.extend2 = extend2 == null ? null : extend2.trim();
}
public String getExtend3() {
return extend3;
}
public void setExtend3(String extend3) {
this.extend3 = extend3 == null ? null : extend3.trim();
}
public String getExtend4() {
return extend4;
}
public void setExtend4(String extend4) {
this.extend4 = extend4 == null ? null : extend4.trim();
}
}

@ -1,8 +1,9 @@
package com.mashibing.webmaster.entity; package com.mashibing.webmaster.entity;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class SmsMenu { public class SmsMenu implements Serializable {
private Integer id; private Integer id;
private String name; private String name;

@ -1,8 +1,9 @@
package com.mashibing.webmaster.entity; package com.mashibing.webmaster.entity;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class SmsRole { public class SmsRole implements Serializable {
private Integer id; private Integer id;
private String name; private String name;

@ -1,8 +1,9 @@
package com.mashibing.webmaster.entity; package com.mashibing.webmaster.entity;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class SmsUser { public class SmsUser implements Serializable {
private Integer id; private Integer id;
private String username; private String username;

@ -0,0 +1,30 @@
package com.mashibing.webmaster.mapper;
import com.mashibing.webmaster.entity.ClientBusiness;
import com.mashibing.webmaster.entity.ClientBusinessExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ClientBusinessMapper {
long countByExample(ClientBusinessExample example);
int deleteByExample(ClientBusinessExample example);
int deleteByPrimaryKey(Long id);
int insert(ClientBusiness row);
int insertSelective(ClientBusiness row);
List<ClientBusiness> selectByExample(ClientBusinessExample example);
ClientBusiness selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("row") ClientBusiness row, @Param("example") ClientBusinessExample example);
int updateByExample(@Param("row") ClientBusiness row, @Param("example") ClientBusinessExample example);
int updateByPrimaryKeySelective(ClientBusiness row);
int updateByPrimaryKey(ClientBusiness row);
}

@ -3,7 +3,11 @@ package com.mashibing.webmaster.mapper;
import com.mashibing.webmaster.entity.SmsRole; import com.mashibing.webmaster.entity.SmsRole;
import com.mashibing.webmaster.entity.SmsRoleExample; import com.mashibing.webmaster.entity.SmsRoleExample;
import java.util.List; import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
public interface SmsRoleMapper { public interface SmsRoleMapper {
long countByExample(SmsRoleExample example); long countByExample(SmsRoleExample example);
@ -27,4 +31,16 @@ public interface SmsRoleMapper {
int updateByPrimaryKeySelective(SmsRole row); int updateByPrimaryKeySelective(SmsRole row);
int updateByPrimaryKey(SmsRole row); int updateByPrimaryKey(SmsRole row);
@Select("select \n" +
"\tname\n" +
"from \n" +
"\tsms_role sr\n" +
"inner join \n" +
"\tsms_user_role sur\n" +
"on\n" +
"\tsr.id = sur.user_id\n" +
"where \n" +
" sur.user_id = #{userId}")
Set<String> findRoleNameByUserId(@Param("userId") Integer userId);
} }

@ -0,0 +1,24 @@
package com.mashibing.webmaster.service;
import com.mashibing.webmaster.entity.ClientBusiness;
import java.util.List;
/**
* @author zjw
* @description
*/
public interface ClientBusinessService {
/**
*
* @return
*/
List<ClientBusiness> findAll();
/**
* id
* @param userId
* @return
*/
List<ClientBusiness> findByUserId(Integer userId);
}

@ -0,0 +1,16 @@
package com.mashibing.webmaster.service;
import java.util.Set;
/**
* @author zjw
* @description
*/
public interface SmsRoleService {
/**
* id
* @param userId
* @return
*/
Set<String> getRoleName(Integer userId);
}

@ -0,0 +1,36 @@
package com.mashibing.webmaster.service.impl;
import com.mashibing.webmaster.entity.ClientBusiness;
import com.mashibing.webmaster.entity.ClientBusinessExample;
import com.mashibing.webmaster.mapper.ClientBusinessMapper;
import com.mashibing.webmaster.service.ClientBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zjw
* @description
*/
@Service
public class ClientBusinessServiceImpl implements ClientBusinessService {
@Resource
private ClientBusinessMapper clientBusinessMapper;
@Override
public List<ClientBusiness> findAll() {
List<ClientBusiness> list = clientBusinessMapper.selectByExample(null);
return list;
}
@Override
public List<ClientBusiness> findByUserId(Integer userId) {
ClientBusinessExample example = new ClientBusinessExample();
example.createCriteria().andExtend1EqualTo(userId + "");
List<ClientBusiness> list = clientBusinessMapper.selectByExample(example);
return list;
}
}

@ -0,0 +1,27 @@
package com.mashibing.webmaster.service.impl;
import com.mashibing.webmaster.entity.SmsRoleExample;
import com.mashibing.webmaster.mapper.SmsRoleMapper;
import com.mashibing.webmaster.service.SmsRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Set;
/**
* @author zjw
* @description
*/
@Service
public class SmsRoleServiceImpl implements SmsRoleService {
@Resource
private SmsRoleMapper roleMapper;
@Override
public Set<String> getRoleName(Integer userId) {
Set<String> roleNameSet = roleMapper.findRoleNameByUserId(userId);
return roleNameSet;
}
}

@ -0,0 +1,15 @@
package com.mashibing.webmaster.vo;
import lombok.Data;
/**
* @author zjw
* @description
*/
@Data
public class ClientBusinessVO {
private Long id;
private String corpname;
}

@ -40,9 +40,10 @@
</javaClientGenerator> </javaClientGenerator>
<!-- 生成那些表对应的信息--> <!-- 生成那些表对应的信息-->
<table tableName="sms_user" domainObjectName="SmsUser" /> <!-- <table tableName="sms_user" domainObjectName="SmsUser" />-->
<table tableName="sms_role" domainObjectName="SmsRole" /> <!-- <table tableName="sms_role" domainObjectName="SmsRole" />-->
<table tableName="sms_menu" domainObjectName="SmsMenu" /> <!-- <table tableName="sms_menu" domainObjectName="SmsMenu" />-->
<table tableName="client_business" domainObjectName="ClientBusiness" />
</context> </context>
</generatorConfiguration> </generatorConfiguration>

@ -0,0 +1,418 @@
<?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.mashibing.webmaster.mapper.ClientBusinessMapper">
<resultMap id="BaseResultMap" type="com.mashibing.webmaster.entity.ClientBusiness">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="corpname" jdbcType="VARCHAR" property="corpname" />
<result column="apikey" jdbcType="VARCHAR" property="apikey" />
<result column="ip_address" jdbcType="VARCHAR" property="ipAddress" />
<result column="is_callback" jdbcType="TINYINT" property="isCallback" />
<result column="callback_url" jdbcType="VARCHAR" property="callbackUrl" />
<result column="client_linkname" jdbcType="VARCHAR" property="clientLinkname" />
<result column="client_phone" jdbcType="VARCHAR" property="clientPhone" />
<result column="client_filters" jdbcType="VARCHAR" property="clientFilters" />
<result column="created" jdbcType="TIMESTAMP" property="created" />
<result column="create_id" jdbcType="BIGINT" property="createId" />
<result column="updated" jdbcType="TIMESTAMP" property="updated" />
<result column="update_id" jdbcType="BIGINT" property="updateId" />
<result column="is_delete" jdbcType="TINYINT" property="isDelete" />
<result column="extend1" jdbcType="VARCHAR" property="extend1" />
<result column="extend2" jdbcType="VARCHAR" property="extend2" />
<result column="extend3" jdbcType="VARCHAR" property="extend3" />
<result column="extend4" jdbcType="VARCHAR" property="extend4" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, corpname, apikey, ip_address, is_callback, callback_url, client_linkname, client_phone,
client_filters, created, create_id, updated, update_id, is_delete, extend1, extend2,
extend3, extend4
</sql>
<select id="selectByExample" parameterType="com.mashibing.webmaster.entity.ClientBusinessExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from client_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from client_business
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from client_business
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.mashibing.webmaster.entity.ClientBusinessExample">
delete from client_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.mashibing.webmaster.entity.ClientBusiness">
insert into client_business (id, corpname, apikey,
ip_address, is_callback, callback_url,
client_linkname, client_phone, client_filters,
created, create_id, updated,
update_id, is_delete, extend1,
extend2, extend3, extend4
)
values (#{id,jdbcType=BIGINT}, #{corpname,jdbcType=VARCHAR}, #{apikey,jdbcType=VARCHAR},
#{ipAddress,jdbcType=VARCHAR}, #{isCallback,jdbcType=TINYINT}, #{callbackUrl,jdbcType=VARCHAR},
#{clientLinkname,jdbcType=VARCHAR}, #{clientPhone,jdbcType=VARCHAR}, #{clientFilters,jdbcType=VARCHAR},
#{created,jdbcType=TIMESTAMP}, #{createId,jdbcType=BIGINT}, #{updated,jdbcType=TIMESTAMP},
#{updateId,jdbcType=BIGINT}, #{isDelete,jdbcType=TINYINT}, #{extend1,jdbcType=VARCHAR},
#{extend2,jdbcType=VARCHAR}, #{extend3,jdbcType=VARCHAR}, #{extend4,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.mashibing.webmaster.entity.ClientBusiness">
insert into client_business
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="corpname != null">
corpname,
</if>
<if test="apikey != null">
apikey,
</if>
<if test="ipAddress != null">
ip_address,
</if>
<if test="isCallback != null">
is_callback,
</if>
<if test="callbackUrl != null">
callback_url,
</if>
<if test="clientLinkname != null">
client_linkname,
</if>
<if test="clientPhone != null">
client_phone,
</if>
<if test="clientFilters != null">
client_filters,
</if>
<if test="created != null">
created,
</if>
<if test="createId != null">
create_id,
</if>
<if test="updated != null">
updated,
</if>
<if test="updateId != null">
update_id,
</if>
<if test="isDelete != null">
is_delete,
</if>
<if test="extend1 != null">
extend1,
</if>
<if test="extend2 != null">
extend2,
</if>
<if test="extend3 != null">
extend3,
</if>
<if test="extend4 != null">
extend4,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="corpname != null">
#{corpname,jdbcType=VARCHAR},
</if>
<if test="apikey != null">
#{apikey,jdbcType=VARCHAR},
</if>
<if test="ipAddress != null">
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="isCallback != null">
#{isCallback,jdbcType=TINYINT},
</if>
<if test="callbackUrl != null">
#{callbackUrl,jdbcType=VARCHAR},
</if>
<if test="clientLinkname != null">
#{clientLinkname,jdbcType=VARCHAR},
</if>
<if test="clientPhone != null">
#{clientPhone,jdbcType=VARCHAR},
</if>
<if test="clientFilters != null">
#{clientFilters,jdbcType=VARCHAR},
</if>
<if test="created != null">
#{created,jdbcType=TIMESTAMP},
</if>
<if test="createId != null">
#{createId,jdbcType=BIGINT},
</if>
<if test="updated != null">
#{updated,jdbcType=TIMESTAMP},
</if>
<if test="updateId != null">
#{updateId,jdbcType=BIGINT},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=TINYINT},
</if>
<if test="extend1 != null">
#{extend1,jdbcType=VARCHAR},
</if>
<if test="extend2 != null">
#{extend2,jdbcType=VARCHAR},
</if>
<if test="extend3 != null">
#{extend3,jdbcType=VARCHAR},
</if>
<if test="extend4 != null">
#{extend4,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.mashibing.webmaster.entity.ClientBusinessExample" resultType="java.lang.Long">
select count(*) from client_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update client_business
<set>
<if test="row.id != null">
id = #{row.id,jdbcType=BIGINT},
</if>
<if test="row.corpname != null">
corpname = #{row.corpname,jdbcType=VARCHAR},
</if>
<if test="row.apikey != null">
apikey = #{row.apikey,jdbcType=VARCHAR},
</if>
<if test="row.ipAddress != null">
ip_address = #{row.ipAddress,jdbcType=VARCHAR},
</if>
<if test="row.isCallback != null">
is_callback = #{row.isCallback,jdbcType=TINYINT},
</if>
<if test="row.callbackUrl != null">
callback_url = #{row.callbackUrl,jdbcType=VARCHAR},
</if>
<if test="row.clientLinkname != null">
client_linkname = #{row.clientLinkname,jdbcType=VARCHAR},
</if>
<if test="row.clientPhone != null">
client_phone = #{row.clientPhone,jdbcType=VARCHAR},
</if>
<if test="row.clientFilters != null">
client_filters = #{row.clientFilters,jdbcType=VARCHAR},
</if>
<if test="row.created != null">
created = #{row.created,jdbcType=TIMESTAMP},
</if>
<if test="row.createId != null">
create_id = #{row.createId,jdbcType=BIGINT},
</if>
<if test="row.updated != null">
updated = #{row.updated,jdbcType=TIMESTAMP},
</if>
<if test="row.updateId != null">
update_id = #{row.updateId,jdbcType=BIGINT},
</if>
<if test="row.isDelete != null">
is_delete = #{row.isDelete,jdbcType=TINYINT},
</if>
<if test="row.extend1 != null">
extend1 = #{row.extend1,jdbcType=VARCHAR},
</if>
<if test="row.extend2 != null">
extend2 = #{row.extend2,jdbcType=VARCHAR},
</if>
<if test="row.extend3 != null">
extend3 = #{row.extend3,jdbcType=VARCHAR},
</if>
<if test="row.extend4 != null">
extend4 = #{row.extend4,jdbcType=VARCHAR},
</if>
</set>
<if test="example != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update client_business
set id = #{row.id,jdbcType=BIGINT},
corpname = #{row.corpname,jdbcType=VARCHAR},
apikey = #{row.apikey,jdbcType=VARCHAR},
ip_address = #{row.ipAddress,jdbcType=VARCHAR},
is_callback = #{row.isCallback,jdbcType=TINYINT},
callback_url = #{row.callbackUrl,jdbcType=VARCHAR},
client_linkname = #{row.clientLinkname,jdbcType=VARCHAR},
client_phone = #{row.clientPhone,jdbcType=VARCHAR},
client_filters = #{row.clientFilters,jdbcType=VARCHAR},
created = #{row.created,jdbcType=TIMESTAMP},
create_id = #{row.createId,jdbcType=BIGINT},
updated = #{row.updated,jdbcType=TIMESTAMP},
update_id = #{row.updateId,jdbcType=BIGINT},
is_delete = #{row.isDelete,jdbcType=TINYINT},
extend1 = #{row.extend1,jdbcType=VARCHAR},
extend2 = #{row.extend2,jdbcType=VARCHAR},
extend3 = #{row.extend3,jdbcType=VARCHAR},
extend4 = #{row.extend4,jdbcType=VARCHAR}
<if test="example != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.mashibing.webmaster.entity.ClientBusiness">
update client_business
<set>
<if test="corpname != null">
corpname = #{corpname,jdbcType=VARCHAR},
</if>
<if test="apikey != null">
apikey = #{apikey,jdbcType=VARCHAR},
</if>
<if test="ipAddress != null">
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="isCallback != null">
is_callback = #{isCallback,jdbcType=TINYINT},
</if>
<if test="callbackUrl != null">
callback_url = #{callbackUrl,jdbcType=VARCHAR},
</if>
<if test="clientLinkname != null">
client_linkname = #{clientLinkname,jdbcType=VARCHAR},
</if>
<if test="clientPhone != null">
client_phone = #{clientPhone,jdbcType=VARCHAR},
</if>
<if test="clientFilters != null">
client_filters = #{clientFilters,jdbcType=VARCHAR},
</if>
<if test="created != null">
created = #{created,jdbcType=TIMESTAMP},
</if>
<if test="createId != null">
create_id = #{createId,jdbcType=BIGINT},
</if>
<if test="updated != null">
updated = #{updated,jdbcType=TIMESTAMP},
</if>
<if test="updateId != null">
update_id = #{updateId,jdbcType=BIGINT},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=TINYINT},
</if>
<if test="extend1 != null">
extend1 = #{extend1,jdbcType=VARCHAR},
</if>
<if test="extend2 != null">
extend2 = #{extend2,jdbcType=VARCHAR},
</if>
<if test="extend3 != null">
extend3 = #{extend3,jdbcType=VARCHAR},
</if>
<if test="extend4 != null">
extend4 = #{extend4,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.mashibing.webmaster.entity.ClientBusiness">
update client_business
set corpname = #{corpname,jdbcType=VARCHAR},
apikey = #{apikey,jdbcType=VARCHAR},
ip_address = #{ipAddress,jdbcType=VARCHAR},
is_callback = #{isCallback,jdbcType=TINYINT},
callback_url = #{callbackUrl,jdbcType=VARCHAR},
client_linkname = #{clientLinkname,jdbcType=VARCHAR},
client_phone = #{clientPhone,jdbcType=VARCHAR},
client_filters = #{clientFilters,jdbcType=VARCHAR},
created = #{created,jdbcType=TIMESTAMP},
create_id = #{createId,jdbcType=BIGINT},
updated = #{updated,jdbcType=TIMESTAMP},
update_id = #{updateId,jdbcType=BIGINT},
is_delete = #{isDelete,jdbcType=TINYINT},
extend1 = #{extend1,jdbcType=VARCHAR},
extend2 = #{extend2,jdbcType=VARCHAR},
extend3 = #{extend3,jdbcType=VARCHAR},
extend4 = #{extend4,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

@ -86,7 +86,7 @@ var vm = new Vue({
created: function () {// created: function () {//
console.log(11) console.log(11)
$.get("../sys/clientbusiness/all", function(r){ $.get("../sys/clientbusiness/all", function(r){
vm.sites = r.sites; vm.sites = r.data;
}); });
} }
}); });

@ -0,0 +1,26 @@
package com.mashibing.webmaster.mapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Set;
import static org.junit.Assert.*;
@SpringBootTest
@RunWith(SpringRunner.class)
public class SmsRoleMapperTest {
@Autowired
private SmsRoleMapper roleMapper;
@Test
public void findRoleNameByUserId() {
Set<String> set = roleMapper.findRoleNameByUserId(1);
System.out.println(set);
}
}

@ -0,0 +1,30 @@
package com.mashibing.webmaster.service;
import com.mashibing.webmaster.entity.ClientBusiness;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
import static org.junit.Assert.*;
@SpringBootTest
@RunWith(SpringRunner.class)
public class ClientBusinessServiceTest {
@Autowired
private ClientBusinessService clientBusinessService;
@Test
public void findAll() {
List<ClientBusiness> list = clientBusinessService.findAll();
System.out.println(list);
}
@Test
public void findByUserId() {
}
}
Loading…
Cancel
Save