Commit 8d0c3167 authored by luzhuang's avatar luzhuang

course

parent d639b6c5
...@@ -18,7 +18,7 @@ public interface BCourseRepository extends BaseMapper<BCourse> { ...@@ -18,7 +18,7 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
@Select("<script>SELECT * FROM b_course where del_flag != 1 and flag = 1 " + @Select("<script>SELECT * FROM b_course where del_flag != 1 and flag = 1 " +
"<if test=\"condition!=null and condition != ''\"> and c_name like CONCAT('%',#{condition},'%') </if>" + "<if test=\"condition!=null and condition != ''\"> and c_name like CONCAT('%',#{condition},'%') </if>" +
"ORDER BY order_by</script>") "ORDER BY order_by</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "ChildListResultMap")
List<BCourse> selectCourses(BCourse bCourse); List<BCourse> selectCourses(BCourse bCourse);
......
...@@ -4,11 +4,13 @@ import lombok.AllArgsConstructor; ...@@ -4,11 +4,13 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.core.entity.IdEntity; import org.rcisoft.core.entity.IdEntity;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.util.List;
@Entity @Entity
@Table(name = "b_course") @Table(name = "b_course")
...@@ -29,4 +31,7 @@ public class BCourse extends IdEntity<BCourse> { ...@@ -29,4 +31,7 @@ public class BCourse extends IdEntity<BCourse> {
@Transient @Transient
private String condition;//模糊查询条件 private String condition;//模糊查询条件
@Transient
private List<BCourseRepository> childList;
} }
...@@ -15,4 +15,7 @@ ...@@ -15,4 +15,7 @@
<result column="order_by" jdbcType="VARCHAR" property="orderBy"/> <result column="order_by" jdbcType="VARCHAR" property="orderBy"/>
</resultMap> </resultMap>
<resultMap id="ChildListResultMap" type="org.rcisoft.business.bcourse.entity.BCourse" extends="BaseResultMap">
<association column="business_id" property="childList" select="org.rcisoft.business.bcourse.dao.BCourseRepository.selectCourses"></association>
</resultMap>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment