Pārlūkot izejas kodu

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan 5 gadi atpakaļ
vecāks
revīzija
86cabbd264

+ 11 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamLocation.java

@@ -26,6 +26,8 @@ public class ExamLocation {
 	@ApiModelProperty(value = "是否可用")
 	private boolean isAvailable;
 
+	private Integer delFlag;
+
 	private java.util.Date createTime;
 
 	private java.util.Date updateTime;
@@ -93,7 +95,15 @@ public class ExamLocation {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+
+	public Integer getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(Integer delFlag) {
+		this.delFlag = delFlag;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 11 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamSong.java

@@ -29,6 +29,8 @@ public class ExamSong {
 	@ApiModelProperty(value = "曲目文件地址")
 	private String fileUrlList;
 
+	private Integer delFlag;
+
 	private java.util.Date createTime;
 
 	private java.util.Date updateTime;
@@ -104,7 +106,15 @@ public class ExamSong {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+
+	public Integer getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(Integer delFlag) {
+		this.delFlag = delFlag;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 37 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/SongTypeEnum.java

@@ -0,0 +1,37 @@
+package com.keao.edu.user.enums;
+
+import com.keao.edu.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.16
+ **/
+public enum SongTypeEnum implements BaseEnum<String, SongTypeEnum> {
+
+    PRACTICE("PRACTICE", "练习曲"),PERFORM("PERFORM", "演奏曲");
+
+    private String code;
+
+    private String msg;
+
+    SongTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return null;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }}

+ 24 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamLocationQueryInfo.java

@@ -0,0 +1,24 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.management.Query;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.16
+ */
+public class ExamLocationQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "是否可用")
+    private boolean isAvailable;
+
+    public boolean isAvailable() {
+        return isAvailable;
+    }
+
+    public void setAvailable(boolean available) {
+        isAvailable = available;
+    }
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamSongQueryInfo.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.16
+ */
+public class ExamSongQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "专业")
+    private String subjectList;
+
+    public String getSubjectList() {
+        return subjectList;
+    }
+
+    public void setSubjectList(String subjectList) {
+        this.subjectList = subjectList;
+    }
+}

+ 27 - 8
edu-user/edu-user-server/src/main/resources/config.mybatis/ExamLocationMapper.xml

@@ -38,25 +38,28 @@
 		UPDATE exam_location
 		<set>
 			<if test="address != null">
-			address_ = #{address},
+				address_ = #{address},
 			</if>
 			<if test="isAvailable != null">
-			is_available_ = #{isAvailable},
+				is_available_ = #{isAvailable},
 			</if>
 			<if test="id != null">
-			id_ = #{id},
+				id_ = #{id},
 			</if>
 			<if test="contactPhone != null">
-			contact_phone_ = #{contactPhone},
+				contact_phone_ = #{contactPhone},
 			</if>
 			<if test="contactName != null">
-			contact_name_ = #{contactName},
+				contact_name_ = #{contactName},
 			</if>
 			<if test="name != null">
-			name_ = #{name},
+				name_ = #{name},
+			</if>
+			<if test="delFlag!=null">
+				del_flag_=#{delFlag},
 			</if>
 			<if test="createTime != null">
-			create_time_ = #{createTime},
+				create_time_ = #{createTime},
 			</if>
 			update_time_ = NOW()
 		</set> WHERE id_ = #{id}
@@ -66,14 +69,30 @@
 	<delete id="delete" >
 		DELETE FROM exam_location WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			del_flag_=0
+			<if test="isAvailable!=null">
+				AND is_available_=#{isAvailable}
+			</if>
+			<if test="search!=null">
+				AND (id_=#{search} OR name_ LIKE CONCAT('%', #{serch}, '%'))
+			</if>
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamLocation" parameterType="map">
-		SELECT * FROM exam_location ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM exam_location
+		<include refid="queryCondition"/>
+		ORDER BY id_
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM exam_location
+		<include refid="queryCondition"/>
 	</select>
 </mapper>

+ 23 - 4
edu-user/edu-user-server/src/main/resources/config.mybatis/ExamSongMapper.xml

@@ -12,7 +12,7 @@
 		<result column="song_author_" property="songAuthor" />
 		<result column="subject_list_" property="subjectList" />
 		<result column="level_list_" property="levelList" />
-		<result column="type_" property="type" />
+		<result column="type_" property="type"  typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="file_url_list_" property="fileUrlList" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -31,7 +31,7 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamSong" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO exam_song (id_,song_name_,song_author_,subject_list_,level_list_,type_,file_url_list_,create_time_,update_time_)
-		VALUES(#{id},#{songName},#{songAuthor},#{subjectList},#{levelList},#{type},#{fileUrlList},NOW(),NOW())
+		VALUES(#{id},#{songName},#{songAuthor},#{subjectList},#{levelList},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{fileUrlList},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -54,11 +54,14 @@
 				song_author_ = #{songAuthor},
 			</if>
 			<if test="type != null">
-				type_ = #{type},
+				type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
 			<if test="songName != null">
 				song_name_ = #{songName},
 			</if>
+			<if test="delFlag != null">
+				del_flag_ = #{delFlag}
+			</if>
 			<if test="createTime != null">
 				create_time_ = #{createTime},
 			</if>
@@ -70,14 +73,30 @@
 	<delete id="delete" >
 		DELETE FROM exam_song WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			del_flag_=0
+			<if test="subjectList!=null">
+				AND FIND_IN_SET(#{subjectList}, subject_list_)
+			</if>
+			<if test="search!=null">
+				AND (id_=#{search} OR song_name_ LIKE CONCAT('%', #{search}, '%'))
+			</if>
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamSong" parameterType="map">
-		SELECT * FROM exam_song ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM exam_song
+		<include refid="queryCondition"/>
+		ORDER BY id_
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
+		<include refid="queryCondition"/>
 		SELECT COUNT(*) FROM exam_song
 	</select>
 </mapper>