java110 лет назад: 4
Родитель
Сommit
787337cff4

+ 32 - 13
java110-bean/src/main/java/com/java110/dto/reportCustom/ReportCustomDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.reportCustom;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,10 +16,11 @@ import java.util.Date;
 public class ReportCustomDto extends PageDto implements Serializable {
 
     private String groupId;
-private String remark;
-private String title;
-private String customId;
-private String seq;
+    private String remark;
+    private String title;
+    private String customId;
+    private String seq;
+    private String groupName;
 
 
     private Date createTime;
@@ -29,31 +31,40 @@ private String seq;
     public String getGroupId() {
         return groupId;
     }
-public void setGroupId(String groupId) {
+
+    public void setGroupId(String groupId) {
         this.groupId = groupId;
     }
-public String getRemark() {
+
+    public String getRemark() {
         return remark;
     }
-public void setRemark(String remark) {
+
+    public void setRemark(String remark) {
         this.remark = remark;
     }
-public String getTitle() {
+
+    public String getTitle() {
         return title;
     }
-public void setTitle(String title) {
+
+    public void setTitle(String title) {
         this.title = title;
     }
-public String getCustomId() {
+
+    public String getCustomId() {
         return customId;
     }
-public void setCustomId(String customId) {
+
+    public void setCustomId(String customId) {
         this.customId = customId;
     }
-public String getSeq() {
+
+    public String getSeq() {
         return seq;
     }
-public void setSeq(String seq) {
+
+    public void setSeq(String seq) {
         this.seq = seq;
     }
 
@@ -73,4 +84,12 @@ public void setSeq(String seq) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
 }

+ 74 - 77
java110-db/src/main/resources/mapper/report/ReportCustomV1ServiceDaoImplMapper.xml

@@ -5,102 +5,99 @@
 <mapper namespace="reportCustomV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存报表组件信息 add by wuxw 2018-07-03 -->
     <insert id="saveReportCustomInfo" parameterType="Map">
         insert into report_custom(
-group_id,remark,title,custom_id,seq
-) values (
-#{groupId},#{remark},#{title},#{customId},#{seq}
-)
+        group_id,remark,title,custom_id,seq
+        ) values (
+        #{groupId},#{remark},#{title},#{customId},#{seq}
+        )
     </insert>
 
 
-
     <!-- 查询报表组件信息 add by wuxw 2018-07-03 -->
     <select id="getReportCustomInfo" parameterType="Map" resultType="Map">
-        select  t.group_id,t.group_id groupId,t.remark,t.status_cd,t.status_cd statusCd,t.title,t.custom_id,t.custom_id customId,t.seq 
-from report_custom t 
-where 1 =1 
-<if test="groupId !=null and groupId != ''">
-   and t.group_id= #{groupId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="title !=null and title != ''">
-   and t.title= #{title}
-</if> 
-<if test="customId !=null and customId != ''">
-   and t.custom_id= #{customId}
-</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> 
+        select t.group_id,t.group_id groupId,t.remark,t.status_cd,t.status_cd statusCd,t.title,t.custom_id,t.custom_id
+        customId,t.seq,cg.`name` groupName
+        from report_custom t
+        left join report_custom_group cg on t.group_id = cg.group_id and cg.status_cd = '0'
+        where 1 =1
+        <if test="groupId !=null and groupId != ''">
+            and t.group_id= #{groupId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="title !=null and title != ''">
+            and t.title= #{title}
+        </if>
+        <if test="customId !=null and customId != ''">
+            and t.custom_id= #{customId}
+        </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>
 
     </select>
 
 
-
-
     <!-- 修改报表组件信息 add by wuxw 2018-07-03 -->
     <update id="updateReportCustomInfo" parameterType="Map">
-        update  report_custom t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="groupId !=null and groupId != ''">
-, t.group_id= #{groupId}
-</if> 
-<if test="remark !=null and remark != ''">
-, t.remark= #{remark}
-</if> 
-<if test="title !=null and title != ''">
-, t.title= #{title}
-</if> 
-<if test="seq !=null and seq != ''">
-, t.seq= #{seq}
-</if> 
- where 1=1 <if test="customId !=null and customId != ''">
-and t.custom_id= #{customId}
-</if> 
+        update report_custom t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="groupId !=null and groupId != ''">
+            , t.group_id= #{groupId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
+        <if test="title !=null and title != ''">
+            , t.title= #{title}
+        </if>
+        <if test="seq !=null and seq != ''">
+            , t.seq= #{seq}
+        </if>
+        where 1=1
+        <if test="customId !=null and customId != ''">
+            and t.custom_id= #{customId}
+        </if>
 
     </update>
 
     <!-- 查询报表组件数量 add by wuxw 2018-07-03 -->
-     <select id="queryReportCustomsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from report_custom t 
-where 1 =1 
-<if test="groupId !=null and groupId != ''">
-   and t.group_id= #{groupId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="title !=null and title != ''">
-   and t.title= #{title}
-</if> 
-<if test="customId !=null and customId != ''">
-   and t.custom_id= #{customId}
-</if> 
-<if test="seq !=null and seq != ''">
-   and t.seq= #{seq}
-</if> 
+    <select id="queryReportCustomsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from report_custom t
+        where 1 =1
+        <if test="groupId !=null and groupId != ''">
+            and t.group_id= #{groupId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="title !=null and title != ''">
+            and t.title= #{title}
+        </if>
+        <if test="customId !=null and customId != ''">
+            and t.custom_id= #{customId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 11 - 10
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java

@@ -7,22 +7,23 @@ import com.java110.utils.util.StringUtil;
 public class TableToJsonWeb {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `report_custom_group` (\n" +
-            "  `group_id` varchar(30) NOT NULL COMMENT '组ID',\n" +
-            "  `name` varchar(128) NOT NULL COMMENT '组名称',\n" +
-            "  `url` varchar(512) NOT NULL COMMENT '组url',\n" +
+    public static final String createTableSql = "CREATE TABLE `report_custom` (\n" +
+            "  `custom_id` varchar(30) NOT NULL COMMENT '报表编号',\n" +
+            "  `group_id` varchar(30) NOT NULL COMMENT '组编号',\n" +
+            "  `title` varchar(64) NOT NULL COMMENT '选项标题',\n" +
+            "  `seq` int(11) NOT NULL COMMENT '排序',\n" +
             "  `remark` varchar(512) DEFAULT NULL COMMENT '描述',\n" +
             "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
             "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" +
             ")";
 
     public static void main(String[] args) {
-        String templateName = "报表"; //业务名称
-        String templateCode = "reportCustomGroup"; //表名大写
-        String templateKey = "groupId"; //表主键
-        String templateKeyName = "ID";//主键说明
-        String searchCode = "groupId"; //分片字段
-        String searchName = "ID"; //分片字段说明
+        String templateName = "报表"; //业务名称
+        String templateCode = "reportCustom"; //表名大写
+        String templateKey = "customId"; //表主键
+        String templateKeyName = "报表ID";//主键说明
+        String searchCode = "customId"; //分片字段
+        String searchName = "报表ID"; //分片字段说明
         String directories = "dev"; //前端生成到那个目录下
 
         // templateName 业务名称 业务编码名称生成后文件名 templateCode 主键 templateKey

+ 47 - 23
java110-generator/src/main/resources/web/template_1.json

@@ -1,30 +1,54 @@
 {
-  "templateKeyName": "ID",
-  "templateName": "报表",
+  "templateKeyName": "报表ID",
+  "templateName": "报表",
   "columns": [
     {
       "hasDefaultValue": false,
-      "limitParam": "128",
-      "code": "name",
-      "limitErrInfo": "组名称不能超过128",
-      "cnCode": "组名称",
+      "limitParam": "30",
+      "code": "customId",
+      "limitErrInfo": "报表编号不能超过30",
+      "cnCode": "报表编号",
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
       "required": true,
-      "desc": "必填,组名称"
+      "desc": "必填,报表编号"
     },
     {
       "hasDefaultValue": false,
-      "limitParam": "512",
-      "code": "url",
-      "limitErrInfo": "组url不能超过512",
-      "cnCode": "组url",
+      "limitParam": "30",
+      "code": "groupId",
+      "limitErrInfo": "组编号不能超过30",
+      "cnCode": "组编号",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,组编号"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "64",
+      "code": "title",
+      "limitErrInfo": "选项标题不能超过64",
+      "cnCode": "选项标题",
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
       "required": true,
-      "desc": "必填,组url"
+      "desc": "必填,选项标题"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "11",
+      "code": "seq",
+      "limitErrInfo": "排序不能超过11",
+      "cnCode": "排序",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,排序"
     },
     {
       "hasDefaultValue": false,
@@ -35,33 +59,33 @@
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
-      "required": true,
+      "required": false,
       "desc": "描述"
     }
   ],
-  "searchName": "ID",
+  "searchName": "报表ID",
   "directories": "dev",
-  "searchCode": "groupId",
-  "templateCode": "reportCustomGroup",
+  "searchCode": "customId",
+  "templateCode": "reportCustom",
   "conditions": [
     {
       "whereCondition": "equal",
-      "code": "groupId",
-      "name": "组ID",
+      "code": "customId",
+      "name": "报表编号",
       "inputType": "input"
     },
     {
       "whereCondition": "equal",
-      "code": "name",
-      "name": "组名称",
+      "code": "groupId",
+      "name": "组编号",
       "inputType": "input"
     },
     {
       "whereCondition": "equal",
-      "code": "url",
-      "name": "组url",
+      "code": "title",
+      "name": "选项标题",
       "inputType": "input"
     }
   ],
-  "templateKey": "groupId"
+  "templateKey": "customId"
 }