Bladeren bron

代码生成器开发完成

wuxw 6 jaren geleden
bovenliggende
commit
9d6533137c

+ 1 - 0
WebService/src/main/resources/components/appPackage/choose-app/chooseApp.js

@@ -44,6 +44,7 @@
                            );
             },
             chooseApp:function(_app){
+                _app.appName = _app.name;
                 vc.emit($props.emitChooseApp,'chooseApp',_app);
                 vc.emit($props.emitLoadData,'listAppData',{
                     appId:_app.appId

+ 25 - 23
WebService/src/main/resources/components/servicePackage/service-manage/serviceManage.html

@@ -14,10 +14,11 @@
                     <div class="row">
                         <div class="col-sm-4">
                             <div class="form-group input-group">
-                                <input type="text" placeholder="请选择应用名称" v-model="serviceManageInfo.appName"
+                                <input type="text" placeholder="请选择应用名称" v-model="serviceManageInfo.conditions.appName"
                                        class=" form-control">
                                 <div class="input-group-prepend">
-                                    <button type="button" class="btn btn-primary btn-sm"><i
+                                    <button type="button" class="btn btn-primary btn-sm"
+                                            v-on:click="_openChooseAppMethod()"><i
                                             class="glyphicon glyphicon-search"></i> 选择
                                     </button>
                                 </div>
@@ -25,31 +26,32 @@
                         </div>
                         <div class="col-sm-4">
                             <div class="form-group">
-                                <input type="text" placeholder="请输入服务名称" v-model="serviceManageInfo.serviceName"
-                                       class=" form-control">
+                                <input type="text" placeholder="请输入服务名称"
+                                       v-model="serviceManageInfo.conditions.serviceName" class=" form-control">
                             </div>
                         </div>
                         <div class="col-sm-3">
                             <div class="form-group">
-                                <input type="text" placeholder="请输入服务编码" v-model="serviceManageInfo.serviceCode"
-                                       class=" form-control">
+                                <input type="text" placeholder="请输入服务编码"
+                                       v-model="serviceManageInfo.conditions.serviceCode" class=" form-control">
                             </div>
                         </div>
                         <div class="col-sm-1">
-                            <button type="button" class="btn btn-primary btn-sm"><i
-                                    class="glyphicon glyphicon-search"></i> 查询
+                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryServiceMethod()"><i
+                                    class="glyphicon glyphicon-search" ></i> 查询
                             </button>
                         </div>
                     </div>
                     <div class="row">
-                        <div class="col-sm-4">
+                        <div class="col-sm-4" v-if="serviceManageInfo.moreCondition == true">
                             <div class="form-group">
-                                <input type="text" placeholder="请输入调用地址" v-model="serviceManageInfo.serviceUrl"
-                                       class=" form-control">
+                                <input type="text" placeholder="请输入调用地址"
+                                       v-model="serviceManageInfo.conditions.serviceUrl" class=" form-control">
                             </div>
                         </div>
                     </div>
 
+
                 </div>
             </div>
         </div>
@@ -59,6 +61,12 @@
             <div class="ibox">
                 <div class="ibox-title">
                     <h5>服务信息</h5>
+                    <div class="ibox-tools" style="top:10px;">
+                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddServiceModal()">
+                            <i class="glyphicon glyphicon-plus"></i>
+                            添加服务
+                        </button>
+                    </div>
                 </div>
                 <div class="ibox-content">
 
@@ -71,15 +79,9 @@
                             <th class="text-center">服务ID</th>
                             <th class="text-center">服务名称</th>
                             <th class="text-center">服务编码</th>
-                            <th class="text-center">秘钥</th>
-                            <th class="text-center">序列</th>
                             <th class="text-center">消息队列</th>
-                            <th class="text-center">是否实例</th>
                             <th class="text-center">调用地址</th>
                             <th class="text-center">调用方式</th>
-                            <th class="text-center">超时时间</th>
-                            <th class="text-center">重试次数</th>
-                            <th class="text-center">提供服务</th>
                             <th class="text-center">操作</th>
 
 
@@ -90,15 +92,9 @@
                             <td class="text-center">{{service.serviceId}}</td>
                             <td class="text-center">{{service.name}}</td>
                             <td class="text-center">{{service.serviceCode}}</td>
-                            <td class="text-center">{{service.businessTypeCd}}</td>
-                            <td class="text-center">{{service.seq}}</td>
                             <td class="text-center">{{service.messageQueueName}}</td>
-                            <td class="text-center">{{service.isInstance}}</td>
                             <td class="text-center">{{service.url}}</td>
                             <td class="text-center">{{service.method}}</td>
-                            <td class="text-center">{{service.timeout}}</td>
-                            <td class="text-center">{{service.retryCount}}</td>
-                            <td class="text-center">{{service.provideAppId}}</td>
                             <td class="text-center">
                                 <div class="btn-group">
                                     <button class="btn-white btn btn-xs" v-on:click="_openEditServiceModel(service)">
@@ -129,6 +125,12 @@
         </div>
     </div>
 
+    <vc:create name="chooseApp"
+               emitChooseApp="serviceManage"
+               emitLoadData="serviceManage"
+    ></vc:create>
+
+
     <vc:create name="addService"
                callBackListener=""
                callBackFunction=""

+ 28 - 14
WebService/src/main/resources/components/servicePackage/service-manage/serviceManage.js

@@ -5,24 +5,31 @@
     var DEFAULT_PAGE = 1;
     var DEFAULT_ROWS = 10;
     vc.extends({
-        propTypes: {
-           needShowAddAppButton:vc.propTypes.string = 'true' // 是否显示添加应用button
-        },
         data:{
             serviceManageInfo:{
                 services:[],
                 total:0,
                 records:1,
+                moreCondition:false,
                 name:'',
-                serviceCode:'',
-                appId:'',
-                needShowAddAppButton:$props.needShowAddAppButton
+                conditions:{
+                    appName:'',
+appId:'',
+serviceName:'',
+serviceCode:'',
+serviceUrl:'',
+
+                }
             }
         },
         _initMethod:function(){
             vc.component._listServices(DEFAULT_PAGE, DEFAULT_ROWS);
         },
         _initEvent:function(){
+            vc.on('serviceManage','chooseApp',function(_param){
+              vc.copyObject(_param,vc.component.serviceManageInfo.conditions);
+            });
+
             vc.on('serviceManage','listService',function(_param){
                   vc.component._listServices(DEFAULT_PAGE, DEFAULT_ROWS);
             });
@@ -32,16 +39,13 @@
         },
         methods:{
             _listServices:function(_page, _rows){
+
+                vc.component.serviceManageInfo.conditions.page = _page;
+                vc.component.serviceManageInfo.conditions.row = _rows;
                 var param = {
-                    params:{
-                        page:_page,
-                        row:_rows,
-                        appId:vc.component.serviceManageInfo.appId,
-                        name:vc.component.serviceManageInfo.name,
-                        serviceCode:vc.component.serviceManageInfo.serviceCode
-                    }
+                    params:vc.component.serviceManageInfo.conditions
+               };
 
-               }
                //发送get请求
                vc.http.get('serviceManage',
                             'list',
@@ -74,6 +78,16 @@
 
             },
             _moreCondition:function(){
+                if(vc.component.serviceManageInfo.moreCondition){
+                    vc.component.serviceManageInfo.moreCondition = false;
+                }else{
+                    vc.component.serviceManageInfo.moreCondition = true;
+                }
+            }
+
+             ,
+ _openChooseAppMethod:function(){
+                vc.emit('chooseApp','openChooseAppModel',{});
 
             }
         }

+ 8 - 0
WebService/src/main/resources/static/js/core.js

@@ -204,6 +204,14 @@
             }
         }
     };
+    //扩展 现有的对象 没有的属性扩充上去
+    vc.extendObject = function(org,dst){
+        for(var key in dst){
+            if (!org.hasOwnProperty(key)){
+                dst[key] = org[key]
+            }
+        }
+    };
     //获取url参数
     vc.getParam = function(_key){
         //返回当前 URL 的查询部分(问号 ? 之后的部分)。

+ 18 - 0
java110-bean/src/main/java/com/java110/dto/service/ServiceDto.java

@@ -25,6 +25,8 @@ private String url;
 private String timeout;
 private String isInstance;
 private String name;
+private String serviceName;
+private String serviceUrl;
 private String serviceId;
 private String seq;
 private String appId;
@@ -132,4 +134,20 @@ public void setSeq(String seq) {
     public void setAppId(String appId) {
         this.appId = appId;
     }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public String getServiceUrl() {
+        return serviceUrl;
+    }
+
+    public void setServiceUrl(String serviceUrl) {
+        this.serviceUrl = serviceUrl;
+    }
 }

+ 97 - 41
java110-code-generator/src/main/java/com/java110/code/web/GeneratorManagerComponent.java

@@ -39,61 +39,79 @@ public class GeneratorManagerComponent extends BaseGenerator {
         JSONArray tmpConditions = data.getJSONArray("conditions");
 
         StringBuffer conditionInput = new StringBuffer();
+        StringBuffer vcCreate = new StringBuffer();
 
-        for(int condIndex = 0 ; condIndex <  tmpConditions.size(); condIndex ++){
+        for (int condIndex = 0; condIndex < tmpConditions.size(); condIndex++) {
 
             JSONObject tmpCond = tmpConditions.getJSONObject(condIndex);
 
-            if(condIndex % 3 == 0){
+            if (condIndex % 3 == 0) {
                 conditionInput.append("<div class=\"row\">\n");
             }
 
-            if(condIndex % 3 == 0 || condIndex % 3 == 1) {
-                conditionInput.append("<div class=\"col-sm-4\">\n");
-            }else if(condIndex % 3 == 2){
-                conditionInput.append("<div class=\"col-sm-3\">\n");
+            if (condIndex % 3 == 0 || condIndex % 3 == 1) {
+                conditionInput.append("<div class=\"col-sm-4\" ");
+            } else if (condIndex % 3 == 2) {
+                conditionInput.append("<div class=\"col-sm-3\" ");
             }
-            if("choose".equals(tmpCond.getString("inputType"))){
+
+            if (condIndex > 2) {
+                conditionInput.append("v-if=\"" + data.getString("templateCode") + "ManageInfo.moreCondition == true\">\n");
+            } else {
+                conditionInput.append(">\n");
+            }
+
+            if ("choose".equals(tmpCond.getString("inputType"))) {
                 conditionInput.append("                            <div class=\"form-group input-group\">\n" +
-                        "                                <input type=\"text\" placeholder=\"请选择"+tmpCond.getString("name")+"\" v-model=\""+ data.getString("templateCode")+"ManageInfo."+tmpCond.getString("code")+"\" class=\" form-control\">\n" +
+                        "                                <input type=\"text\" placeholder=\"请选择" + tmpCond.getString("name") +
+                        "\" v-model=\"" + data.getString("templateCode") + "ManageInfo.conditions." + tmpCond.getString("code") + "\" class=\" form-control\">\n" +
                         "                                <div class=\"input-group-prepend\">\n" +
-                        "                                    <button type=\"button\" class=\"btn btn-primary btn-sm\"><i\n" +
+                        "                                    <button type=\"button\" class=\"btn btn-primary btn-sm\" v-on:click=\"_open" + toUpperCaseFirstOne(tmpCond.getString("componentName")) + "Method()\"><i\n" +
                         "                                            class=\"glyphicon glyphicon-search\"></i> 选择\n" +
                         "                                    </button>\n" +
                         "                                </div>\n" +
                         "                            </div>\n");
 
-            }else if("input".equals(tmpCond.getString("inputType"))){
+                if (tmpCond.containsKey("componentName")) {
+                    vcCreate.append("<vc:create name=\"" + tmpCond.getString("componentName") + "\"\n" +
+                            "               emit" + toUpperCaseFirstOne(tmpCond.getString("componentName")) + "=\"" + data.getString("templateCode") + "Manage\"\n" +
+                            "               emitLoadData=\"" + data.getString("templateCode") + "Manage\"\n" +
+                            "    ></vc:create>\n");
+
+                }
+
+            } else if ("input".equals(tmpCond.getString("inputType"))) {
                 conditionInput.append("<div class=\"form-group\">\n" +
-                        "                                <input type=\"text\" placeholder=\"请输入"+tmpCond.getString("name")+"\" v-model=\""+ data.getString("templateCode")+"ManageInfo."+tmpCond.getString("code")+"\" class=\" form-control\">\n" +
+                        "                                <input type=\"text\" placeholder=\"请输入" + tmpCond.getString("name") + "\" v-model=\"" + data.getString("templateCode") + "ManageInfo.conditions." + tmpCond.getString("code") + "\" class=\" form-control\">\n" +
                         "                            </div>");
             }
 
-                conditionInput.append("                        </div>");
-            if(condIndex == 2){
+            conditionInput.append("                        </div>");
+            if (condIndex == 2) {
                 conditionInput.append("<div class=\"col-sm-1\">\n" +
-                        "                            <button type=\"button\" class=\"btn btn-primary btn-sm\"><i\n" +
-                        "                                    class=\"glyphicon glyphicon-search\"></i> 查询\n" +
+                        "                            <button type=\"button\" class=\"btn btn-primary btn-sm\" v-on:click=\"_query" + toUpperCaseFirstOne(data.getString("templateCode")) + "Method()><i\n" +
+                        "                                    class=\"glyphicon glyphicon-search\" \"></i> 查询\n" +
                         "                            </button>\n" +
                         "                        </div>");
-            }else if(condIndex % 3 == 2){
+            } else if (condIndex % 3 == 2) {
                 conditionInput.append("<div class=\"col-sm-1\">\n" +
                         "                        </div>");
 
             }
 
 
-            if(condIndex % 3 == 2 || condIndex == tmpConditions.size() -1){
+            if (condIndex % 3 == 2 || condIndex == tmpConditions.size() - 1) {
                 conditionInput.append("</div>\n");
             }
         }
 
         fileContext = fileContext.replace("@@conditionInput@@", conditionInput.toString());
+        fileContext = fileContext.replace("@@vcCreate@@", vcCreate.toString());
 
-        if(tmpConditions.size() > 3){
-            fileContext = fileContext.replace("@@moreCondition@@","<button type=\"button\"  class=\"btn btn-link btn-sm\" style=\"margin-right:10px;\"  v-on:click=\"_moreCondition()\">更多</button>");
-        }else{
-            fileContext = fileContext.replace("@@moreCondition@@","");
+        if (tmpConditions.size() > 3) {
+            fileContext = fileContext.replace("@@moreCondition@@", "<button type=\"button\"  class=\"btn btn-link btn-sm\" style=\"margin-right:10px;\"  v-on:click=\"_moreCondition()\">更多</button>");
+        } else {
+            fileContext = fileContext.replace("@@moreCondition@@", "");
 
         }
 
@@ -108,25 +126,25 @@ public class GeneratorManagerComponent extends BaseGenerator {
         JSONArray columns = data.getJSONArray("columns");
         for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) {
             JSONObject column = columns.getJSONObject(columnIndex);
-            thSb.append("                            <th class=\"text-center\">" + column.getString("cnCode") + "</th>\n");
-
-            tdSb.append("                            <td class=\"text-center\">{{" + data.getString("templateCode") + "." + column.getString("code") + "}}</td>\n");
+            if (column.getBoolean("show")) {
+                thSb.append("                            <th class=\"text-center\">" + column.getString("cnCode") + "</th>\n");
+                tdSb.append("                            <td class=\"text-center\">{{" + data.getString("templateCode") + "." + column.getString("code") + "}}</td>\n");
+            }
         }
         thSb.append("                            <th class=\"text-center\">操作</th>\n");
         tdSb.append("                            <td class=\"text-center\"><div class=\"btn-group\">\n" +
-                "                                    <button class=\"btn-white btn btn-xs\" v-on:click=\"_openEdit"+toUpperCaseFirstOne(data.getString("templateCode"))+"Model("+data.getString("templateCode")+")\">修改</button>\n" +
+                "                                    <button class=\"btn-white btn btn-xs\" v-on:click=\"_openEdit" + toUpperCaseFirstOne(data.getString("templateCode")) + "Model(" + data.getString("templateCode") + ")\">修改</button>\n" +
                 "                                </div>\n" +
                 "                                <div class=\"btn-group\">\n" +
-                "                                    <button class=\"btn-white btn btn-xs\" v-on:click=\"_openDelete"+toUpperCaseFirstOne(data.getString("templateCode"))+"Model("+data.getString("templateCode")+")\">删除</button>\n" +
+                "                                    <button class=\"btn-white btn btn-xs\" v-on:click=\"_openDelete" + toUpperCaseFirstOne(data.getString("templateCode")) + "Model(" + data.getString("templateCode") + ")\">删除</button>\n" +
                 "                                </div></td>\n");
 
         fileContext = fileContext.replace("@@columnsCnCode@@", thSb.toString())
-                                .replace("@@columnsName@@", tdSb.toString());
-
+                .replace("@@columnsName@@", tdSb.toString());
 
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/web/component/"+data.getString("templateCode")+"Package/"+data.getString("templateCode")+"-manage/"+data.getString("templateCode")+"Manage.html";
+                + "out/web/component/" + data.getString("templateCode") + "Package/" + data.getString("templateCode") + "-manage/" + data.getString("templateCode") + "Manage.html";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
@@ -146,8 +164,43 @@ public class GeneratorManagerComponent extends BaseGenerator {
 
         fileContext = super.replaceTemplateContext(fileContext, data);
 
+        //处理查询条件
+        JSONArray tmpConditions = data.getJSONArray("conditions");
+
+        StringBuffer conditionInput = new StringBuffer();
+
+        StringBuffer conditionMethod = new StringBuffer();
+
+        StringBuffer conditionEvent = new StringBuffer();
+
+        for (int condIndex = 0; condIndex < tmpConditions.size(); condIndex++) {
+
+            JSONObject tmpCond = tmpConditions.getJSONObject(condIndex);
+            conditionInput.append(tmpCond.getString("code") + ":'',\n");
+            if(tmpCond.containsKey("key")){
+                conditionInput.append(tmpCond.getString("key") + ":'',\n");
+            }
+
+            if (tmpCond.containsKey("componentName")) {
+                conditionMethod.append(",\n _open" + toUpperCaseFirstOne(tmpCond.getString("componentName")) + "Method:function(){\n" +
+                        "                vc.emit('" + tmpCond.getString("componentName") + "','open" + toUpperCaseFirstOne(tmpCond.getString("componentName")) + "Model',{});\n" +
+                        "\n" +
+                        "            }"
+                );
+
+                conditionEvent.append("vc.on('" + data.getString("templateCode") + "Manage','" + tmpCond.getString("componentName") + "',function(_param){\n" +
+                        "              vc.copyObject(_param,vc.component." + data.getString("templateCode") + "ManageInfo.conditions);\n" +
+                        "            });\n");
+            }
+
+        }
+
+        fileContext = fileContext.replace("@@conditions@@", conditionInput.toString());
+        fileContext = fileContext.replace("@@extendMethods@@", conditionMethod.toString());
+        fileContext = fileContext.replace("@@extendEvent@@", conditionEvent.toString());
+
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/web/component/"+data.getString("templateCode")+"Package/"+data.getString("templateCode")+"-manage/"+data.getString("templateCode")+"Manage.js";
+                + "out/web/component/" + data.getString("templateCode") + "Package/" + data.getString("templateCode") + "-manage/" + data.getString("templateCode") + "Manage.js";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
@@ -168,7 +221,7 @@ public class GeneratorManagerComponent extends BaseGenerator {
         fileContext = super.replaceTemplateContext(fileContext, data);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/web/component/java/"+data.getString("templateCode")+"/"+toUpperCaseFirstOne(data.getString("templateCode"))+"ManageComponent.java";
+                + "out/web/component/java/" + data.getString("templateCode") + "/" + toUpperCaseFirstOne(data.getString("templateCode")) + "ManageComponent.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
@@ -178,16 +231,17 @@ public class GeneratorManagerComponent extends BaseGenerator {
 
     /**
      * 生成接口类
+     *
      * @param data
      */
-    private void genneratorIListSmo(JSONObject data){
+    private void genneratorIListSmo(JSONObject data) {
         StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/manage/IListSMO.java").getFile());
         String fileContext = sb.toString();
 
         fileContext = super.replaceTemplateContext(fileContext, data);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/web/smo/"+data.getString("templateCode")+"/IList"+toUpperCaseFirstOne(data.getString("templateCode"))+"sSMO.java";
+                + "out/web/smo/" + data.getString("templateCode") + "/IList" + toUpperCaseFirstOne(data.getString("templateCode")) + "sSMO.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
@@ -195,16 +249,17 @@ public class GeneratorManagerComponent extends BaseGenerator {
 
     /**
      * 生成接口类
+     *
      * @param data
      */
-    private void genneratorListSmoImpl(JSONObject data){
+    private void genneratorListSmoImpl(JSONObject data) {
         StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/manage/ListSMOImpl.java").getFile());
         String fileContext = sb.toString();
 
         fileContext = super.replaceTemplateContext(fileContext, data);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/web/smo/"+data.getString("templateCode")+"/impl/List"+toUpperCaseFirstOne(data.getString("templateCode"))+"sSMOImpl.java";
+                + "out/web/smo/" + data.getString("templateCode") + "/impl/List" + toUpperCaseFirstOne(data.getString("templateCode")) + "sSMOImpl.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
@@ -212,35 +267,36 @@ public class GeneratorManagerComponent extends BaseGenerator {
 
     /**
      * 生成API 侦听处理类
+     *
      * @param data
      */
-    private void genneratorListListener(JSONObject data){
+    private void genneratorListListener(JSONObject data) {
         StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/manage/ListListener.java").getFile());
         String fileContext = sb.toString();
 
         fileContext = super.replaceTemplateContext(fileContext, data);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/api/listener/"+data.getString("templateCode")+"/List"+toUpperCaseFirstOne(data.getString("templateCode"))+"sListener.java";
+                + "out/api/listener/" + data.getString("templateCode") + "/List" + toUpperCaseFirstOne(data.getString("templateCode")) + "sListener.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
     }
 
-    private void genneratorVo(JSONObject data){
+    private void genneratorVo(JSONObject data) {
         StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/manage/ApiVo.java").getFile());
         String fileContext = sb.toString();
 
         fileContext = super.replaceTemplateContext(fileContext, data);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/api/vo/"+data.getString("templateCode")+"/Api"+toUpperCaseFirstOne(data.getString("templateCode"))+"Vo.java";
+                + "out/api/vo/" + data.getString("templateCode") + "/Api" + toUpperCaseFirstOne(data.getString("templateCode")) + "Vo.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);
     }
 
-    private void genneratorDataVo(JSONObject data){
+    private void genneratorDataVo(JSONObject data) {
         StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/manage/ApiDataVo.java").getFile());
         String fileContext = sb.toString();
 
@@ -274,7 +330,7 @@ public class GeneratorManagerComponent extends BaseGenerator {
         fileContext = fileContext.replace("@@templateColumns@@", variable + variableGetSet);
 
         String writePath = this.getClass().getResource("/").getPath()
-                +"out/api/vo/"+data.getString("templateCode")+"/Api"+toUpperCaseFirstOne(data.getString("templateCode"))+"DataVo.java";
+                + "out/api/vo/" + data.getString("templateCode") + "/Api" + toUpperCaseFirstOne(data.getString("templateCode")) + "DataVo.java";
         System.out.printf("writePath: " + writePath);
         writeFile(writePath,
                 fileContext);

+ 3 - 0
java110-code-generator/src/main/resources/web/choose/choose.js

@@ -43,6 +43,9 @@
                            );
             },
             choose@@TemplateCode@@:function(_@@templateCode@@){
+                if(_@@templateCode@@.hasOwnProperty('name')){
+                     _@@templateCode@@.@@templateCode@@Name = _@@templateCode@@.name;
+                }
                 vc.emit($props.emitChoose@@TemplateCode@@,'choose@@TemplateCode@@',_@@templateCode@@);
                 vc.emit($props.emitLoadData,'list@@TemplateCode@@Data',{
                     @@templateCode@@Id:_@@templateCode@@.@@templateCode@@Id

+ 3 - 28
java110-code-generator/src/main/resources/web/manage/manage.html

@@ -6,38 +6,11 @@
                     <h5>查询条件</h5>
                     <div class="ibox-tools" style="top:10px;">
                         @@moreCondition@@
-                        <!--<button type="button"  class="btn btn-link btn-sm" style="margin-right:10px;"  v-on:click="_moreCondition()">更多</button>-->
                     </div>
                 </div>
                 <div class="ibox-content">
                     @@conditionInput@@
-                    <!--<div class="row">
-                        <div class="col-sm-4">
-                            <div class="form-group input-group">
-                                <input type="text" placeholder="请选择应用" class=" form-control">
-                                <div class="input-group-prepend">
-                                    <button type="button" class="btn btn-primary btn-sm"><i
-                                            class="glyphicon glyphicon-search"></i> 选择
-                                    </button>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-sm-4">
-                            <div class="form-group">
-                                <input type="text" placeholder="请输入服务名称" class=" form-control">
-                            </div>
-                        </div>
-                        <div class="col-sm-3">
-                            <div class="form-group">
-                                <input type="text" placeholder="请输入服务编码" class=" form-control">
-                            </div>
-                        </div>
-                        <div class="col-sm-1">
-                            <button type="button" class="btn btn-primary btn-sm"><i
-                                    class="glyphicon glyphicon-search"></i> 查询
-                            </button>
-                        </div>
-                    </div>-->
+
                 </div>
             </div>
         </div>
@@ -86,6 +59,8 @@
         </div>
     </div>
 
+    @@vcCreate@@
+
     <vc:create name="add@@TemplateCode@@"
                callBackListener=""
                callBackFunction=""

+ 18 - 8
java110-code-generator/src/main/resources/web/manage/manage.js

@@ -10,13 +10,18 @@
                 @@templateCode@@s:[],
                 total:0,
                 records:1,
-                @@searchCode@@:''
+                moreCondition:false,
+                @@searchCode@@:'',
+                conditions:{
+                    @@conditions@@
+                }
             }
         },
         _initMethod:function(){
             vc.component._list@@TemplateCode@@s(DEFAULT_PAGE, DEFAULT_ROWS);
         },
         _initEvent:function(){
+            @@extendEvent@@
             vc.on('@@templateCode@@Manage','list@@TemplateCode@@',function(_param){
                   vc.component._list@@TemplateCode@@s(DEFAULT_PAGE, DEFAULT_ROWS);
             });
@@ -26,14 +31,13 @@
         },
         methods:{
             _list@@TemplateCode@@s:function(_page, _rows){
+
+                vc.component.@@templateCode@@ManageInfo.conditions.page = _page;
+                vc.component.@@templateCode@@ManageInfo.conditions.row = _rows;
                 var param = {
-                    params:{
-                        page:_page,
-                        row:_rows,
-                        @@searchCode@@:vc.component.@@templateCode@@ManageInfo.@@searchCode@@
-                    }
+                    params:vc.component.@@templateCode@@ManageInfo.conditions
+               };
 
-               }
                //发送get请求
                vc.http.get('@@templateCode@@Manage',
                             'list',
@@ -66,8 +70,14 @@
 
             },
             _moreCondition:function(){
-
+                if(vc.component.@@templateCode@@ManageInfo.moreCondition){
+                    vc.component.@@templateCode@@ManageInfo.moreCondition = false;
+                }else{
+                    vc.component.@@templateCode@@ManageInfo.moreCondition = true;
+                }
             }
+
+             @@extendMethods@@
         }
     });
 })(window.vc);

+ 2 - 2
java110-code-generator/src/main/resources/web/template_1.json

@@ -11,6 +11,7 @@
       "inputType": "choose",
       "componentName": "chooseApp",
       "code": "appName",
+      "key": "appId",
       "whereCondition": "equal"
     },
     {
@@ -178,6 +179,5 @@
       "limitErrInfo":"重试次数必须为数字",
       "show": false
     }
-  ],
-  "sql": ""
+  ]
 }

+ 254 - 233
java110-db/src/main/resources/mapper/service/ServiceServiceDaoImplMapper.xml

@@ -5,272 +5,293 @@
 <mapper namespace="serviceServiceDaoImpl">
 
     <!-- 保存服务信息 add by wuxw 2018-07-03 -->
-       <insert id="saveServiceInfo" parameterType="Map">
-           insert into c_service(
-business_type_cd,method,provide_app_id,service_code,retry_count,messageQueueName,url,timeout,is_instance,name,service_id,seq
-) values (
-#{businessTypeCd},#{method},#{provideAppId},#{serviceCode},#{retryCount},#{messageQueueName},#{url},#{timeout},#{isInstance},#{name},#{serviceId},#{seq}
-)
-       </insert>
-
-
-       <!-- 查询服务信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessServiceInfo" parameterType="Map" resultType="Map">
-           select  t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count retryCount,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance isInstance,t.operate,t.name,t.service_id,t.service_id serviceId,t.seq 
-from business_service t 
-where 1 =1 
-<if test="businessTypeCd !=null and businessTypeCd != ''">
-   and t.business_type_cd= #{businessTypeCd}
-</if> 
-<if test="method !=null and method != ''">
-   and t.method= #{method}
-</if> 
-<if test="provideAppId !=null and provideAppId != ''">
-   and t.provide_app_id= #{provideAppId}
-</if> 
-<if test="serviceCode !=null and serviceCode != ''">
-   and t.service_code= #{serviceCode}
-</if> 
-<if test="retryCount !=null and retryCount != ''">
-   and t.retry_count= #{retryCount}
-</if> 
-<if test="messageQueueName !=null and messageQueueName != ''">
-   and t.messageQueueName= #{messageQueueName}
-</if> 
-<if test="url !=null and url != ''">
-   and t.url= #{url}
-</if> 
-<if test="timeout !=null and timeout != ''">
-   and t.timeout= #{timeout}
-</if> 
-<if test="isInstance !=null and isInstance != ''">
-   and t.is_instance= #{isInstance}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="serviceId !=null and serviceId != ''">
-   and t.service_id= #{serviceId}
-</if> 
-<if test="seq !=null and seq != ''">
-   and t.seq= #{seq}
-</if> 
-
-       </select>
+    <insert id="saveServiceInfo" parameterType="Map">
+        insert into c_service(
+        business_type_cd,method,provide_app_id,service_code,retry_count,messageQueueName,url,timeout,is_instance,name,service_id,seq
+        ) values (
+        #{businessTypeCd},#{method},#{provideAppId},#{serviceCode},#{retryCount},#{messageQueueName},#{url},#{timeout},#{isInstance},#{name},#{serviceId},#{seq}
+        )
+    </insert>
 
 
+    <!-- 查询服务信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessServiceInfo" parameterType="Map" resultType="Map">
+        select t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id
+        provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count
+        retryCount,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance
+        isInstance,t.operate,t.name,t.service_id,t.service_id serviceId,t.seq
+        from business_service t
+        where 1 =1
+        <if test="businessTypeCd !=null and businessTypeCd != ''">
+            and t.business_type_cd= #{businessTypeCd}
+        </if>
+        <if test="method !=null and method != ''">
+            and t.method= #{method}
+        </if>
+        <if test="provideAppId !=null and provideAppId != ''">
+            and t.provide_app_id= #{provideAppId}
+        </if>
+        <if test="serviceCode !=null and serviceCode != ''">
+            and t.service_code= #{serviceCode}
+        </if>
+        <if test="retryCount !=null and retryCount != ''">
+            and t.retry_count= #{retryCount}
+        </if>
+        <if test="messageQueueName !=null and messageQueueName != ''">
+            and t.messageQueueName= #{messageQueueName}
+        </if>
+        <if test="url !=null and url != ''">
+            and t.url= #{url}
+        </if>
+        <if test="timeout !=null and timeout != ''">
+            and t.timeout= #{timeout}
+        </if>
+        <if test="isInstance !=null and isInstance != ''">
+            and t.is_instance= #{isInstance}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="serviceId !=null and serviceId != ''">
+            and t.service_id= #{serviceId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
 
+    </select>
 
 
     <!-- 保存服务信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveServiceInfoInstance" parameterType="Map">
         insert into c_service(
-business_type_cd,method,provide_app_id,service_code,retry_count,status_cd,messageQueueName,url,timeout,is_instance,name,service_id,seq
-) select t.business_type_cd,t.method,t.provide_app_id,t.service_code,t.retry_count,'0',t.messageQueueName,t.url,t.timeout,t.is_instance,t.name,t.service_id,t.seq from business_service t where 1=1
-<if test="businessTypeCd !=null and businessTypeCd != ''">
-   and t.business_type_cd= #{businessTypeCd}
-</if> 
-<if test="method !=null and method != ''">
-   and t.method= #{method}
-</if> 
-<if test="provideAppId !=null and provideAppId != ''">
-   and t.provide_app_id= #{provideAppId}
-</if> 
-<if test="serviceCode !=null and serviceCode != ''">
-   and t.service_code= #{serviceCode}
-</if> 
-<if test="retryCount !=null and retryCount != ''">
-   and t.retry_count= #{retryCount}
-</if> 
-<if test="messageQueueName !=null and messageQueueName != ''">
-   and t.messageQueueName= #{messageQueueName}
-</if> 
-<if test="url !=null and url != ''">
-   and t.url= #{url}
-</if> 
-<if test="timeout !=null and timeout != ''">
-   and t.timeout= #{timeout}
-</if> 
-<if test="isInstance !=null and isInstance != ''">
-   and t.is_instance= #{isInstance}
-</if> 
-   and t.operate= 'ADD'
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="serviceId !=null and serviceId != ''">
-   and t.service_id= #{serviceId}
-</if> 
-<if test="seq !=null and seq != ''">
-   and t.seq= #{seq}
-</if> 
+        business_type_cd,method,provide_app_id,service_code,retry_count,status_cd,messageQueueName,url,timeout,is_instance,name,service_id,seq
+        ) select
+        t.business_type_cd,t.method,t.provide_app_id,t.service_code,t.retry_count,'0',t.messageQueueName,t.url,t.timeout,t.is_instance,t.name,t.service_id,t.seq
+        from business_service t where 1=1
+        <if test="businessTypeCd !=null and businessTypeCd != ''">
+            and t.business_type_cd= #{businessTypeCd}
+        </if>
+        <if test="method !=null and method != ''">
+            and t.method= #{method}
+        </if>
+        <if test="provideAppId !=null and provideAppId != ''">
+            and t.provide_app_id= #{provideAppId}
+        </if>
+        <if test="serviceCode !=null and serviceCode != ''">
+            and t.service_code= #{serviceCode}
+        </if>
+        <if test="retryCount !=null and retryCount != ''">
+            and t.retry_count= #{retryCount}
+        </if>
+        <if test="messageQueueName !=null and messageQueueName != ''">
+            and t.messageQueueName= #{messageQueueName}
+        </if>
+        <if test="url !=null and url != ''">
+            and t.url= #{url}
+        </if>
+        <if test="timeout !=null and timeout != ''">
+            and t.timeout= #{timeout}
+        </if>
+        <if test="isInstance !=null and isInstance != ''">
+            and t.is_instance= #{isInstance}
+        </if>
+        and t.operate= 'ADD'
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="serviceId !=null and serviceId != ''">
+            and t.service_id= #{serviceId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询服务信息 add by wuxw 2018-07-03 -->
     <select id="getServiceInfo" parameterType="Map" resultType="Map">
-        select  t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count retryCount,t.status_cd,t.status_cd statusCd,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance isInstance,t.name,t.service_id,t.service_id serviceId,t.seq 
-from c_service t
+        select t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id
+        provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count
+        retryCount,t.status_cd,t.status_cd statusCd,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance
+        isInstance,t.name,t.service_id,t.service_id serviceId,t.seq
+        from c_service t
         <if test="appId != null and appId != ''">
             , c_route r
+            , c_app p
         </if>
         where 1 =1
         <if test="appId != null and appId != ''">
             and t.service_id = r.service_id
-            and t.status_cd = '0'
-            and t.app_id = #{appId}
-        </if>
-<if test="businessTypeCd !=null and businessTypeCd != ''">
-   and t.business_type_cd= #{businessTypeCd}
-</if> 
-<if test="method !=null and method != ''">
-   and t.method= #{method}
-</if> 
-<if test="provideAppId !=null and provideAppId != ''">
-   and t.provide_app_id= #{provideAppId}
-</if> 
-<if test="serviceCode !=null and serviceCode != ''">
-   and t.service_code= #{serviceCode}
-</if> 
-<if test="retryCount !=null and retryCount != ''">
-   and t.retry_count= #{retryCount}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="messageQueueName !=null and messageQueueName != ''">
-   and t.messageQueueName= #{messageQueueName}
-</if> 
-<if test="url !=null and url != ''">
-   and t.url= #{url}
-</if> 
-<if test="timeout !=null and timeout != ''">
-   and t.timeout= #{timeout}
-</if> 
-<if test="isInstance !=null and isInstance != ''">
-   and t.is_instance= #{isInstance}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="serviceId !=null and serviceId != ''">
-   and t.service_id= #{serviceId}
-</if> 
-<if test="seq !=null and seq != ''">
-   and t.seq= #{seq}
-</if>
+            and r.status_cd = '0'
+            and r.app_id = p.app_id
+            and p.status_cd = '0'
+            and p.app_id = #{appId}
+        </if>
+        <if test="businessTypeCd !=null and businessTypeCd != ''">
+            and t.business_type_cd= #{businessTypeCd}
+        </if>
+        <if test="method !=null and method != ''">
+            and t.method= #{method}
+        </if>
+        <if test="provideAppId !=null and provideAppId != ''">
+            and t.provide_app_id= #{provideAppId}
+        </if>
+        <if test="serviceCode !=null and serviceCode != ''">
+            and t.service_code= #{serviceCode}
+        </if>
+        <if test="retryCount !=null and retryCount != ''">
+            and t.retry_count= #{retryCount}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="messageQueueName !=null and messageQueueName != ''">
+            and t.messageQueueName= #{messageQueueName}
+        </if>
+        <if test="url !=null and url != ''">
+            and t.url= #{url}
+        </if>
+        <if test="serviceUrl !=null and serviceUrl != ''">
+            and t.url like "%"#{serviceUrl}"%"
+        </if>
+        <if test="timeout !=null and timeout != ''">
+            and t.timeout= #{timeout}
+        </if>
+        <if test="isInstance !=null and isInstance != ''">
+            and t.is_instance= #{isInstance}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="serviceName !=null and serviceName != ''">
+            and t.name like "%"#{serviceName}"%"
+        </if>
+        <if test="serviceId !=null and serviceId != ''">
+            and t.service_id= #{serviceId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
         order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改服务信息 add by wuxw 2018-07-03 -->
     <update id="updateServiceInfo" parameterType="Map">
-        update  c_service t set t.status_cd = #{statusCd}
+        update c_service t set t.status_cd = #{statusCd}
 
-<if test="businessTypeCd !=null and businessTypeCd != ''">
-, t.business_type_cd= #{businessTypeCd}
-</if> 
-<if test="method !=null and method != ''">
-, t.method= #{method}
-</if> 
-<if test="provideAppId !=null and provideAppId != ''">
-, t.provide_app_id= #{provideAppId}
-</if> 
-<if test="serviceCode !=null and serviceCode != ''">
-, t.service_code= #{serviceCode}
-</if> 
-<if test="retryCount !=null and retryCount != ''">
-, t.retry_count= #{retryCount}
-</if> 
-<if test="messageQueueName !=null and messageQueueName != ''">
-, t.messageQueueName= #{messageQueueName}
-</if> 
-<if test="url !=null and url != ''">
-, t.url= #{url}
-</if> 
-<if test="timeout !=null and timeout != ''">
-, t.timeout= #{timeout}
-</if> 
-<if test="isInstance !=null and isInstance != ''">
-, t.is_instance= #{isInstance}
-</if> 
-<if test="name !=null and name != ''">
-, t.name= #{name}
-</if> 
-<if test="seq !=null and seq != ''">
-, t.seq= #{seq}
-</if> 
- where 1=1 <if test="serviceId !=null and serviceId != ''">
-and t.service_id= #{serviceId}
-</if> 
+        <if test="businessTypeCd !=null and businessTypeCd != ''">
+            , t.business_type_cd= #{businessTypeCd}
+        </if>
+        <if test="method !=null and method != ''">
+            , t.method= #{method}
+        </if>
+        <if test="provideAppId !=null and provideAppId != ''">
+            , t.provide_app_id= #{provideAppId}
+        </if>
+        <if test="serviceCode !=null and serviceCode != ''">
+            , t.service_code= #{serviceCode}
+        </if>
+        <if test="retryCount !=null and retryCount != ''">
+            , t.retry_count= #{retryCount}
+        </if>
+        <if test="messageQueueName !=null and messageQueueName != ''">
+            , t.messageQueueName= #{messageQueueName}
+        </if>
+        <if test="url !=null and url != ''">
+            , t.url= #{url}
+        </if>
+        <if test="timeout !=null and timeout != ''">
+            , t.timeout= #{timeout}
+        </if>
+        <if test="isInstance !=null and isInstance != ''">
+            , t.is_instance= #{isInstance}
+        </if>
+        <if test="name !=null and name != ''">
+            , t.name= #{name}
+        </if>
+        <if test="seq !=null and seq != ''">
+            , t.seq= #{seq}
+        </if>
+        where 1=1
+        <if test="serviceId !=null and serviceId != ''">
+            and t.service_id= #{serviceId}
+        </if>
 
     </update>
 
     <!-- 查询服务数量 add by wuxw 2018-07-03 -->
-     <select id="queryServicesCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from c_service t
-         <if test="appId != null and appId != ''">
-             , c_route r
-         </if>
-where 1 =1
-         <if test="appId != null and appId != ''">
-             and t.service_id = r.service_id
-             and t.status_cd = '0'
-             and t.app_id = #{appId}
-         </if>
-<if test="businessTypeCd !=null and businessTypeCd != ''">
-   and t.business_type_cd= #{businessTypeCd}
-</if> 
-<if test="method !=null and method != ''">
-   and t.method= #{method}
-</if> 
-<if test="provideAppId !=null and provideAppId != ''">
-   and t.provide_app_id= #{provideAppId}
-</if> 
-<if test="serviceCode !=null and serviceCode != ''">
-   and t.service_code= #{serviceCode}
-</if> 
-<if test="retryCount !=null and retryCount != ''">
-   and t.retry_count= #{retryCount}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="messageQueueName !=null and messageQueueName != ''">
-   and t.messageQueueName= #{messageQueueName}
-</if> 
-<if test="url !=null and url != ''">
-   and t.url= #{url}
-</if> 
-<if test="timeout !=null and timeout != ''">
-   and t.timeout= #{timeout}
-</if> 
-<if test="isInstance !=null and isInstance != ''">
-   and t.is_instance= #{isInstance}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="serviceId !=null and serviceId != ''">
-   and t.service_id= #{serviceId}
-</if> 
-<if test="seq !=null and seq != ''">
-   and t.seq= #{seq}
-</if> 
+    <select id="queryServicesCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from c_service t
+        <if test="appId != null and appId != ''">
+            , c_route r
+            , c_app p
+        </if>
+        where 1 =1
+        <if test="appId != null and appId != ''">
+            and t.service_id = r.service_id
+            and r.status_cd = '0'
+            and r.app_id = p.app_id
+            and p.status_cd = '0'
+            and p.app_id = #{appId}
+        </if>
+        <if test="businessTypeCd !=null and businessTypeCd != ''">
+            and t.business_type_cd= #{businessTypeCd}
+        </if>
+        <if test="method !=null and method != ''">
+            and t.method= #{method}
+        </if>
+        <if test="provideAppId !=null and provideAppId != ''">
+            and t.provide_app_id= #{provideAppId}
+        </if>
+        <if test="serviceCode !=null and serviceCode != ''">
+            and t.service_code= #{serviceCode}
+        </if>
+        <if test="retryCount !=null and retryCount != ''">
+            and t.retry_count= #{retryCount}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="messageQueueName !=null and messageQueueName != ''">
+            and t.messageQueueName= #{messageQueueName}
+        </if>
+        <if test="url !=null and url != ''">
+            and t.url= #{url}
+        </if>
+        <if test="serviceUrl !=null and serviceUrl != ''">
+            and t.url like "%"#{serviceUrl}"%"
+        </if>
+        <if test="timeout !=null and timeout != ''">
+            and t.timeout= #{timeout}
+        </if>
+        <if test="isInstance !=null and isInstance != ''">
+            and t.is_instance= #{isInstance}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="serviceName !=null and serviceName != ''">
+            and t.name like "%"#{serviceName}"%"
+        </if>
+        <if test="serviceId !=null and serviceId != ''">
+            and t.service_id= #{serviceId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>