烽火云长椿街4.1 2:19

master
DanielDeng 3 months ago
parent 43e0bf3289
commit 03010bc949

@ -12,4 +12,9 @@ public interface WebMasterConstants {
String KAPTCHA = "kaptcha";
/**
*
*/
String ROOT ="管理员";
}

@ -27,7 +27,12 @@ public enum ExceptionEnums {
NO_CHANNEL(-18,"没有选择到合适的通道"),
SEARCH_INDEX_ERROR(-19,"添加ES文档信息失败"),
SEARCH_UPDATE_ERROR(-20,"修改ES文档失败"),
;
KAPACHA_ERROR(-100,"验证码错误"),
AUTHEN_ERROR(-101,"用户名或密码错误"),
NOT_LOGIN(-102,"用户未登录"),
USER_MENU_ERROR(-103,"查询用户菜单失败"),
SMS_NO_AUTHOR(-104,"用户权限不足")
;
private Integer code;
private String msg;

@ -0,0 +1,33 @@
package com.mashibing.common.util;
import com.mashibing.common.enums.ExceptionEnums;
import com.mashibing.common.vo.ResultVO;
/**
* @author dch
* @create 2024-03-30 11:54
*/
public class R {
public static ResultVO ok() {
return new ResultVO(0, "");
}
public static ResultVO ok(Object data) {
ResultVO vo = ok();
vo.setData(data);
return vo;
}
public static ResultVO ok(Long total,Object rows) {
ResultVO vo = ok();
vo.setTotal(total);
vo.setRows(rows);
return vo;
}
public static ResultVO error(ExceptionEnums enums) {
return new ResultVO(enums.getCode(), enums.getMsg());
}
}

@ -0,0 +1,32 @@
package com.mashibing.common.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dch
* @create 2024-03-30 11:52
*/
@Data
@NoArgsConstructor
public class ResultVO {
private Integer CODE;
private String msg;
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
private Object data;
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
private Long total;
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
private Object rows;
public ResultVO(Integer CODE, String msg) {
this.CODE = CODE;
this.msg = msg;
}
}

@ -0,0 +1,31 @@
package com.mashibing.search.controller;
import com.mashibing.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.Map;
/**
* @author dch
* @create 2024-03-31 1:02
*/
@RestController
public class SmsSearchController {
@Autowired
private SearchService searchService;
@PostMapping("/search/sms/list")
public Map<String,Object> findSmsByParameters(@RequestBody Map<String,Object> parameters) throws IOException {
//1、调用搜索模块完成查询,因为ES在查询数据时会返回总条数
Map<String,Object> result = searchService.findSmsByParameters(parameters);
//2、返回数据
return result;
}
}

@ -8,6 +8,8 @@ import java.util.Map;
* @create 2024-03-25 21:34
*/
public interface SearchService {
/**
* ES
*
@ -28,4 +30,11 @@ public interface SearchService {
* @throws IOException
*/
void update(String index, String id, Map<String, Object> doc) throws IOException;
/**
*
* @param parameters
* @return
*/
Map<String, Object> findSmsByParameters(Map<String, Object> parameters) throws IOException;
}

@ -11,17 +11,26 @@ import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.io.IOException;
import java.util.Map;
import java.util.*;
/**
* @author dch
@ -119,4 +128,116 @@ public class ElasticsearchServiceImpl implements SearchService {
}
@Override
public Map<String, Object> findSmsByParameters(Map<String, Object> parameters) throws IOException {
//1、声明SearchRequest(后期需要根据传递的时间指定查询哪些索引,如果没传,可以指定默认查询前三个月)
SearchRequest request = new SearchRequest(SearchUtils.getCurrYearIndex(), "");
//2、封装查询条件
//2.1 参数全部取出来
Object fromObj = parameters.get("from");
Object sizeObj = parameters.get("size");
Object contentObj = parameters.get("content");
Object mobileObj = parameters.get("mobile");
Object startTimeObj = parameters.get("starttime");
Object stopTimeObj = parameters.get("stoptime");
Object clientIDObj = parameters.get("clientID");
//2.2 clientID需要单独操作一下。
List<Long> clientIDList = null;
if (clientIDObj instanceof List) {
// 传递的是个集合
clientIDList = (List) clientIDObj;
} else if (!ObjectUtils.isEmpty(clientIDObj)) {
clientIDList = Collections.singletonList(Long.parseLong(clientIDObj + ""));
}
//2.3 条件封装
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
// ========================封装查询条件到boolQuery========================================
//2.3.1、关键字
if (!ObjectUtils.isEmpty(contentObj)) {
boolQuery.must(QueryBuilders.matchQuery("text", contentObj));
// 高亮。设置给sourceBuilder
HighlightBuilder highlightBuilder = new HighlightBuilder();
highlightBuilder.field("text");
highlightBuilder.preTags("<span style='color: red'>");
highlightBuilder.postTags("</span>");
highlightBuilder.fragmentSize(100);
sourceBuilder.highlighter(highlightBuilder);
}
//2.3.2、手机号
if (!ObjectUtils.isEmpty(mobileObj)) {
boolQuery.must(QueryBuilders.prefixQuery("mobile", (String) mobileObj));
}
//2.3.3、开始时间
if(!ObjectUtils.isEmpty(startTimeObj)){
boolQuery.must(QueryBuilders.rangeQuery("sendTime").gte(startTimeObj));
}
//2.3.4、结束时间
if(!ObjectUtils.isEmpty(stopTimeObj)){
boolQuery.must(QueryBuilders.rangeQuery("sendTime").lte(stopTimeObj));
}
//2.3.5、客户id
if(clientIDList != null){
boolQuery.must(QueryBuilders.termsQuery("clientId",clientIDList.toArray(new Long[]{})));
}
//2.3.6 分页查询
sourceBuilder.from(Integer.parseInt(fromObj + ""));
sourceBuilder.size(Integer.parseInt(sizeObj + ""));
// ========================封装查询条件到boolQuery========================================
sourceBuilder.query(boolQuery);
request.source(sourceBuilder);
//3、执行查询
SearchResponse resp = restHighLevelClient.search(request, RequestOptions.DEFAULT);
//4、封装数据
long total = resp.getHits().getTotalHits().value;
List<Map> rows = new ArrayList<>();
for (SearchHit hit : resp.getHits().getHits()) {
Map<String, Object> row = hit.getSourceAsMap();
// List sendTime = (List) row.get("sendTime");
// String sendTimeStr = listToDateString(sendTime);
// row.put("sendTimeStr",sendTimeStr);
row.put("sendTimeStr",row.get("sendTime"));
row.put("corpname",row.get("sign"));
// 高亮结果的处理
HighlightField highlightField = hit.getHighlightFields().get("text");
if(highlightField != null){
String textHighLight = highlightField.getFragments()[0].toString();
row.put("text",textHighLight);
}
rows.add(row);
}
//5、返回数据
Map<String, Object> result = new HashMap<>();
result.put("total",total);
result.put("rows",rows);
return result;
}
private String listToDateString(List sendTime) {
String year = sendTime.get(0) + "";
Integer monthInt = (Integer) sendTime.get(1);
Integer dayInt = (Integer) sendTime.get(2);
Integer hourInt = (Integer) sendTime.get(3);
Integer minuteInt = (Integer) sendTime.get(4);
Integer secondInt = (Integer) sendTime.get(5);
String month = monthInt / 10 == 0 ? "0" + monthInt : monthInt + "";
String day = dayInt / 10 == 0 ? "0" + dayInt : dayInt + "";
String hour = hourInt / 10 == 0 ? "0" + hourInt : hourInt + "";
String minute = minuteInt / 10 == 0 ? "0" + minuteInt : minuteInt + "";
String second = secondInt / 10 == 0 ? "0" + secondInt : secondInt + "";
return year + "-" + month + "-" + day + " " + hour + ":" + month + ":" + second;
}
}

@ -19,25 +19,28 @@ public class SearchUtils {
/**
*
*
* @return
*/
public static String getYear(){
public static String getYear() {
return LocalDateTime.now().getYear() + "";
}
private static ThreadLocal<StandardReport> reportThreadLocal = new ThreadLocal<>();
public static void set(StandardReport report){
public static void set(StandardReport report) {
reportThreadLocal.set(report);
}
public static StandardReport get(){
public static StandardReport get() {
return reportThreadLocal.get();
}
public static void remove(){
public static void remove() {
reportThreadLocal.remove();
}
public static String getCurrYearIndex() {
return INDEX + getYear();
}
}

@ -74,5 +74,20 @@
<artifactId>beacon-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 参数校验-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!--需要调用搜索模块-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
</project>

@ -4,6 +4,8 @@ import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @author dch
@ -11,6 +13,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*/
@SpringBootApplication
@MapperScan(basePackages = "com.mashibing.webmaster.mapper")
@EnableFeignClients
@EnableDiscoveryClient
public class WebMasterStarterApp {
public static void main(String[] args) {

@ -0,0 +1,26 @@
package com.mashibing.webmaster.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Map;
/**
* @author dch
* @create 2024-03-31 0:20
*/
@FeignClient("beacon-search")
public interface SearchClient {
/**
*
* @param parameters
* @return Map total: rowslist
*/
@PostMapping("/search/sms/list")
Map<String,Object> findSmsByParameters(@RequestBody Map<String,Object> parameters);
}

@ -0,0 +1,76 @@
package com.mashibing.webmaster.controller;
/**
* Controller
* @author dch
* @create 2024-03-30 20:53
*/
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;
@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,121 @@
package com.mashibing.webmaster.controller;
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.client.SearchClient;
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.SearchSmsVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
*
*
* @author dch
* @create 2024-03-30 23:53
*/
@RestController
@Slf4j
public class SearchController {
@Autowired
private SmsRoleService roleService;
@Autowired
private ClientBusinessService clientBusinessService;
@Autowired
private SearchClient searchClient;
@GetMapping("/sys/search/list")
public ResultVO list(@RequestParam Map map) {
//1、判断当前登录用户的角色能否查询对应的客户信息
//1.1 查看用户是否登录
SmsUser smsUser = (SmsUser) SecurityUtils.getSubject().getPrincipal();
if (smsUser == null) {
log.info("【获取客户信息】 用户未登录!!");
return R.error(ExceptionEnums.NOT_LOGIN);
}
String clientIDStr = (String) map.get("clientID");
Long clientID = null;
if (!StringUtils.isEmpty(clientIDStr)) {
clientID = Long.parseLong(clientIDStr);
}
//1.2 拿到用户的id标识查看用户的角色是否是管理员
Set<String> roleNames = roleService.getRoleName(smsUser.getId());
if (roleNames != null && !roleNames.contains(WebMasterConstants.ROOT)) {
//1.3 如果不是管理员需要查询当前用户对应的公司信息匹配参数中的公司id是否一致
// 查询当前登录用户所包含的全部客户id公司信息
List<ClientBusiness> clients = clientBusinessService.findByUserId(smsUser.getId());
// 查看请求参数中携带的clientID
if (clientID == null) {
// 客户没有传递clientID查询当前用户锁拥有的全部客户的短信信息
List<Long> list = new ArrayList<>();
for (ClientBusiness client : clients) {
list.add(client.getId());
}
map.put("clientID", list);
} else {
boolean flag = false;
// 客户传递了clientID判断当前登录用户是否包含当前clientID
for (ClientBusiness client : clients) {
if (client.getId() == clientID) {
// 满足当前登录用户的操作,可以查询
flag = true;
break;
}
}
if (!flag) {
// 请求参数不满足当前登录用户的信息
log.info("【搜索短信信息】 用户权限不足!!");
return R.error(ExceptionEnums.SMS_NO_AUTHOR);
}
}
}
// 以上为参数校验
//2、调用搜索模块查询数据返回total和rows
Map<String, Object> data = searchClient.findSmsByParameters(map);
//3、判断返回的total如果total为0正常返回
Long total = Long.parseLong(data.get("total") + "");
if (total == 0) {
return R.ok(0L, null);
}
//4、如果数据正常做返回数据的封装声明SearchSmsVO的实体类
List<Map> list = (List<Map>) data.get("rows");
List<SearchSmsVO> rows = new ArrayList<>();
for (Map row : list) {
SearchSmsVO vo = new SearchSmsVO();
try {
BeanUtils.copyProperties(vo, row);
} catch (Exception e) {
e.printStackTrace();
}
rows.add(vo);
}
//5、响应数据
return R.ok(total, rows);
}
}

@ -2,15 +2,26 @@ package com.mashibing.webmaster.controller;
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.dto.UserDTO;
import com.mashibing.webmaster.entity.SmsUser;
import com.mashibing.webmaster.service.SmsMenuService;
import com.mashibing.webmaster.service.SmsUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author dch
@ -21,6 +32,8 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
public class SmsUserController {
@Autowired
private SmsMenuService menuService;
@PostMapping("/login")
public ResultVO login(@RequestBody @Valid UserDTO userDTO, BindingResult bindingResult) {
@ -38,7 +51,7 @@ public class SmsUserController {
}
// * 3、基于用户名和密码做Shiro的认证操作
UsernamePasswordToken token = new UsernamePasswordToken(userDTO.getUsername(),userDTO.getPassword());
token.setRememberMe(userDTO.getRememberMe());
token.setRememberMe(userDTO.getRemeberMe());
try {
SecurityUtils.getSubject().login(token);
} catch (AuthenticationException e) {
@ -51,4 +64,48 @@ public class SmsUserController {
}
/**
*
* @return
*/
@GetMapping("/user/info")
public ResultVO info(){
//1、基于SecurityUtils获取用户信息
Subject subject = SecurityUtils.getSubject();
SmsUser smsUser = (SmsUser) subject.getPrincipal();
if(smsUser == null){
log.info("【获取登录用户信息】 用户未登录!!");
return R.error(ExceptionEnums.NOT_LOGIN);
}
//2、封装结果返回
Map<String,Object> data = new HashMap<>();
data.put("nickname",smsUser.getNickname());
data.put("username",smsUser.getUsername());
return R.ok(data);
}
/**
*
* @return
*/
@GetMapping("/menu/user")
public ResultVO menuUser() {
// 基于用户的id根据角色表信息查询到菜单表中的详细内容
SmsUser smsUser = (SmsUser) SecurityUtils.getSubject().getPrincipal();
if (smsUser == null) {
log.info("【获取用户菜单信息】 用户未登录!!");
return R.error(ExceptionEnums.NOT_LOGIN);
}
// 封装为具体的下述的这种结构
List<Map<String, Object>> data = menuService.findUserMenu(smsUser.getId());
if (data == null){
log.error("【获取用户菜单信息】 查询用户菜单失败!! id = {}",smsUser.getId());
return R.error(ExceptionEnums.USER_MENU_ERROR);
}
// 返回结果
return R.ok(data);
}
}

@ -0,0 +1,26 @@
package com.mashibing.webmaster.dto;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author dch
* @create 2024-03-30 15:51
*/
@Data
public class UserDTO {
@NotBlank
private String username;
@NotBlank
private String password;
@NotBlank
private String captcha;
private Boolean remeberMe = false;
}

@ -0,0 +1,185 @@
package com.mashibing.webmaster.entity;
import java.util.Date;
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();
}
}

@ -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,6 +3,9 @@ package com.mashibing.webmaster.mapper;
import com.mashibing.webmaster.entity.SmsMenu;
import com.mashibing.webmaster.entity.SmsMenuExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
public interface SmsMenuMapper {
@ -27,4 +30,7 @@ public interface SmsMenuMapper {
int updateByPrimaryKeySelective(SmsMenu row);
int updateByPrimaryKey(SmsMenu row);
@MapKey("id")
List<Map<String, Object>> findMenuByUserId(@Param("userId") Integer id);
}

@ -3,7 +3,10 @@ package com.mashibing.webmaster.mapper;
import com.mashibing.webmaster.entity.SmsRole;
import com.mashibing.webmaster.entity.SmsRoleExample;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
public interface SmsRoleMapper {
long countByExample(SmsRoleExample example);
@ -27,4 +30,7 @@ public interface SmsRoleMapper {
int updateByPrimaryKeySelective(SmsRole row);
int updateByPrimaryKey(SmsRole row);
@Select("select name from sms_role sr inner join sms_user_role sur on sr.id = sur.user_id where sur.user_id = #{userId}")
Set<String> findRoleNameByUserId(@Param("userId") Integer userId);
}

@ -0,0 +1,15 @@
package com.mashibing.webmaster.service;
import com.mashibing.webmaster.entity.ClientBusiness;
import java.util.List;
/**
* @author dch
* @create 2024-03-30 20:53
*/
public interface ClientBusinessService {
List<ClientBusiness> findAll();
List<ClientBusiness> findByUserId(Integer userId);
}

@ -0,0 +1,13 @@
package com.mashibing.webmaster.service;
import java.util.List;
import java.util.Map;
/**
* @author dch
* @create 2024-03-30 19:34
*/
public interface SmsMenuService {
List<Map<String, Object>> findUserMenu(Integer id);
}

@ -0,0 +1,11 @@
package com.mashibing.webmaster.service;
import java.util.Set;
/**
* @author dch
* @create 2024-03-30 20:53
*/
public interface SmsRoleService {
Set<String> getRoleName(Integer userId);
}

@ -0,0 +1,35 @@
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 java.util.List;
/**
* @author dch
* @create 2024-03-30 21:27
*/
@Service
public class ClientBusinessServiceImpl implements ClientBusinessService {
@Autowired
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,59 @@
package com.mashibing.webmaster.service.impl;
import com.mashibing.webmaster.mapper.SmsMenuMapper;
import com.mashibing.webmaster.service.SmsMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
/**
* @author dch
* @create 2024-03-30 19:34
*/
@Service
public class SmsMenuServiceImpl implements SmsMenuService {
@Autowired
private SmsMenuMapper menuMapper;
@Override
public List<Map<String, Object>> findUserMenu(Integer id) {
//1、将多表查询的结果直接映射只查询type为0和type为1的数据 查询到的结果顺序是type正序排序
List<Map<String, Object>> list = menuMapper.findMenuByUserId(id);
//2、封装外层的父级菜单封装到当前的List集合
List<Map<String, Object>> data = new ArrayList<>();
//3、使用迭代器遍历所有的菜单信息封装父级菜单
ListIterator<Map<String, Object>> parentIterator = list.listIterator();
while (parentIterator.hasNext()) {
Map<String, Object> menu = parentIterator.next();
if ((int) menu.get("type") == 0) {
// 是父级菜单
data.add(menu);
parentIterator.remove();
} else {
break;
}
}
//4、存放二级菜单
for (Map<String, Object> parentMenu : data) {
List<Map<String, Object>> sonMenuList = new ArrayList<>();
ListIterator<Map<String, Object>> sonIterator = list.listIterator();
while (sonIterator.hasNext()) {
Map<String, Object> sonMenu = sonIterator.next();
if ((long) parentMenu.get("id") == (long) sonMenu.get("parentId")) {
sonMenuList.add(sonMenu);
sonIterator.remove();
}
}
parentMenu.put("list", sonMenuList);
}
//5、返回data
return data;
}
}

@ -0,0 +1,25 @@
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 java.util.Set;
/**
* @author dch
* @create 2024-03-30 21:18
*/
@Service
public class SmsRoleServiceImpl implements SmsRoleService {
@Autowired
private SmsRoleMapper roleMapper;
@Override
public Set<String> getRoleName(Integer userId) {
Set<String> roleNameSet = roleMapper.findRoleNameByUserId(userId);
return roleNameSet;
}
}

@ -0,0 +1,13 @@
package com.mashibing.webmaster.vo;
import lombok.Data;
/**
* @author dch
* @create 2024-03-30 21:14
*/
@Data
public class ClientBusinessVO {
private Long id;
private String corpname;
}

@ -0,0 +1,36 @@
package com.mashibing.webmaster.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dch
* @description
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SearchSmsVO {
// ok 公司名称
private String corpname;
// 格式待定
private String sendTimeStr;
// 修改页面
private Integer reportState;
// 全网通改成未知
private Integer operatorId;
// 原errorCode
private String errorMsg;
// ok
private String srcNumber;
// ok
private String mobile;
// ok
private String text;
}

@ -2,10 +2,27 @@
spring:
datasource:
driver-class-name: org.gjt.mm.mysql.Driver
url: jdbc:mysql://192.168.1.121:3306/beacon_cloud?characterEncoding=utf-8
url: jdbc:mysql://192.168.43.1:3306/beacon_cloud?characterEncoding=utf-8
username: root
password: 1234
type: com.alibaba.druid.pool.DruidDataSource
# 服务名称
application:
name: beacon-webmaster
# 多环境
profiles:
active: dev
# nacos注册中心地址
cloud:
nacos:
discovery:
server-addr: 192.168.43.132:8848
# nacos配置中心地址:
config:
server-addr: 192.168.43.132:8848
file-extension: yml
# beacon-webmaster-dev.yml
# MyBatis
mybatis:
mapper-locations: classpath:mapper/*.xml

@ -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>

@ -1,385 +1,410 @@
<?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.SmsMenuMapper">
<resultMap id="BaseResultMap" type="com.mashibing.webmaster.entity.SmsMenu">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<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>
<resultMap id="BaseResultMap" type="com.mashibing.webmaster.entity.SmsMenu">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
<result column="url" jdbcType="VARCHAR" property="url"/>
<result column="icon" jdbcType="VARCHAR" property="icon"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="sort" jdbcType="INTEGER" property="sort"/>
<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>
</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>
</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>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, parent_id, url, icon, type, sort, created, create_id, updated, update_id,
</where>
</sql>
<sql id="Base_Column_List">
id, name, parent_id, url, icon, type, sort, created, create_id, updated, update_id,
is_delete, extend1, extend2, extend3, extend4
</sql>
<select id="selectByExample" parameterType="com.mashibing.webmaster.entity.SmsMenuExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sms_menu
<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.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sms_menu
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sms_menu
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.mashibing.webmaster.entity.SmsMenuExample">
delete from sms_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.mashibing.webmaster.entity.SmsMenu">
insert into sms_menu (id, name, parent_id,
url, icon, type, sort,
created, create_id, updated,
update_id, is_delete, extend1,
extend2, extend3, extend4
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT},
#{url,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{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.SmsMenu">
insert into sms_menu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="url != null">
url,
</if>
<if test="icon != null">
icon,
</if>
<if test="type != null">
type,
</if>
<if test="sort != null">
sort,
</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=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</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.SmsMenuExample" resultType="java.lang.Long">
select count(*) from sms_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sms_menu
<set>
<if test="row.id != null">
id = #{row.id,jdbcType=INTEGER},
</if>
<if test="row.name != null">
</sql>
<select id="selectByExample" parameterType="com.mashibing.webmaster.entity.SmsMenuExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sms_menu
<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.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sms_menu
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete
from sms_menu
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.mashibing.webmaster.entity.SmsMenuExample">
delete from sms_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.mashibing.webmaster.entity.SmsMenu">
insert into sms_menu (id, name, parent_id,
url, icon, type, sort,
created, create_id, updated,
update_id, is_delete, extend1,
extend2, extend3, extend4)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT},
#{url,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{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.SmsMenu">
insert into sms_menu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="url != null">
url,
</if>
<if test="icon != null">
icon,
</if>
<if test="type != null">
type,
</if>
<if test="sort != null">
sort,
</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=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</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.SmsMenuExample"
resultType="java.lang.Long">
select count(*) from sms_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sms_menu
<set>
<if test="row.id != null">
id = #{row.id,jdbcType=INTEGER},
</if>
<if test="row.name != null">
name = #{row.name,jdbcType=VARCHAR},
</if>
<if test="row.parentId != null">
parent_id = #{row.parentId,jdbcType=BIGINT},
</if>
<if test="row.url != null">
url = #{row.url,jdbcType=VARCHAR},
</if>
<if test="row.icon != null">
icon = #{row.icon,jdbcType=VARCHAR},
</if>
<if test="row.type != null">
type = #{row.type,jdbcType=INTEGER},
</if>
<if test="row.sort != null">
sort = #{row.sort,jdbcType=INTEGER},
</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 sms_menu
set id = #{row.id,jdbcType=INTEGER},
name = #{row.name,jdbcType=VARCHAR},
</if>
<if test="row.parentId != null">
parent_id = #{row.parentId,jdbcType=BIGINT},
</if>
<if test="row.url != null">
url = #{row.url,jdbcType=VARCHAR},
</if>
<if test="row.icon != null">
icon = #{row.icon,jdbcType=VARCHAR},
</if>
<if test="row.type != null">
type = #{row.type,jdbcType=INTEGER},
</if>
<if test="row.sort != null">
sort = #{row.sort,jdbcType=INTEGER},
</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 sms_menu
set id = #{row.id,jdbcType=INTEGER},
name = #{row.name,jdbcType=VARCHAR},
parent_id = #{row.parentId,jdbcType=BIGINT},
url = #{row.url,jdbcType=VARCHAR},
icon = #{row.icon,jdbcType=VARCHAR},
type = #{row.type,jdbcType=INTEGER},
sort = #{row.sort,jdbcType=INTEGER},
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.SmsMenu">
update sms_menu
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</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=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mashibing.webmaster.entity.SmsMenu">
update sms_menu
set name = #{name,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=BIGINT},
url = #{url,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
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=INTEGER}
</update>
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.SmsMenu">
update sms_menu
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</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=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mashibing.webmaster.entity.SmsMenu">
update sms_menu
set name = #{name,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=BIGINT},
url = #{url,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
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=INTEGER}
</update>
<!-- /**-->
<!-- * 根据用户id查询当前用户的一级和二级菜单-->
<!-- * @param id-->
<!-- * @return-->
<!-- */-->
<!-- List<Map<String, Object>> findMenuByUserId(@Param("userId") Integer id)-->
<select id="findMenuByUserId" resultType="java.util.Map">
select m.id id,
m.name,
m.parent_id parentId,
m.url,
m.icon,
m.type
from sms_menu m
inner join sms_role_menu rm on m.id = rm.menu_id
inner join sms_user_role ur on ur.role_id = rm.role_id
where ur.user_id = 1
and m.type in (0, 1)
order by m.type
</select>
</mapper>

@ -195,7 +195,8 @@
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<update id="updateByExampleSelective" parameterType="map">
update sms_role
<set>
<if test="row.id != null">

Loading…
Cancel
Save