瀏覽代碼

Merge branch 'master' of https://gitee.com/zouxuan/mec

zouxuan 5 年之前
父節點
當前提交
01a0d0f495

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/MusicGroupPaymentEntitiesDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.web.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
+
+public interface MusicGroupPaymentEntitiesDao extends BaseDAO<Integer, MusicGroupPaymentEntities> {
+
+	
+}

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/MusicGroup.java

@@ -1,7 +1,10 @@
 package com.ym.mec.web.dal.entity;
 
 import com.ym.mec.web.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.web.dal.enums.PaymentMethod;
+
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -76,6 +79,9 @@ public class MusicGroup {
 	@ApiModelProperty(value = "招生年级(多个用|分开)",required = false)
 	private String enrollClasses;
 	
+	/** 付费方式(一次性、按月、按学期、按学年) */
+	private PaymentMethod paymentMethod;
+	
 	public void setId(String id){
 		this.id = id;
 	}
@@ -220,6 +226,14 @@ public class MusicGroup {
 		this.enrollClasses = enrollClasses;
 	}
 
+	public PaymentMethod getPaymentMethod() {
+		return paymentMethod;
+	}
+
+	public void setPaymentMethod(PaymentMethod paymentMethod) {
+		this.paymentMethod = paymentMethod;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 105 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/MusicGroupPaymentEntities.java

@@ -0,0 +1,105 @@
+package com.ym.mec.web.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.web.dal.enums.PaymentMethod;
+
+/**
+ * 对应数据库表(music_group_payment_entities):
+ */
+public class MusicGroupPaymentEntities {
+
+	/**  */
+	private Integer id;
+	
+	/** 乐团编号 */
+	private String musicGroupId;
+	
+	/** 主体名称 */
+	private String name;
+	
+	/** 付费方式(一次性、按月、按学期、按学年) */
+	private PaymentMethod paymentMethod;
+	
+	/** 金额 */
+	private long amount;
+	
+	/** 备注 */
+	private String memo;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setMusicGroupId(String musicGroupId){
+		this.musicGroupId = musicGroupId;
+	}
+	
+	public String getMusicGroupId(){
+		return this.musicGroupId;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setPaymentMethod(PaymentMethod paymentMethod){
+		this.paymentMethod = paymentMethod;
+	}
+	
+	public PaymentMethod getPaymentMethod(){
+		return this.paymentMethod;
+	}
+			
+	public void setAmount(long amount){
+		this.amount = amount;
+	}
+	
+	public long getAmount(){
+		return this.amount;
+	}
+			
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 26 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/PaymentMethod.java

@@ -0,0 +1,26 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum PaymentMethod implements BaseEnum<String, PaymentMethod> {
+	ONE_OFF("ONE_OFF", "一次性"), MONTHLY("MONTHLY", "按月"), TERM("TERM", "学期"), YEAR("YEAR", "按年");
+
+	private String code;
+
+	private String desc;
+
+	private PaymentMethod(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	@Override
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/MusicGroupPaymentEntitiesService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.web.service;
+
+import com.ym.mec.common.service.BaseService;
+import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
+
+public interface MusicGroupPaymentEntitiesService extends BaseService<Integer, MusicGroupPaymentEntities> {
+
+}

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/MusicGroupPaymentEntitiesServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.web.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.MusicGroupPaymentEntitiesDao;
+import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
+import com.ym.mec.web.service.MusicGroupPaymentEntitiesService;
+
+@Service
+public class MusicGroupPaymentEntitiesServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentEntities>  implements MusicGroupPaymentEntitiesService {
+	
+	@Autowired
+	private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
+
+	@Override
+	public BaseDAO<Integer, MusicGroupPaymentEntities> getDAO() {
+		return musicGroupPaymentEntitiesDao;
+	}
+	
+}

+ 6 - 2
mec-web/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -24,6 +24,7 @@
         <result column="bill_start_date_" property="billStartDate"/>
         <result column="improvent_classes_num_" property="improventClassesNum"/>
         <result column="enroll_classes_" property="enrollClasses"/>
+		<result column="payment_method_" property="paymentMethod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -45,8 +46,8 @@
         </selectKey>
         -->
         INSERT INTO music_group
-        (id_,name_,organ_id_,school_id_,apply_expire_date_,improvent_classes_num_,enroll_classes_,team_teacher_id_,educational_teacher_id_,charge_type_id_,course_group_id_,class_period_,free_class_period_,create_time_,update_time_,status_,payment_expire_date_,bill_start_date_)
-        VALUES(#{id},#{name},#{organId},#{schoolId},#{applyExpireDate},#{improventClassesNum},#{enrollClasses},#{teamTeacherId},#{educationalTeacherId},#{chargeTypeId},#{courseGroupId},#{classPeriod},#{freeClassPeriod},#{createTime},#{updateTime},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{paymentExpireDate},#{billStartDate})
+        (id_,name_,organ_id_,school_id_,apply_expire_date_,improvent_classes_num_,enroll_classes_,team_teacher_id_,educational_teacher_id_,charge_type_id_,course_group_id_,class_period_,free_class_period_,create_time_,update_time_,status_,payment_expire_date_,bill_start_date_,payment_method_)
+        VALUES(#{id},#{name},#{organId},#{schoolId},#{applyExpireDate},#{improventClassesNum},#{enrollClasses},#{teamTeacherId},#{educationalTeacherId},#{chargeTypeId},#{courseGroupId},#{classPeriod},#{freeClassPeriod},#{createTime},#{updateTime},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{paymentExpireDate},#{billStartDate},#{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -101,6 +102,9 @@
             <if test="teamTeacherId != null">
                 team_teacher_id_ = #{teamTeacherId},
             </if>
+			<if test="paymentMethod != null">
+				payment_method_ = #{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
         </set>
         WHERE id_ = #{id}
     </update>

+ 86 - 0
mec-web/src/main/resources/config/mybatis/MusicGroupPaymentEntitiesMapper.xml

@@ -0,0 +1,86 @@
+<?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.ym.mec.web.dal.dao.MusicGroupPaymentEntitiesDao">
+	
+	<resultMap type="com.ym.mec.web.dal.entity.MusicGroupPaymentEntities" id="MusicGroupPaymentEntities">
+		<result column="id_" property="id" />
+		<result column="music_group_id_" property="musicGroupId" />
+		<result column="name_" property="name" />
+		<result column="payment_method_" property="paymentMethod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
+		<result column="amount_" property="amount" />
+		<result column="memo_" property="memo" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="MusicGroupPaymentEntities" >
+		SELECT * FROM music_group_payment_entities WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="MusicGroupPaymentEntities">
+		SELECT * FROM music_group_payment_entities ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.MusicGroupPaymentEntities" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO music_group_payment_entities (id_,music_group_id_,name_,payment_method_,amount_,memo_,create_time_,update_time_) VALUES(#{id},#{musicGroupId},#{name},#{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{memo},#{createTime},#{updateTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.web.dal.entity.MusicGroupPaymentEntities">
+		UPDATE music_group_payment_entities
+		<set>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="amount != null">
+				amount_ = #{amount},
+			</if>
+			<if test="memo != null">
+				memo_ = #{memo},
+			</if>
+			<if test="paymentMethod != null">
+				payment_method_ = #{paymentMethod, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="musicGroupId != null">
+				music_group_id_ = #{musicGroupId},
+			</if>
+			<if test="name != null">
+				name_ = #{name},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM music_group_payment_entities WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="MusicGroupPaymentEntities" parameterType="map">
+		SELECT * FROM music_group_payment_entities ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM music_group_payment_entities
+	</select>
+</mapper>