From 0c9ec42a824aa3242fe1e1b8ce372947f2bc9a03 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 29 七月 2024 17:43:06 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java       |   21 ++++++
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java             |    2 
 smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java            |    4 +
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml                              |   13 ++++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java |    2 
 smartor/src/main/java/com/smartor/domain/SvyLibTemplateReq.java                                |   11 +++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java          |   10 +-
 ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java                |   74 ++++++++----------------
 smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java                                    |    6 +
 smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java                                  |    4 +
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java                   |   24 ++++++-
 11 files changed, 108 insertions(+), 63 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
index 463467c..8a872c2 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -58,10 +58,10 @@
     public TableDataInfo list(@RequestBody ServiceTask serviceTask) {
         PageUtils.startPageByPost(serviceTask.getPageNum(), serviceTask.getPageSize());
         List<ServiceTask> list = serviceTaskService.selectServiceTaskList(serviceTask);
-        List<ServiceTaskVO> ServiceTaskVOS = DtoConversionUtils.sourceToTarget(list, ServiceTaskVO.class);
+        List<ServiceTaskVO> serviceTaskVOS = DtoConversionUtils.sourceToTarget(list, ServiceTaskVO.class);
 
-        if (CollectionUtils.isNotEmpty(ServiceTaskVOS)) {
-            for (ServiceTaskVO ServiceTaskVO : ServiceTaskVOS) {
+        if (CollectionUtils.isNotEmpty(serviceTaskVOS)) {
+            for (ServiceTaskVO ServiceTaskVO : serviceTaskVOS) {
                 ServiceSubtask ServiceTaskcall = new ServiceSubtask();
                 ServiceTaskcall.setTaskid(ServiceTaskVO.getTaskid());
                 List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(ServiceTaskcall);
@@ -84,10 +84,10 @@
                 }
             });
 
-            return getDataTable2(total, ServiceTaskVOS);
+            return getDataTable2(total, serviceTaskVOS);
         }
 
-        return getDataTable2(0, ServiceTaskVOS);
+        return getDataTable2(0, serviceTaskVOS);
     }
 
     /**
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java
index 5d02877..64d21de 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java
@@ -38,7 +38,7 @@
     @PreAuthorize("@ss.hasPermi('smartor:category:list')")
     @PostMapping("/list")
     public TableDataInfo list(@RequestBody SvyLibScriptCategory svyLibScriptCategory) {
-        startPage();
+//        startPage();
         List<SvyLibScriptCategoryVO> list = svyLibScriptCategoryService.selectSvyLibScriptCategoryList(svyLibScriptCategory);
         return getDataTable(list);
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java
index 43b92ce..7149c53 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java
@@ -2,17 +2,20 @@
 
 import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
 import com.aliyun.teaopenapi.models.Config;
+import com.github.pagehelper.ISelect;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.PageUtils;
 import com.smartor.domain.SvyLibTemplate;
 import com.smartor.domain.SvyLibTemplateReq;
 import com.smartor.service.ISvyLibTemplateService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -39,9 +42,23 @@
     @ApiOperation("鏌ヨ闂嵎鍒楄〃璇︽儏")
     @PostMapping("/selectSvyLibTemplatelist")
     public TableDataInfo selectSvyLibTemplatelist(@RequestBody SvyLibTemplateReq svyLibTemplateReq) {
-        startPage();
+        PageUtils.startPageByPost(svyLibTemplateReq.getPageNum(), svyLibTemplateReq.getPageSize());
         List<SvyLibTemplate> list = svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq);
-        return getDataTable(list);
+
+        if (CollectionUtils.isNotEmpty(list)) {
+            //鑾峰彇total
+            long total = PageUtils.count(new ISelect() {
+                @Override
+                public void doSelect() {
+                    svyLibTemplateReq.setPageNum(null);
+                    svyLibTemplateReq.setPageSize(null);
+                    svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq);
+                }
+            });
+
+            return getDataTable2(total, list);
+        }
+        return getDataTable2(0, list);
     }
 
 //
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
index 3d41241..39b07ca 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
@@ -1,9 +1,12 @@
 package com.ruoyi.framework.web.service;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import javax.servlet.http.HttpServletRequest;
+
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -27,8 +30,7 @@
  * @author ruoyi
  */
 @Component
-public class TokenService
-{
+public class TokenService {
     // 浠ょ墝鑷畾涔夋爣璇�
     @Value("${token.header}")
     private String header;
@@ -55,23 +57,18 @@
      *
      * @return 鐢ㄦ埛淇℃伅
      */
-    public LoginUser getLoginUser(HttpServletRequest request)
-    {
+    public LoginUser getLoginUser(HttpServletRequest request) {
         // 鑾峰彇璇锋眰鎼哄甫鐨勪护鐗�
         String token = getToken(request);
-        if (StringUtils.isNotEmpty(token))
-        {
-            try
-            {
+        if (StringUtils.isNotEmpty(token)) {
+            try {
                 Claims claims = parseToken(token);
                 // 瑙f瀽瀵瑰簲鐨勬潈闄愪互鍙婄敤鎴蜂俊鎭�
                 String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
                 String userKey = getTokenKey(uuid);
                 LoginUser user = redisCache.getCacheObject(userKey);
                 return user;
-            }
-            catch (Exception e)
-            {
+            } catch (Exception e) {
             }
         }
         return null;
@@ -80,10 +77,8 @@
     /**
      * 璁剧疆鐢ㄦ埛韬唤淇℃伅
      */
-    public void setLoginUser(LoginUser loginUser)
-    {
-        if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
-        {
+    public void setLoginUser(LoginUser loginUser) {
+        if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) {
             refreshToken(loginUser);
         }
     }
@@ -91,10 +86,8 @@
     /**
      * 鍒犻櫎鐢ㄦ埛韬唤淇℃伅
      */
-    public void delLoginUser(String token)
-    {
-        if (StringUtils.isNotEmpty(token))
-        {
+    public void delLoginUser(String token) {
+        if (StringUtils.isNotEmpty(token)) {
             String userKey = getTokenKey(token);
             redisCache.deleteObject(userKey);
         }
@@ -106,8 +99,7 @@
      * @param loginUser 鐢ㄦ埛淇℃伅
      * @return 浠ょ墝
      */
-    public String createToken(LoginUser loginUser)
-    {
+    public String createToken(LoginUser loginUser) {
         String token = IdUtils.fastUUID();
         loginUser.setToken(token);
         setUserAgent(loginUser);
@@ -124,12 +116,11 @@
      * @param loginUser
      * @return 浠ょ墝
      */
-    public void verifyToken(LoginUser loginUser)
-    {
+    public void verifyToken(LoginUser loginUser) {
         long expireTime = loginUser.getExpireTime();
         long currentTime = System.currentTimeMillis();
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
-        {
+        System.out.println("浠ょ墝鏈夋晥鏈熶负:" + (expireTime - currentTime)+"    "+ new Date());
+        if (expireTime - currentTime <= MILLIS_MINUTE_TEN) {
             refreshToken(loginUser);
         }
     }
@@ -139,8 +130,7 @@
      *
      * @param loginUser 鐧诲綍淇℃伅
      */
-    public void refreshToken(LoginUser loginUser)
-    {
+    public void refreshToken(LoginUser loginUser) {
         loginUser.setLoginTime(System.currentTimeMillis());
         loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
         // 鏍规嵁uuid灏唋oginUser缂撳瓨
@@ -153,8 +143,7 @@
      *
      * @param loginUser 鐧诲綍淇℃伅
      */
-    public void setUserAgent(LoginUser loginUser)
-    {
+    public void setUserAgent(LoginUser loginUser) {
         UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
         String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
         loginUser.setIpaddr(ip);
@@ -169,11 +158,8 @@
      * @param claims 鏁版嵁澹版槑
      * @return 浠ょ墝
      */
-    private String createToken(Map<String, Object> claims)
-    {
-        String token = Jwts.builder()
-                .setClaims(claims)
-                .signWith(SignatureAlgorithm.HS512, secret).compact();
+    private String createToken(Map<String, Object> claims) {
+        String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
         return token;
     }
 
@@ -183,12 +169,8 @@
      * @param token 浠ょ墝
      * @return 鏁版嵁澹版槑
      */
-    private Claims parseToken(String token)
-    {
-        return Jwts.parser()
-                .setSigningKey(secret)
-                .parseClaimsJws(token)
-                .getBody();
+    private Claims parseToken(String token) {
+        return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
     }
 
     /**
@@ -197,8 +179,7 @@
      * @param token 浠ょ墝
      * @return 鐢ㄦ埛鍚�
      */
-    public String getUsernameFromToken(String token)
-    {
+    public String getUsernameFromToken(String token) {
         Claims claims = parseToken(token);
         return claims.getSubject();
     }
@@ -209,18 +190,15 @@
      * @param request
      * @return token
      */
-    private String getToken(HttpServletRequest request)
-    {
+    private String getToken(HttpServletRequest request) {
         String token = request.getHeader(header);
-        if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
-        {
+        if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) {
             token = token.replace(Constants.TOKEN_PREFIX, "");
         }
         return token;
     }
 
-    private String getTokenKey(String uuid)
-    {
+    private String getTokenKey(String uuid) {
         return CacheConstants.LOGIN_TOKEN_KEY + uuid;
     }
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
index cb97c61..c2f3d6e 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
@@ -34,7 +34,7 @@
     @Excel(name = "鍒嗙粍ID")
     @ApiModelProperty(value = "鍒嗙粍ID")
     private String groupid;
-    
+
     /**
      * 閫傜敤棰樺瀷(鍗曢�夈�佸閫夈�佸煷绌恒�佺粍鍚�)
      */
@@ -201,5 +201,9 @@
     @Excel(name = "pageSize")
     private Integer pageSize;
 
+    @ApiModelProperty(value = "鐢ㄤ簬鏌ヨ鏍囩鐨勶紝涓嶇敤浜庡瓨鏁版嵁")
+    private String tagName;
 
+    @ApiModelProperty(value = "鐢ㄤ簬鏌ヨ鏍囩鐨勶紝涓嶇敤浜庡瓨鏁版嵁")
+    private String optionDesc;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
index 6d77ccb..7144702 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
@@ -22,7 +22,7 @@
  */
 @Data
 @ApiModel(value = "IvrLibaTargetVO", description = "鎸囨爣搴撳璞¤繑鍙�")
-public class IvrLibaTargetVO {
+public class IvrLibaTargetVO  extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
     /**
@@ -223,4 +223,6 @@
     @ApiModelProperty(value = "璇磋瘽鍐呭")
     private String content;
 
+    @ApiModelProperty(value = "鐢ㄤ簬鏌ヨ鏍囩鐨勶紝涓嶇敤浜庡瓨鏁版嵁")
+    private String optionDesc;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateReq.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateReq.java
index 822b981..eef63b5 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateReq.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateReq.java
@@ -47,5 +47,16 @@
     @ApiModelProperty(value = "閫傜敤鐤剧梾")
     private String description;
 
+    /**
+     * pageNum
+     */
+    @ApiModelProperty("pageNum")
+    private Integer pageNum;
+
+    /**
+     * pageSize
+     */
+    @ApiModelProperty("pageSize")
+    private Integer pageSize;
 
 }
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
index 5006975..ee28ec1 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetAssortServiceImpl.java
@@ -98,6 +98,8 @@
         if (seqMax != null) {
             ivrLibaTargetAssort.setSeqno(seqMax + 1);
         }
+        //-1浠h〃涓绘爲
+        if (ivrLibaTargetAssort.getPid() == null) ivrLibaTargetAssort.setPid((long) -1);
         i = ivrLibaTargetAssortMapper.insertIvrLibaTargetAssort(ivrLibaTargetAssort);
         log.info("鎸囨爣鍒嗙被涓�绾ф爲鐨勪富閿�:{}", ivrLibaTargetAssort.getId());
 
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
index ac7b3a5..ce0f95e 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
@@ -21,9 +21,7 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -94,10 +92,25 @@
                 ivrLibaTarget1.setTargetoptionList(ivrLibaTargetoptions);
             }
             //鑾峰彇璇ユ寚鏍囩殑鏍囩
-            IvrLibaTargetTag ivrLibaTargetTag =new IvrLibaTargetTag();
+            IvrLibaTargetTag ivrLibaTargetTag = new IvrLibaTargetTag();
             ivrLibaTargetTag.setTargetid(ivrLibaTarget1.getId());
             List<IvrLibaTargetTag> ivrLibaTargetTags = ivrLibaTargetTagMapper.selectIvrLibaTargetTagList(ivrLibaTargetTag);
+
             ivrLibaTarget1.setIvrLibaTargetTagList(ivrLibaTargetTags);
+        }
+        //鍒ゆ柇鍏ュ弬鏉′欢涓紝tagName鏄惁鏈夊�硷紝濡傛灉鏈夊�硷紝鍒欓渶瑕佹牴鎹粰鐨勫�艰繘琛屾爣绛捐繃婊�
+        if (StringUtils.isNotEmpty(ivrLibaTarget.getTagName())) {
+            List<IvrLibaTargetVO> ivrLibaTargetVOList = new ArrayList<>();
+            aa:
+            for (IvrLibaTargetVO ivrLibaTarget1 : ivrLibaTargetVOS) {
+                for (IvrLibaTargetTag ivrLibaTargetTag1 : ivrLibaTarget1.getIvrLibaTargetTagList()) {
+                    if (ivrLibaTargetTag1.getTagname().contains(ivrLibaTarget.getTagName().trim())) {
+                        ivrLibaTargetVOList.add(ivrLibaTarget1);
+                        continue aa;
+                    }
+                }
+            }
+            ivrLibaTargetVOS = ivrLibaTargetVOList;
         }
         //涓嬮潰鐢ㄥ乏澶栨劅瑙夋湁鐐归棶棰橈紝where涓殑option鐨刣el浼氬鑷村乏杈圭殑鏌ヨ涓嶅叏锛屽厛涓嶇敤鍚�
 //        ivrLibaTargetMapper.targetInfo(ivrLibaTarget)
@@ -151,9 +164,12 @@
         ivrLibaTarget.setUpdateTime(DateUtils.getNowDate());
         if (ivrLibaTargetVO.getIsoperation() != null && ivrLibaTargetVO.getIsoperation() == 1) {
             //鏂板
+            ivrLibaTarget.setCreateTime(new Date());
+            ivrLibaTarget.setUpdateTime(new Date());
             ivrLibaTargetMapper.insertIvrLibaTarget(ivrLibaTarget);
         } else if (ivrLibaTargetVO.getIsoperation() != null && ivrLibaTargetVO.getIsoperation() == 2) {
             //淇敼
+            ivrLibaTarget.setUpdateTime(new Date());
             ivrLibaTargetMapper.updateIvrLibaTarget(ivrLibaTarget);
         }
 
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java
index 849a931..c598b25 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java
@@ -14,6 +14,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -138,6 +139,9 @@
         if (seqMax != null) {
             svyLibScriptCategory.setSeqno(seqMax + 1);
         }
+        svyLibScriptCategory.setUpdateTime(new Date());
+        svyLibScriptCategory.setCreateTime(new Date());
+        if (svyLibScriptCategory.getPid() == null) svyLibScriptCategory.setPid((long) -1);
         i = svyLibScriptCategoryMapper.insertSvyLibScriptCategory(svyLibScriptCategory);
         log.info("闂璇濇湳鍒嗙被搴撲竴绾ф爲鐨勪富閿�:{}", svyLibScriptCategory.getId());
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
index bd62c98..bf05b21 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
@@ -33,6 +33,7 @@
         <result property="parameter" column="parameter"/>
         <result property="reply" column="reply"/>
         <result property="scriptType" column="script_type"/>
+        <result property="optionDesc" column="option_desc"/>
     </resultMap>
 
     <resultMap type="com.smartor.domain.IvrLibaTargetVO" id="IvrLibaTargetVOResult">
@@ -60,6 +61,7 @@
         <result property="suitWay" column="suitWay"/>
         <result property="parameter" column="parameter"/>
         <result property="reply" column="reply"/>
+        <result property="optionDesc" column="option_desc"/>
         <collection property="targetoptionList" javaType="java.util.List" resultMap="IvrLibaTargetoptionResult"/>
     </resultMap>
 
@@ -92,6 +94,7 @@
     <sql id="selectIvrLibaTargetVo">
         select id,
                groupid,
+               option_desc,
                script_type,
                targettype,
                targetname,
@@ -112,7 +115,7 @@
             <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
             <if test="scriptType != null  and scriptType != ''">and script_type like concat('%', #{scriptType}, '%')
             </if>
-            <if test="targetdesc != null  and targetdesc != ''">and targetdesc = #{targetdesc}</if>
+            <if test="targetdesc != null  and targetdesc != ''">and targetdesc like concat('%', #{targetdesc}, '%')</if>
             <if test="language != null  and language != ''">and language = #{language}</if>
             <if test="version != null ">and version = #{version}</if>
             <if test="valueType != null ">and value_type = #{valueType}</if>
@@ -129,8 +132,10 @@
             <if test="suitDisease != null and suitDisease != ''">and suitDisease = #{suitDisease}</if>
             <if test="suitWay != null and suitWay != ''">and suitWay like concat('%', #{suitWay}, '%')</if>
             <if test="parameter != null and parameter != ''">and parameter = #{parameter}</if>
+            <if test="optionDesc != null and optionDesc != ''">and option_desc = #{optionDesc}</if>
 
         </where>
+        order by update_time desc
     </select>
 
     <select id="targetInfo" parameterType="com.smartor.domain.IvrLibaTarget" resultMap="IvrLibaTargetVOResult">
@@ -148,6 +153,7 @@
         a.warndown,
         a.orgid,
         a.pid,
+        a.option_desc,
         a.guid,
         a.reply,
         a.assortid,
@@ -187,6 +193,8 @@
             <if test="suitDisease != null and suitDisease != ''">a.suitDisease = #{suitDisease}</if>
             <if test="suitWay != null and suitWay != ''">a.suitWay like concat('%', #{suitWay}, '%')</if>
             <if test="parameter != null and parameter != ''">a.parameter = #{parameter}</if>
+            <if test="optionDesc != null and optionDesc != ''">a.option_desc = #{optionDesc}</if>
+
         </where>
         ORDER BY a.targetID
     </select>
@@ -227,6 +235,7 @@
             <if test="parameter != null and parameter != ''">parameter,</if>
             <if test="reply != null and reply != ''">reply,</if>
             <if test="scriptType != null and scriptType != ''">script_type,</if>
+            <if test="optionDesc != null and optionDesc != ''">option_desc,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="groupid != null">#{groupid},</if>
@@ -258,6 +267,7 @@
             <if test="parameter != null and parameter != ''">#{parameter},</if>
             <if test="reply != null and reply != ''">#{reply},</if>
             <if test="scriptType != null and scriptType != ''">#{scriptType},</if>
+            <if test="optionDesc != null and optionDesc != ''">#{optionDesc},</if>
         </trim>
     </insert>
 
@@ -291,6 +301,7 @@
             <if test="parameter != null and parameter != ''">parameter = #{parameter},</if>
             <if test="reply != null and reply != ''">reply = #{reply},</if>
             <if test="scriptType != null and scriptType != ''">script_type = #{scriptType},</if>
+            <if test="optionDesc != null and optionDesc != ''">option_desc = #{optionDesc},</if>
         </trim>
         where id = #{id}
     </update>

--
Gitblit v1.9.3