yonge 5 years ago
parent
commit
f69016677b

+ 79 - 45
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CooperationOrgan.java

@@ -1,43 +1,69 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
+import com.ym.mec.common.enums.BaseEnum;
+
 /**
 /**
  * 对应数据库表(cooperation_organ):
  * 对应数据库表(cooperation_organ):
  */
  */
 public class CooperationOrgan {
 public class CooperationOrgan {
 
 
+	public enum OwnershipType implements BaseEnum<String, OwnershipType> {
+
+		OWN("自有"), COOPERATION("合作"), LEASE("租赁"), ;
+
+		private String desc;
+
+		private OwnershipType(String desc) {
+			this.desc = desc;
+		}
+
+		@Override
+		public String getCode() {
+			return name();
+		}
+
+		public String getDesc() {
+			return desc;
+		}
+	}
+
 	/**  */
 	/**  */
 	private Integer id;
 	private Integer id;
-	
+
 	/** 单位名称 */
 	/** 单位名称 */
-	@ApiModelProperty(value = "班级编号",required = false)
+	@ApiModelProperty(value = "班级编号", required = false)
 	private String name;
 	private String name;
 
 
 	/** 分部编号 */
 	/** 分部编号 */
-	@ApiModelProperty(value = "分部编号",required = false)
+	@ApiModelProperty(value = "分部编号", required = false)
 	private Integer organId;
 	private Integer organId;
-	
+
 	/** 联系人 */
 	/** 联系人 */
-	@ApiModelProperty(value = "班级编号",required = false)
+	@ApiModelProperty(value = "联系人", required = false)
 	private String linkman;
 	private String linkman;
-	
+
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "班级编号",required = false)
+	@ApiModelProperty(value = "职位", required = false)
 	private String job;
 	private String job;
-	
+
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "班级编号",required = false)
+	@ApiModelProperty(value = "手机号码", required = false)
 	private String mobileNo;
 	private String mobileNo;
-	
+
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "班级编号",required = false)
+	@ApiModelProperty(value = "地址", required = false)
 	private String address;
 	private String address;
-	
+
+	@ApiModelProperty(value = "权属类型(OWN('自有'),COOPERATION('合作'),LEASE('租赁'))", required = false)
+	private OwnershipType ownershipType;
+
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
-	
+
 	/**  */
 	/**  */
 	private java.util.Date updateTime;
 	private java.util.Date updateTime;
 
 
@@ -49,70 +75,78 @@ public class CooperationOrgan {
 		this.organId = organId;
 		this.organId = organId;
 	}
 	}
 
 
-	public void setId(Integer id){
+	public void setId(Integer id) {
 		this.id = id;
 		this.id = id;
 	}
 	}
-	
-	public Integer getId(){
+
+	public Integer getId() {
 		return this.id;
 		return this.id;
 	}
 	}
-			
-	public void setName(String name){
+
+	public void setName(String name) {
 		this.name = name;
 		this.name = name;
 	}
 	}
-	
-	public String getName(){
+
+	public String getName() {
 		return this.name;
 		return this.name;
 	}
 	}
-			
-	public void setLinkman(String linkman){
+
+	public void setLinkman(String linkman) {
 		this.linkman = linkman;
 		this.linkman = linkman;
 	}
 	}
-	
-	public String getLinkman(){
+
+	public String getLinkman() {
 		return this.linkman;
 		return this.linkman;
 	}
 	}
-			
-	public void setJob(String job){
+
+	public void setJob(String job) {
 		this.job = job;
 		this.job = job;
 	}
 	}
-	
-	public String getJob(){
+
+	public String getJob() {
 		return this.job;
 		return this.job;
 	}
 	}
-			
-	public void setMobileNo(String mobileNo){
+
+	public void setMobileNo(String mobileNo) {
 		this.mobileNo = mobileNo;
 		this.mobileNo = mobileNo;
 	}
 	}
-	
-	public String getMobileNo(){
+
+	public String getMobileNo() {
 		return this.mobileNo;
 		return this.mobileNo;
 	}
 	}
-			
-	public void setAddress(String address){
+
+	public void setAddress(String address) {
 		this.address = address;
 		this.address = address;
 	}
 	}
-	
-	public String getAddress(){
+
+	public String getAddress() {
 		return this.address;
 		return this.address;
 	}
 	}
-			
-	public void setCreateTime(java.util.Date createTime){
+
+	public void setCreateTime(java.util.Date createTime) {
 		this.createTime = createTime;
 		this.createTime = createTime;
 	}
 	}
-	
-	public java.util.Date getCreateTime(){
+
+	public java.util.Date getCreateTime() {
 		return this.createTime;
 		return this.createTime;
 	}
 	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
+
+	public void setUpdateTime(java.util.Date updateTime) {
 		this.updateTime = updateTime;
 		this.updateTime = updateTime;
 	}
 	}
-	
-	public java.util.Date getUpdateTime(){
+
+	public java.util.Date getUpdateTime() {
 		return this.updateTime;
 		return this.updateTime;
 	}
 	}
-			
+
+	public OwnershipType getOwnershipType() {
+		return ownershipType;
+	}
+
+	public void setOwnershipType(OwnershipType ownershipType) {
+		this.ownershipType = ownershipType;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 2 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CooperationOrganServiceImpl.java

@@ -1,17 +1,16 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.ym.mec.biz.dal.dao.CooperationOrganDao;
 import com.ym.mec.biz.dal.dao.CooperationOrganDao;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 
-import java.util.List;
-
 @Service
 @Service
 public class CooperationOrganServiceImpl extends BaseServiceImpl<Integer, CooperationOrgan>  implements CooperationOrganService {
 public class CooperationOrganServiceImpl extends BaseServiceImpl<Integer, CooperationOrgan>  implements CooperationOrganService {
 	
 	

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml

@@ -12,6 +12,7 @@
         <result column="job_" property="job"/>
         <result column="job_" property="job"/>
         <result column="mobile_no_" property="mobileNo"/>
         <result column="mobile_no_" property="mobileNo"/>
         <result column="address_" property="address"/>
         <result column="address_" property="address"/>
+        <result column="ownership_type_" property="ownershipType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="create_time_" property="createTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="update_time_" property="updateTime"/>
     </resultMap>
     </resultMap>
@@ -34,8 +35,8 @@
         <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
         <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
             AS ID FROM DUAL </selectKey> -->
             AS ID FROM DUAL </selectKey> -->
         INSERT INTO cooperation_organ
         INSERT INTO cooperation_organ
-        (id_,name_,linkman_,job_,mobile_no_,address_,organ_id_,create_time_,update_time_)
-        VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{organId},now(),now())
+        (id_,name_,linkman_,job_,mobile_no_,address_,organ_id_,create_time_,update_time_,ownership_type_)
+        VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{organId},now(),now(),#{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
     </insert>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
@@ -60,6 +61,9 @@
             <if test="name != null">
             <if test="name != null">
                 name_ = #{name},
                 name_ = #{name},
             </if>
             </if>
+            <if test="ownershipType != null">
+                ownership_type_ = #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
             <if test="organId != null">
             <if test="organId != null">
                 organ_id_ = #{organId},
                 organ_id_ = #{organId},
             </if>
             </if>