后台搜索文章
parent
2c3c94cf5b
commit
090da963a0
@ -0,0 +1,13 @@
|
||||
package com.bsd.cases.vo;
|
||||
|
||||
import com.bsd.cases.model.CaseCategory;
|
||||
import com.bsd.cases.model.CaseContent;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CaseContentBakVo extends CaseContent {
|
||||
|
||||
private Long level2Id;
|
||||
|
||||
private Long level1Id;
|
||||
}
|
@ -1,5 +1,29 @@
|
||||
<?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.bsd.cases.mapper.CaseContentMapper">
|
||||
|
||||
<select id="searchBak" resultType="com.bsd.cases.vo.CaseContentBakVo">
|
||||
SELECT a.id,a.content_title,a.url,a.content,a.category_id,a.create_date_time,a.update_date_time,a.create_by,a.update_by,
|
||||
a.state,a.`level2_id`,ccy.parent_id as `level1_id`
|
||||
FROM (select cc.`id`,cc.`content_title`,cc.`url`,cc.`content`,cc.`category_id`,ccy.`name` as level3_name,
|
||||
cc.`create_date_time`,cc.`update_date_time`,cc.`create_by`,cc.`update_by`,cc.`state`,ccy.parent_id as level2_id
|
||||
FROM case_content cc
|
||||
left join case_category ccy
|
||||
on ccy.id = cc.category_id) a
|
||||
left join case_category ccy
|
||||
on a.level2_id = ccy.id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="level1Id != null">
|
||||
AND ccy.parent_id = #{level1Id}
|
||||
</if>
|
||||
<if test="level2Id != null">
|
||||
AND a.`level2_id` = #{level2Id}
|
||||
</if>
|
||||
<if test="level3Id != null">
|
||||
and a.category_id = #{level3Id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
a.`content_title` LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue