Joburgess před 5 roky
rodič
revize
845afbb06b

+ 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);

+ 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>

+ 20 - 1
edu-user/edu-user-server/src/main/resources/config.mybatis/ExamSongMapper.xml

@@ -59,6 +59,9 @@
 			<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>