Browse Source

excel export

Antiloveg 8 years ago
parent
commit
4982ee5477

+ 81 - 122
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -41,11 +41,15 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.PatentAnnualFeeStatus;
+import com.goafanti.common.enums.PatentApplicationFeeStatus;
 import com.goafanti.common.enums.PatentCategoryStatus;
 import com.goafanti.common.enums.PatentCostFields;
+import com.goafanti.common.enums.PatentFundsStatus;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.PatentRegistrationFields;
+import com.goafanti.common.enums.PatentReimbursementStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.OrgRatepay;
@@ -60,6 +64,7 @@ import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 import com.goafanti.patent.bo.InputPatentCost;
 import com.goafanti.patent.bo.InputPatentInfo;
 import com.goafanti.patent.bo.InputPatentRegistration;
@@ -98,6 +103,8 @@ public class AdminPatentApiController extends CertifyApiController {
 	private OrgRatepayService				orgRatepayService;
 	@Resource
 	private OrganizationIdentityService		organizationIdentityService;
+	@Resource
+	private DistrictGlossoryService			districtGlossoryService;
 
 	@Value(value = "${aesSecretKey}")
 	private String							secretKey	= null;
@@ -862,8 +869,6 @@ public class AdminPatentApiController extends CertifyApiController {
 
 	/**
 	 * 专利申请费用管理报表导出
-	 * 
-	 * @throws ParseException
 	 */
 	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/exportApplicationFee", method = RequestMethod.GET)
@@ -919,66 +924,43 @@ public class AdminPatentApiController extends CertifyApiController {
 	// 专利申请费用管理报表
 	private void exportFees(HttpServletResponse response, List<PatentApplicationFeeBo> fees) {
 		String sheetName = "专利申请费用管理报表";
-		HSSFWorkbook workbook = createWorkbook(sheetName, new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利名称", "缴费状态",
-				"申请费", "实审费", "文印费", "是否请款", "是否报销", "申请日", "缴费截止时间" });
+		HSSFWorkbook workbook = createWorkbook(sheetName,
+				new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利名称", "缴费状态", "申请费", "是否请款", "是否报销", "申请日", "缴费截止时间" });
 
 		HSSFSheet sheet = workbook.getSheet(sheetName);
 
 		for (int i = 0; i < fees.size(); i++) {
 			PatentApplicationFeeBo obj = fees.get(i);
 			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
-			if (null == obj.getSerialNumber()) {
-				row.createCell(0).setCellValue("");
-			} else {
-				row.createCell(0).setCellValue(obj.getSerialNumber());
-			}
+			row.createCell(0).setCellValue(null == obj.getSerialNumber() ? "" : obj.getSerialNumber().toString());
 			row.createCell(1).setCellValue(obj.getPatentNumber());
-			row.createCell(2).setCellValue(obj.getLocationProvince());
+			Integer locationProvince = obj.getLocationProvince();
+			row.createCell(2).setCellValue(null == locationProvince ? "" : getProvince(locationProvince));
 			row.createCell(3).setCellValue(obj.getUnitName());
 			row.createCell(4).setCellValue(obj.getPatentName());
-			if (null != obj.getPaymentState()) {
-				switch (obj.getPaymentState()) {
-				case 0:
-					row.createCell(5).setCellValue("未缴费");
-					break;
-				case 1:
-					row.createCell(5).setCellValue("已缴费");
-				}
+			Integer paymentState = obj.getPaymentState();
+			if (null != paymentState && PatentApplicationFeeStatus.PAID.getCode().equals(paymentState)) {
+				row.createCell(5).setCellValue(PatentApplicationFeeStatus.PAID.getDesc());
 			} else {
-				row.createCell(5).setCellValue("未缴费");
+				row.createCell(5).setCellValue(PatentApplicationFeeStatus.UNPAID.getDesc());
 			}
 			row.createCell(6).setCellValue(null == obj.getApplicationFee() ? 0 : obj.getApplicationFee());
-			row.createCell(7).setCellValue(null == obj.getTrialFee() ? 0 : obj.getTrialFee());
-			row.createCell(8).setCellValue(null == obj.getPrintingFee() ? 0 : obj.getPrintingFee());
-
-			if (null != obj.getFunds()) {
-				switch (obj.getFunds()) {
-				case 0:
-					row.createCell(9).setCellValue("否");
-					break;
-				case 1:
-					row.createCell(9).setCellValue("是");
-				}
+			Integer funds = obj.getFunds();
+			if (null != funds && PatentFundsStatus.YES.getCode().equals(funds)) {
+				row.createCell(7).setCellValue(PatentFundsStatus.YES.getDesc());
 			} else {
-				row.createCell(9).setCellValue("否");
+				row.createCell(7).setCellValue(PatentFundsStatus.NO.getDesc());
 			}
-
-			if (null != obj.getReimbursement()) {
-				switch (obj.getReimbursement()) {
-				case 0:
-					row.createCell(10).setCellValue("否");
-					break;
-				case 1:
-					row.createCell(10).setCellValue("是");
-				}
+			Integer reimbursement = obj.getReimbursement();
+			if (null != reimbursement && PatentReimbursementStatus.YES.getCode().equals(reimbursement)) {
+				row.createCell(8).setCellValue(PatentReimbursementStatus.YES.getDesc());
 			} else {
-				row.createCell(10).setCellValue("否");
+				row.createCell(8).setCellValue(PatentReimbursementStatus.NO.getDesc());
 			}
 
-			row.createCell(11).setCellValue(obj.getPatentApplicationDateFormattedDate());
-			row.createCell(12).setCellValue(null == obj.getPatentApplicationDateFormattedDate() ? ""
+			row.createCell(9).setCellValue(obj.getPatentApplicationDateFormattedDate());
+			row.createCell(10).setCellValue(null == obj.getPatentApplicationDateFormattedDate() ? ""
 					: calDeadline(obj.getPatentApplicationDateFormattedDate()));
-
 		}
 		FileUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
 	}
@@ -994,47 +976,38 @@ public class AdminPatentApiController extends CertifyApiController {
 		for (int i = 0; i < pendings.size(); i++) {
 			PatentPendingBo obj = pendings.get(i);
 			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
-			if (null == obj.getSerialNumber()) {
-				row.createCell(0).setCellValue("");
-			} else {
-				row.createCell(0).setCellValue(obj.getSerialNumber());
-			}
+			row.createCell(0).setCellValue(null == obj.getSerialNumber() ? "" : obj.getSerialNumber().toString());
 			row.createCell(1).setCellValue(obj.getPatentNumber());
-			row.createCell(2).setCellValue(obj.getLocationProvince());
+			Integer locationProvince = obj.getLocationProvince();
+			row.createCell(2).setCellValue(null == locationProvince ? "" : getProvince(locationProvince));
 			row.createCell(3).setCellValue(obj.getUnitName());
 			Integer patentCatagory = obj.getPatentCatagory();
 			if (null != patentCatagory) {
-				if (PatentCategoryStatus.OTHER.getCode().equals(patentCatagory)){
+				if (PatentCategoryStatus.OTHER.getCode().equals(patentCatagory)) {
 					row.createCell(4).setCellValue(PatentCategoryStatus.OTHER.getDesc());
-				} else if (PatentCategoryStatus.UTILITY.getCode().equals(patentCatagory)){
+				} else if (PatentCategoryStatus.UTILITY.getCode().equals(patentCatagory)) {
 					row.createCell(4).setCellValue(PatentCategoryStatus.UTILITY.getDesc());
-			    } else if (PatentCategoryStatus.DESIGN.getCode().equals(patentCatagory)){
+				} else if (PatentCategoryStatus.DESIGN.getCode().equals(patentCatagory)) {
 					row.createCell(4).setCellValue(PatentCategoryStatus.DESIGN.getDesc());
-			    } else if (PatentCategoryStatus.INVENTION.getCode().equals(patentCatagory)){
+				} else if (PatentCategoryStatus.INVENTION.getCode().equals(patentCatagory)) {
 					row.createCell(4).setCellValue(PatentCategoryStatus.INVENTION.getDesc());
-			    }
+				}
 			} else {
 				row.createCell(4).setCellValue("");
 			}
 			row.createCell(5).setCellValue(obj.getPatentName());
 			row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
-			if (null != obj.getAnnualFeeState()) {
-				switch (obj.getAnnualFeeState()) {
-				case 0:
-					row.createCell(7).setCellValue("未缴费");
-					break;
-				case 1:
-					row.createCell(7).setCellValue("已缴费");
-					break;
-				}
+			Integer annualFeeState = obj.getAnnualFeeState();
+			if (null != annualFeeState && PatentAnnualFeeStatus.PAID.getCode().equals(annualFeeState)) {
+				row.createCell(7).setCellValue(PatentAnnualFeeStatus.PAID.getDesc());
 			} else {
-				row.createCell(7).setCellValue("未缴费");
+				row.createCell(7).setCellValue(PatentAnnualFeeStatus.UNPAID.getDesc());
 			}
 			row.createCell(8).setCellValue(null == obj.getAuthorizedDateFormattedDate() ? ""
 					: calDeadline(obj.getAuthorizedDateFormattedDate()));
 
 		}
-		
+
 		FileUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
 	}
 
@@ -1048,22 +1021,18 @@ public class AdminPatentApiController extends CertifyApiController {
 		for (int i = 0; i < composites.size(); i++) {
 			PatentManageListBo obj = composites.get(i);// 遍历每个对象
 			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
-			if (null == obj.getSerialNumber()) {
-				row.createCell(0).setCellValue("");
-			} else {
-				row.createCell(0).setCellValue(obj.getSerialNumber());
-			}
+			row.createCell(0).setCellValue(null == obj.getSerialNumber() ? "" : obj.getSerialNumber().toString());
 			row.createCell(1).setCellValue(obj.getPatentNumber());
 			row.createCell(2).setCellValue(obj.getOffice());
-			row.createCell(3).setCellValue(obj.getLocationProvince());
+			Integer locationProvince = obj.getLocationProvince();
+			row.createCell(3).setCellValue(null == locationProvince ? "" : getProvince(locationProvince));
 			row.createCell(4).setCellValue(obj.getUnitName());
 			row.createCell(5).setCellValue(obj.getPatentName());
 			row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
-			row.createCell(7).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
-			row.createCell(8).setCellValue(obj.getCreateTimeFormattedDate());
+			row.createCell(7).setCellValue(obj.getCreateTimeFormattedDate());
+			row.createCell(8).setCellValue(obj.getPatentApplicationFormattedDate());
 			row.createCell(9).setCellValue(obj.getPatentApplicationFormattedDate());
-			row.createCell(10).setCellValue(obj.getPatentApplicationFormattedDate());
-			row.createCell(11).setCellValue(obj.getAuthor());
+			row.createCell(10).setCellValue(obj.getAuthor());
 		}
 		FileUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
 
@@ -1170,52 +1139,38 @@ public class AdminPatentApiController extends CertifyApiController {
 	// 专利状态
 	private String switchPatState(Integer s) {
 		String state = "";
-		switch (s) {
-		case 0:
-			state = "申请";
-			break;
-		case 1:
-			state = "签单";
-			break;
-		case 2:
-			state = "派单";
-			break;
-		case 3:
-			state = "流转";
-			break;
-		case 4:
-			state = "撰写";
-			break;
-		case 5:
-			state = "受理";
-			break;
-		case 6:
-			state = "审查意见通知";
-			break;
-		case 7:
-			state = "审查意见已答复";
-			break;
-		case 8:
-			state = "补正通知";
-			break;
-		case 9:
-			state = "补正已答复";
-			break;
-		case 10:
-			state = "授权";
-			break;
-		case 11:
-			state = "驳回";
-			break;
-		case 12:
-			state = "发证";
-			break;
-		case 13:
-			state = "已结款";
-			break;
-		case 14:
-			state = "退单";
-			break;
+		if (PatentInfoStatus.CREATE.getCode().equals(s)) {
+			state = PatentInfoStatus.CREATE.getDesc();
+		} else if (PatentInfoStatus.SIGN.getCode().equals(s)) {
+			state = PatentInfoStatus.SIGN.getDesc();
+		} else if (PatentInfoStatus.DELIVERD.getCode().equals(s)) {
+			state = PatentInfoStatus.DELIVERD.getDesc();
+		} else if (PatentInfoStatus.CIRCULATION.getCode().equals(s)) {
+			state = PatentInfoStatus.CIRCULATION.getDesc();
+		} else if (PatentInfoStatus.COMPOSE.getCode().equals(s)) {
+			state = PatentInfoStatus.COMPOSE.getDesc();
+		} else if (PatentInfoStatus.ACCEPT.getCode().equals(s)) {
+			state = PatentInfoStatus.ACCEPT.getDesc();
+		} else if (PatentInfoStatus.REVIEWNOTICE.getCode().equals(s)) {
+			state = PatentInfoStatus.REVIEWNOTICE.getDesc();
+		} else if (PatentInfoStatus.REVIEWREPLY.getCode().equals(s)) {
+			state = PatentInfoStatus.REVIEWREPLY.getDesc();
+		} else if (PatentInfoStatus.CORRECTIONNOTICE.getCode().equals(s)) {
+			state = PatentInfoStatus.CORRECTIONNOTICE.getDesc();
+		} else if (PatentInfoStatus.CORRECTIONREPLY.getCode().equals(s)) {
+			state = PatentInfoStatus.CORRECTIONREPLY.getDesc();
+		} else if (PatentInfoStatus.AUTHORIZE.getCode().equals(s)) {
+			state = PatentInfoStatus.AUTHORIZE.getDesc();
+		} else if (PatentInfoStatus.REJECT.getCode().equals(s)) {
+			state = PatentInfoStatus.REJECT.getDesc();
+		} else if (PatentInfoStatus.LICENSE.getCode().equals(s)) {
+			state = PatentInfoStatus.LICENSE.getDesc();
+		} else if (PatentInfoStatus.SETTLEMENT.getCode().equals(s)) {
+			state = PatentInfoStatus.SETTLEMENT.getDesc();
+		} else if (PatentInfoStatus.CREATE.getCode().equals(s)) {
+			state = PatentInfoStatus.CREATE.getDesc();
+		} else if (PatentInfoStatus.CALLBACK.getCode().equals(s)) {
+			state = PatentInfoStatus.CALLBACK.getDesc();
 		}
 		return state;
 	}
@@ -1296,5 +1251,9 @@ public class AdminPatentApiController extends CertifyApiController {
 		}
 		return status;
 	}
+	
+	private String getProvince(Integer province){
+		return districtGlossoryService.selectByPrimaryKey(province).getName();
+	}
 
 }

+ 17 - 0
src/main/java/com/goafanti/common/dao/DistrictGlossoryMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.DistrictGlossory;
+
+public interface DistrictGlossoryMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(DistrictGlossory record);
+
+    int insertSelective(DistrictGlossory record);
+
+    DistrictGlossory selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(DistrictGlossory record);
+
+    int updateByPrimaryKey(DistrictGlossory record);
+}

+ 56 - 0
src/main/java/com/goafanti/common/enums/PatentApplicationFeeStatus.java

@@ -0,0 +1,56 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentApplicationFeeStatus {
+	
+	UNPAID(0, "未缴申请费"),
+	PAID(1, "已缴申请费"),
+	OTHER(2, "其他");
+
+	private PatentApplicationFeeStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentApplicationFeeStatus> status = new HashMap<Integer, PatentApplicationFeeStatus>();
+
+	static {
+		for (PatentApplicationFeeStatus value : PatentApplicationFeeStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentApplicationFeeStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentApplicationFeeStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 56 - 0
src/main/java/com/goafanti/common/enums/PatentFundsStatus.java

@@ -0,0 +1,56 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentFundsStatus {
+	
+	NO(0, "未请款"),
+	YES(1, "已请款"),
+	OTHER(2, "其他");
+
+	private PatentFundsStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentFundsStatus> status = new HashMap<Integer, PatentFundsStatus>();
+
+	static {
+		for (PatentFundsStatus value : PatentFundsStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentFundsStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentFundsStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 56 - 0
src/main/java/com/goafanti/common/enums/PatentReimbursementStatus.java

@@ -0,0 +1,56 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentReimbursementStatus {
+	
+	NO(0, "未报销"),
+	YES(1, "已报销"),
+	OTHER(2, "其他");
+
+	private PatentReimbursementStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentReimbursementStatus> status = new HashMap<Integer, PatentReimbursementStatus>();
+
+	static {
+		for (PatentReimbursementStatus value : PatentReimbursementStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentReimbursementStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentReimbursementStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 82 - 0
src/main/java/com/goafanti/common/mapper/DistrictGlossoryMapper.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.DistrictGlossoryMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DistrictGlossory" >
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="name" property="name" jdbcType="VARCHAR" />
+    <result column="pid" property="pid" jdbcType="INTEGER" />
+    <result column="level" property="level" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, name, pid, level
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from district_glossory
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from district_glossory
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.DistrictGlossory" >
+    insert into district_glossory (id, name, pid, 
+      level)
+    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=INTEGER}, 
+      #{level,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.DistrictGlossory" >
+    insert into district_glossory
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="name != null" >
+        name,
+      </if>
+      <if test="pid != null" >
+        pid,
+      </if>
+      <if test="level != null" >
+        level,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="name != null" >
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null" >
+        #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="level != null" >
+        #{level,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DistrictGlossory" >
+    update district_glossory
+    <set >
+      <if test="name != null" >
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null" >
+        pid = #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="level != null" >
+        level = #{level,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DistrictGlossory" >
+    update district_glossory
+    set name = #{name,jdbcType=VARCHAR},
+      pid = #{pid,jdbcType=INTEGER},
+      level = #{level,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 52 - 0
src/main/java/com/goafanti/common/model/DistrictGlossory.java

@@ -0,0 +1,52 @@
+package com.goafanti.common.model;
+
+public class DistrictGlossory {
+    private Integer id;
+
+    /**
+    * 名称
+    */
+    private String name;
+
+    /**
+    * 上级ID
+    */
+    private Integer pid;
+
+    /**
+    * 层级
+    */
+    private Integer level;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getPid() {
+        return pid;
+    }
+
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+}

+ 9 - 0
src/main/java/com/goafanti/dataGlossory/service/DistrictGlossoryService.java

@@ -0,0 +1,9 @@
+package com.goafanti.dataGlossory.service;
+
+import com.goafanti.common.model.DistrictGlossory;
+
+public interface DistrictGlossoryService {
+
+	DistrictGlossory selectByPrimaryKey(Integer province);
+
+}

+ 18 - 0
src/main/java/com/goafanti/dataGlossory/service/impl/DistrictGlossoryServiceImpl.java

@@ -0,0 +1,18 @@
+package com.goafanti.dataGlossory.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.DistrictGlossoryMapper;
+import com.goafanti.common.model.DistrictGlossory;
+import com.goafanti.dataGlossory.service.DistrictGlossoryService;
+@Service
+public class DistrictGlossoryServiceImpl implements DistrictGlossoryService {
+	@Autowired
+	private DistrictGlossoryMapper districtGlossoryMapper;
+
+	@Override
+	public DistrictGlossory selectByPrimaryKey(Integer id) {
+		return districtGlossoryMapper.selectByPrimaryKey(id);
+	}
+}