语音指令

This commit is contained in:
tiger_zhou 2023-04-10 13:50:08 +08:00
parent 0eda6a435a
commit 14da291331
16 changed files with 1508 additions and 7 deletions

View File

@ -0,0 +1,41 @@
package club.joylink.rtss.dao.voice;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfig;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface VoiceDiscriminateConfigDAO {
long countByExample(VoiceDiscriminateConfigExample example);
int deleteByExample(VoiceDiscriminateConfigExample example);
int deleteByPrimaryKey(Long id);
int insert(VoiceDiscriminateConfigWithBLOBs record);
int insertSelective(VoiceDiscriminateConfigWithBLOBs record);
List<VoiceDiscriminateConfigWithBLOBs> selectByExampleWithBLOBs(VoiceDiscriminateConfigExample example);
List<VoiceDiscriminateConfig> selectByExample(VoiceDiscriminateConfigExample example);
VoiceDiscriminateConfigWithBLOBs selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") VoiceDiscriminateConfigWithBLOBs record, @Param("example") VoiceDiscriminateConfigExample example);
int updateByExampleWithBLOBs(@Param("record") VoiceDiscriminateConfigWithBLOBs record, @Param("example") VoiceDiscriminateConfigExample example);
int updateByExample(@Param("record") VoiceDiscriminateConfig record, @Param("example") VoiceDiscriminateConfigExample example);
int updateByPrimaryKeySelective(VoiceDiscriminateConfigWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(VoiceDiscriminateConfigWithBLOBs record);
int updateByPrimaryKey(VoiceDiscriminateConfig record);
}

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.entity.voice;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
/**
* @author
*
*/
@Data
public class VoiceDiscriminateConfig implements Serializable {
private Long id;
/**
* 关键字正则
*/
private String keyWordRules;
private Long mapId;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Long operateId;
/**
* 描述
*/
private String describe;
/**
* 状态0=编辑,1=使用
*/
private Integer status;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,723 @@
package club.joylink.rtss.entity.voice;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class VoiceDiscriminateConfigExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public VoiceDiscriminateConfigExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andKeyWordRulesIsNull() {
addCriterion("key_word_rules is null");
return (Criteria) this;
}
public Criteria andKeyWordRulesIsNotNull() {
addCriterion("key_word_rules is not null");
return (Criteria) this;
}
public Criteria andKeyWordRulesEqualTo(String value) {
addCriterion("key_word_rules =", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesNotEqualTo(String value) {
addCriterion("key_word_rules <>", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesGreaterThan(String value) {
addCriterion("key_word_rules >", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesGreaterThanOrEqualTo(String value) {
addCriterion("key_word_rules >=", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesLessThan(String value) {
addCriterion("key_word_rules <", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesLessThanOrEqualTo(String value) {
addCriterion("key_word_rules <=", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesLike(String value) {
addCriterion("key_word_rules like", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesNotLike(String value) {
addCriterion("key_word_rules not like", value, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesIn(List<String> values) {
addCriterion("key_word_rules in", values, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesNotIn(List<String> values) {
addCriterion("key_word_rules not in", values, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesBetween(String value1, String value2) {
addCriterion("key_word_rules between", value1, value2, "keyWordRules");
return (Criteria) this;
}
public Criteria andKeyWordRulesNotBetween(String value1, String value2) {
addCriterion("key_word_rules not between", value1, value2, "keyWordRules");
return (Criteria) this;
}
public Criteria andMapIdIsNull() {
addCriterion("map_id is null");
return (Criteria) this;
}
public Criteria andMapIdIsNotNull() {
addCriterion("map_id is not null");
return (Criteria) this;
}
public Criteria andMapIdEqualTo(Long value) {
addCriterion("map_id =", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotEqualTo(Long value) {
addCriterion("map_id <>", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThan(Long value) {
addCriterion("map_id >", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThanOrEqualTo(Long value) {
addCriterion("map_id >=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThan(Long value) {
addCriterion("map_id <", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThanOrEqualTo(Long value) {
addCriterion("map_id <=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdIn(List<Long> values) {
addCriterion("map_id in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotIn(List<Long> values) {
addCriterion("map_id not in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdBetween(Long value1, Long value2) {
addCriterion("map_id between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotBetween(Long value1, Long value2) {
addCriterion("map_id not between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andOperateIdIsNull() {
addCriterion("operate_id is null");
return (Criteria) this;
}
public Criteria andOperateIdIsNotNull() {
addCriterion("operate_id is not null");
return (Criteria) this;
}
public Criteria andOperateIdEqualTo(Long value) {
addCriterion("operate_id =", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdNotEqualTo(Long value) {
addCriterion("operate_id <>", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdGreaterThan(Long value) {
addCriterion("operate_id >", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdGreaterThanOrEqualTo(Long value) {
addCriterion("operate_id >=", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdLessThan(Long value) {
addCriterion("operate_id <", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdLessThanOrEqualTo(Long value) {
addCriterion("operate_id <=", value, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdIn(List<Long> values) {
addCriterion("operate_id in", values, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdNotIn(List<Long> values) {
addCriterion("operate_id not in", values, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdBetween(Long value1, Long value2) {
addCriterion("operate_id between", value1, value2, "operateId");
return (Criteria) this;
}
public Criteria andOperateIdNotBetween(Long value1, Long value2) {
addCriterion("operate_id not between", value1, value2, "operateId");
return (Criteria) this;
}
public Criteria andDescribeIsNull() {
addCriterion("`describe` is null");
return (Criteria) this;
}
public Criteria andDescribeIsNotNull() {
addCriterion("`describe` is not null");
return (Criteria) this;
}
public Criteria andDescribeEqualTo(String value) {
addCriterion("`describe` =", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotEqualTo(String value) {
addCriterion("`describe` <>", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeGreaterThan(String value) {
addCriterion("`describe` >", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeGreaterThanOrEqualTo(String value) {
addCriterion("`describe` >=", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLessThan(String value) {
addCriterion("`describe` <", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLessThanOrEqualTo(String value) {
addCriterion("`describe` <=", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLike(String value) {
addCriterion("`describe` like", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotLike(String value) {
addCriterion("`describe` not like", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeIn(List<String> values) {
addCriterion("`describe` in", values, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotIn(List<String> values) {
addCriterion("`describe` not in", values, "describe");
return (Criteria) this;
}
public Criteria andDescribeBetween(String value1, String value2) {
addCriterion("`describe` between", value1, value2, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotBetween(String value1, String value2) {
addCriterion("`describe` not between", value1, value2, "describe");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,28 @@
package club.joylink.rtss.entity.voice;
import java.io.Serializable;
import lombok.Data;
/**
* @author
*
*/
@Data
public class VoiceDiscriminateConfigWithBLOBs extends VoiceDiscriminateConfig implements Serializable {
/**
* 所需参数
*/
private String paramsRules;
/**
* 执行指令系统操作指令
*/
private String execOperateRule;
/**
* 回复指令系统指令操作完毕或者无系统指令时交互回复
*/
private String replyRule;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,11 @@
package club.joylink.rtss.services.voice;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.voice.VoiceDiscriminateConfigVO;
public interface IVoiceDataConfigService {
PageVO<VoiceDiscriminateConfigVO> query();
VoiceDiscriminateConfigVO byId(Long id);
void saveOrUpdate(VoiceDiscriminateConfigVO configVO , LoginUserInfoVO userInfo);
}

View File

@ -0,0 +1,75 @@
package club.joylink.rtss.services.voice.discriminate;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.dao.voice.VoiceDiscriminateConfigDAO;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.voice.IVoiceDataConfigService;
import club.joylink.rtss.simulation.cbtc.discriminate.IVoiceDiscriminateRule;
import club.joylink.rtss.simulation.cbtc.discriminate.VoiceDiscriminateRule;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.voice.VoiceDiscriminateConfigVO;
import club.joylink.rtss.vo.voice.VoiceQueryVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
@Slf4j
@Transactional
public class VoiceDataConfigServiceImpl implements IVoiceDataConfigService, IVoiceDiscriminateRule {
@Autowired
private VoiceDiscriminateConfigDAO configDAO;
private VoiceDiscriminateConfigWithBLOBs findById(Long id){
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id),"数据id不能为空");
VoiceDiscriminateConfigWithBLOBs data = this.configDAO.selectByPrimaryKey(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(data),String.format("未找到对应的数据id:%s",id));
return data;
}
@Override
public PageVO<VoiceDiscriminateConfigVO> query() {
return null;
}
@Override
public VoiceDiscriminateConfigVO byId(Long id) {
VoiceDiscriminateConfigWithBLOBs data = this.findById(id);
return VoiceDiscriminateConfigVO.convertVO(data);
}
@Override
public void saveOrUpdate(VoiceDiscriminateConfigVO configVO, LoginUserInfoVO userInfo) {
LocalDateTime dateTime = LocalDateTime.now();
VoiceDiscriminateConfigWithBLOBs newData = configVO.convertToEntry();
newData.setOperateId(userInfo.getAccountVO().getId());
if(Objects.isNull(configVO.getId())){
newData.setCreateTime(dateTime);
newData.setUpdateTime(dateTime);
this.configDAO.insert(newData);
}else{
VoiceDiscriminateConfigWithBLOBs data = this.findById(configVO.getId());
newData.setCreateTime(data.getCreateTime());
newData.setUpdateTime(dateTime);
this.configDAO.updateByPrimaryKeyWithBLOBs(newData);
}
}
@Override
public List<VoiceDiscriminateRule> findRuleByMapId(Long mapId) {
VoiceQueryVO queryVO = new VoiceQueryVO();
queryVO.setMapId(mapId);
queryVO.setStatus(BusinessConsts.STATUS_USE_INT);
List<VoiceDiscriminateConfigWithBLOBs> list = this.configDAO.selectByExampleWithBLOBs(queryVO.buildQueryExample());
return list.stream().map(VoiceDiscriminateConfigVO::convertRule).collect(Collectors.toList());
}
}

View File

@ -80,11 +80,16 @@ public class VoiceParseServiceImpl implements VoiceParseService {
*/ */
private void matchCommand(Simulation simulation, VoiceDiscriminateResult result) { private void matchCommand(Simulation simulation, VoiceDiscriminateResult result) {
// 加载本地图的规则信息列表从数据库中获取 // 加载本地图的规则信息列表从数据库中获取
List<VoiceDiscriminateRule> ruleList = List.of(new VoiceDiscriminateRule()); List<VoiceDiscriminateRule> ruleList = simulation.getVoiceRuleList();
// BusinessExceptionAssertEnum.VOICE_COMMAND_CONFIG_NULL.assertTrue(!CollectionUtils.isEmpty(ruleList),"该线路没有语音配置的数据");
if(CollectionUtils.isEmpty(ruleList)){
result.setSuccess(false);
result.setMsg("该线路没有语音配置的数据");
return;
}
// 匹配指令 // 匹配指令
List<String> matchGroupList = null;
for (VoiceDiscriminateRule rule : ruleList) { for (VoiceDiscriminateRule rule : ruleList) {
matchGroupList = keyWordsMatch(rule.getKeyWordRules(), result.getMatchOriginContent()); List<String> matchGroupList = keyWordsMatch(rule.getKeyWordRules(), result.getMatchOriginContent());
if (!CollectionUtils.isEmpty(matchGroupList)) { if (!CollectionUtils.isEmpty(matchGroupList)) {
result.setRule(rule); result.setRule(rule);
result.setMatchGroupList(matchGroupList); result.setMatchGroupList(matchGroupList);

View File

@ -21,6 +21,7 @@ import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.device.RealDevice
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1IbpConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1IbpConfig;
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PscConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PscConfig;
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PslConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PslConfig;
import club.joylink.rtss.simulation.cbtc.discriminate.VoiceDiscriminateRule;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
import club.joylink.rtss.simulation.cbtc.member.SimulationMember; import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
@ -59,6 +60,11 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
// */ // */
// private String id; // private String id;
/**
* 语音配置数据
*/
private List<VoiceDiscriminateRule> voiceRuleList;
/** /**
* 仿真构建参数 * 仿真构建参数
*/ */

View File

@ -6,6 +6,8 @@ import club.joylink.rtss.services.RunPlanDraftService;
import club.joylink.rtss.services.mapFunction.RtsMapFunctionService; import club.joylink.rtss.services.mapFunction.RtsMapFunctionService;
import club.joylink.rtss.services.permission.PermissionSubjectService; import club.joylink.rtss.services.permission.PermissionSubjectService;
import club.joylink.rtss.simulation.SimulationManager; import club.joylink.rtss.simulation.SimulationManager;
import club.joylink.rtss.simulation.cbtc.discriminate.IVoiceDiscriminateRule;
import club.joylink.rtss.simulation.cbtc.discriminate.VoiceDiscriminateRule;
import club.joylink.rtss.simulation.cbtc.event.SimulationCreateSuccessEvent; import club.joylink.rtss.simulation.cbtc.event.SimulationCreateSuccessEvent;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
@ -67,7 +69,8 @@ public class SimulationServiceImpl implements SimulationService {
@Autowired @Autowired
private ISysUserService iSysUserService; private ISysUserService iSysUserService;
@Autowired
private IVoiceDiscriminateRule discriminateRule;
@Override @Override
public String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType) { public String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType) {
return createSimulationPojo(mapId, mapFunctionId, workParamVO, loginUserInfoVO, createUserType).getId(); return createSimulationPojo(mapId, mapFunctionId, workParamVO, loginUserInfoVO, createUserType).getId();
@ -296,6 +299,12 @@ public class SimulationServiceImpl implements SimulationService {
//创建仿真 //创建仿真
String simulationId = SimulationIdGenerator.generateGroup(loginUserInfoVO.getAccountVO().getId(), mapId); String simulationId = SimulationIdGenerator.generateGroup(loginUserInfoVO.getAccountVO().getId(), mapId);
Simulation simulation = initService.create(mapId, workParamVO, loginUserInfoVO, simulationId); Simulation simulation = initService.create(mapId, workParamVO, loginUserInfoVO, simulationId);
//语音配置数据
List<VoiceDiscriminateRule> ruleList = this.discriminateRule.findRuleByMapId(mapId);
simulation.setVoiceRuleList(ruleList);
simulation.setMapFunctionId(mapFunctionId); simulation.setMapFunctionId(mapFunctionId);
simulation.setCreateUserType(createUserType); simulation.setCreateUserType(createUserType);
LoginUserInfoVO loginUserInfo = simulation.getBuildParams().getLoginUserInfo(); LoginUserInfoVO loginUserInfo = simulation.getBuildParams().getLoginUserInfo();

View File

@ -1,7 +1,17 @@
package club.joylink.rtss.simulation.cbtc.discriminate; package club.joylink.rtss.simulation.cbtc.discriminate;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.*;
import club.joylink.rtss.util.PinYinUtil;
import club.joylink.rtss.util.StrUtils;
import com.google.common.collect.Maps;
import lombok.Getter; import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.similarity.JaroWinklerSimilarity;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* 参数的提取规则 * 参数的提取规则
@ -9,14 +19,62 @@ import lombok.Getter;
@Getter @Getter
public enum ExtractRule { public enum ExtractRule {
//车站名称
STATION_NAME { STATION_NAME {
@Override @Override
public Object matchParam(Simulation simulation, String... sourceStr) { public Object matchParam(Simulation simulation, String... sourceStr) {
return ExtractRule.findDevice(simulation, MapElement.DeviceType.STATION, Station.class,sourceStr[0]);
}
},
// 道岔名称
SWITCH_NAME{
@Override
public Object matchParam(Simulation simulation, String... sourceStr) {
return ExtractRule.findDevice(simulation, MapElement.DeviceType.SWITCH, Switch.class,sourceStr[0]);
}
},
//上下行
UP_DOWN_WAY {
@Override
public Object matchParam(Simulation simulation, String... sourceStr) {
if(StringUtils.containsAnyIgnoreCase(sourceStr[0],"shangxing","shang")){
return true;
}else if(StringUtils.containsAnyIgnoreCase(sourceStr[0],"xiaxing","xia")){
return false;
}else{
return null;
}
}
},SIGNAL_NAME{
@Override
public Object matchParam(Simulation simulation, String... sourceStr) {
return ExtractRule.findDevice(simulation, MapElement.DeviceType.SIGNAL, Signal.class,sourceStr[0]);
}
},STAND_NAME{
@Override
public Object matchParam(Simulation simulation, String... sourceStr) {
return null; return null;
} }
}; };
public abstract Object matchParam(Simulation simulation, String... sourceStr); public abstract Object matchParam(Simulation simulation, String... sourceStr);
private static MapNamedElement findDevice(Simulation simulation, MapElement.DeviceType dt, Class<? extends MapNamedElement> eleClass,String matchVal){
List<? extends MapNamedElement> eleList = simulation.getRepository().getListByType(dt,eleClass);
Map<Double,MapNamedElement> elementMap = Maps.newHashMap();
for (MapNamedElement ele : eleList) {
String namePinYin = PinYinUtil.toPinYin(ele.getName());
double ratio = StrUtils.getJaroWinklerSimilarityRatio(namePinYin,matchVal);
elementMap.put(ratio,ele);
}
Double d = elementMap.keySet().stream().mapToDouble(k->k).max().orElse(0D);
MapNamedElement nameEle = elementMap.get(d);
if(Objects.isNull(nameEle)){
return null;
}
return nameEle;
}
} }

View File

@ -0,0 +1,8 @@
package club.joylink.rtss.simulation.cbtc.discriminate;
import java.util.List;
public interface IVoiceDiscriminateRule {
List<VoiceDiscriminateRule> findRuleByMapId(Long mapId);
}

View File

@ -9,7 +9,7 @@ import java.util.List;
*/ */
@Data @Data
public class VoiceDiscriminateRule { public class VoiceDiscriminateRule {
private Long id; // private Long id;
/** /**
* 关键字正则 * 关键字正则

View File

@ -1,7 +1,14 @@
package club.joylink.rtss.util; package club.joylink.rtss.util;
import org.apache.commons.text.similarity.JaroWinklerSimilarity;
public class StrUtils { public class StrUtils {
private StrUtils(){
}
final static JaroWinklerSimilarity SIMILARITY = new JaroWinklerSimilarity();
/** /**
* 清理语音识别中的标点符号 * 清理语音识别中的标点符号
* @param source * @param source
@ -30,6 +37,10 @@ public class StrUtils {
return false; return false;
} }
public static double getJaroWinklerSimilarityRatio(String str,String target){
return SIMILARITY.apply(str,target);
}
/** /**
* 获取两字符串的相似度 * 获取两字符串的相似度
*/ */
@ -38,6 +49,7 @@ public class StrUtils {
return 1 - (float) compare(str, target) / max; return 1 - (float) compare(str, target) / max;
} }
/** /**
* 比较两个字符串的相识度 * 比较两个字符串的相识度
* 核心算法用一个二维数组记录每个字符串是否相同如果相同记为0不相同记为1每行每列相同个数累加 * 核心算法用一个二维数组记录每个字符串是否相同如果相同记为0不相同记为1每行每列相同个数累加

View File

@ -0,0 +1,97 @@
package club.joylink.rtss.vo.voice;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs;
import club.joylink.rtss.simulation.cbtc.discriminate.OperateRule;
import club.joylink.rtss.simulation.cbtc.discriminate.ParamExtractRule;
import club.joylink.rtss.simulation.cbtc.discriminate.ReplyRule;
import club.joylink.rtss.simulation.cbtc.discriminate.VoiceDiscriminateRule;
import club.joylink.rtss.util.JsonUtils;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Data
public class VoiceDiscriminateConfigVO implements Serializable {
private Long id;
/**
* 描述
*/
private String describe;
/**
* 关键字正则
*/
private String keyWordRules;
private Long mapId;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Long operateId;
/**
* 所需参数
* {@link List ParamExtractRule}
*/
private List<ParamExtractRule> paramsRules;
/**
* 执行指令系统操作指令
* {@link OperateRule}
*/
private OperateRule execOperateRule;
/**
* 回复指令系统指令操作完毕或者无系统指令时交互回复
* {@link ReplyRule}
*/
private ReplyRule replyRule;
public VoiceDiscriminateConfigWithBLOBs convertToEntry(){
VoiceDiscriminateConfigWithBLOBs data = new VoiceDiscriminateConfigWithBLOBs();
BeanUtils.copyProperties(this, data);
if(!CollectionUtils.isEmpty(this.paramsRules)){
data.setParamsRules(JsonUtils.writeValueAsString(this.paramsRules));
}
if(Objects.nonNull(this.execOperateRule)){
data.setExecOperateRule(JsonUtils.writeValueAsString(this.execOperateRule));
}
if(Objects.nonNull(this.replyRule)){
data.setReplyRule(JsonUtils.writeValueAsString(this.replyRule));
}
return data;
}
public static VoiceDiscriminateConfigVO convertVO(VoiceDiscriminateConfigWithBLOBs data){
VoiceDiscriminateConfigVO vo = new VoiceDiscriminateConfigVO();
BeanUtils.copyProperties(data, vo);
if(StringUtils.hasText(data.getParamsRules())){
vo.setParamsRules(JsonUtils.readCollection(data.getParamsRules(), ArrayList.class,ParamExtractRule.class));
}
if(StringUtils.hasText(data.getExecOperateRule())){
vo.setExecOperateRule(JsonUtils.read(data.getExecOperateRule(),OperateRule.class));
}
if(StringUtils.hasText(data.getReplyRule())){
vo.setReplyRule(JsonUtils.read(data.getReplyRule(),ReplyRule.class));
}
return vo;
}
public static VoiceDiscriminateRule convertRule(VoiceDiscriminateConfigWithBLOBs data){
VoiceDiscriminateConfigVO configVO = convertVO(data);
VoiceDiscriminateRule rule = new VoiceDiscriminateRule();
rule.setKeyWordRules(configVO.getKeyWordRules());
rule.setParamsRules(configVO.getParamsRules());
rule.setExecOperateRule(configVO.getExecOperateRule());
rule.setReplyRule(configVO.getReplyRule());
return rule;
}
}

View File

@ -0,0 +1,25 @@
package club.joylink.rtss.vo.voice;
import club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.Data;
import java.util.Objects;
@Data
public class VoiceQueryVO extends PageQueryVO {
private Long mapId;
private Integer status;
public VoiceDiscriminateConfigExample buildQueryExample(){
VoiceDiscriminateConfigExample example = new VoiceDiscriminateConfigExample();
VoiceDiscriminateConfigExample.Criteria criteria = example.createCriteria();
if(Objects.nonNull(this.mapId)){
criteria.andMapIdEqualTo(this.mapId);
}
if(Objects.nonNull(this.status)){
criteria.andStatusEqualTo(this.status);
}
return example;
}
}

View File

@ -0,0 +1,363 @@
<?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="club.joylink.rtss.dao.voice.VoiceDiscriminateConfigDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.voice.VoiceDiscriminateConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="key_word_rules" jdbcType="VARCHAR" property="keyWordRules" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="operate_id" jdbcType="BIGINT" property="operateId" />
<result column="describe" jdbcType="VARCHAR" property="describe" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs">
<result column="params_rules" jdbcType="LONGVARCHAR" property="paramsRules" />
<result column="exec_operate_rule" jdbcType="LONGVARCHAR" property="execOperateRule" />
<result column="reply_rule" jdbcType="LONGVARCHAR" property="replyRule" />
</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, key_word_rules, map_id, create_time, update_time, operate_id, `describe`, `status`
</sql>
<sql id="Blob_Column_List">
params_rules, exec_operate_rule, reply_rule
</sql>
<select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from rts_voice_discriminate_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from rts_voice_discriminate_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from rts_voice_discriminate_config
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from rts_voice_discriminate_config
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample">
delete from rts_voice_discriminate_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs" useGeneratedKeys="true">
insert into rts_voice_discriminate_config (key_word_rules, map_id, create_time,
update_time, operate_id, `describe`,
`status`, params_rules, exec_operate_rule,
reply_rule)
values (#{keyWordRules,jdbcType=VARCHAR}, #{mapId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{operateId,jdbcType=BIGINT}, #{describe,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{paramsRules,jdbcType=LONGVARCHAR}, #{execOperateRule,jdbcType=LONGVARCHAR},
#{replyRule,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs" useGeneratedKeys="true">
insert into rts_voice_discriminate_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="keyWordRules != null">
key_word_rules,
</if>
<if test="mapId != null">
map_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="operateId != null">
operate_id,
</if>
<if test="describe != null">
`describe`,
</if>
<if test="status != null">
`status`,
</if>
<if test="paramsRules != null">
params_rules,
</if>
<if test="execOperateRule != null">
exec_operate_rule,
</if>
<if test="replyRule != null">
reply_rule,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="keyWordRules != null">
#{keyWordRules,jdbcType=VARCHAR},
</if>
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="operateId != null">
#{operateId,jdbcType=BIGINT},
</if>
<if test="describe != null">
#{describe,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="paramsRules != null">
#{paramsRules,jdbcType=LONGVARCHAR},
</if>
<if test="execOperateRule != null">
#{execOperateRule,jdbcType=LONGVARCHAR},
</if>
<if test="replyRule != null">
#{replyRule,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigExample" resultType="java.lang.Long">
select count(*) from rts_voice_discriminate_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update rts_voice_discriminate_config
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.keyWordRules != null">
key_word_rules = #{record.keyWordRules,jdbcType=VARCHAR},
</if>
<if test="record.mapId != null">
map_id = #{record.mapId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.operateId != null">
operate_id = #{record.operateId,jdbcType=BIGINT},
</if>
<if test="record.describe != null">
`describe` = #{record.describe,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.paramsRules != null">
params_rules = #{record.paramsRules,jdbcType=LONGVARCHAR},
</if>
<if test="record.execOperateRule != null">
exec_operate_rule = #{record.execOperateRule,jdbcType=LONGVARCHAR},
</if>
<if test="record.replyRule != null">
reply_rule = #{record.replyRule,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update rts_voice_discriminate_config
set id = #{record.id,jdbcType=BIGINT},
key_word_rules = #{record.keyWordRules,jdbcType=VARCHAR},
map_id = #{record.mapId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
operate_id = #{record.operateId,jdbcType=BIGINT},
`describe` = #{record.describe,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
params_rules = #{record.paramsRules,jdbcType=LONGVARCHAR},
exec_operate_rule = #{record.execOperateRule,jdbcType=LONGVARCHAR},
reply_rule = #{record.replyRule,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update rts_voice_discriminate_config
set id = #{record.id,jdbcType=BIGINT},
key_word_rules = #{record.keyWordRules,jdbcType=VARCHAR},
map_id = #{record.mapId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
operate_id = #{record.operateId,jdbcType=BIGINT},
`describe` = #{record.describe,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs">
update rts_voice_discriminate_config
<set>
<if test="keyWordRules != null">
key_word_rules = #{keyWordRules,jdbcType=VARCHAR},
</if>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="operateId != null">
operate_id = #{operateId,jdbcType=BIGINT},
</if>
<if test="describe != null">
`describe` = #{describe,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="paramsRules != null">
params_rules = #{paramsRules,jdbcType=LONGVARCHAR},
</if>
<if test="execOperateRule != null">
exec_operate_rule = #{execOperateRule,jdbcType=LONGVARCHAR},
</if>
<if test="replyRule != null">
reply_rule = #{replyRule,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfigWithBLOBs">
update rts_voice_discriminate_config
set key_word_rules = #{keyWordRules,jdbcType=VARCHAR},
map_id = #{mapId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
operate_id = #{operateId,jdbcType=BIGINT},
`describe` = #{describe,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
params_rules = #{paramsRules,jdbcType=LONGVARCHAR},
exec_operate_rule = #{execOperateRule,jdbcType=LONGVARCHAR},
reply_rule = #{replyRule,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.voice.VoiceDiscriminateConfig">
update rts_voice_discriminate_config
set key_word_rules = #{keyWordRules,jdbcType=VARCHAR},
map_id = #{mapId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
operate_id = #{operateId,jdbcType=BIGINT},
`describe` = #{describe,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>