You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.3 KiB
XML
30 lines
1.3 KiB
XML
<?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.category_id,a.level3_name as category_name,a.create_date_time,a.update_date_time,a.create_by,a.update_by,
|
|
a.state,a.`level_id2`,ccy.parent_id as `level_id1`
|
|
FROM (select cc.`id`,cc.`content_title`,cc.`url`,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 level_id2
|
|
FROM case_content cc
|
|
left join case_category ccy
|
|
on ccy.id = cc.category_id) a
|
|
left join case_category ccy
|
|
on a.level_id2 = ccy.id
|
|
WHERE
|
|
1 = 1 AND a.state = 1
|
|
<if test="level1Id != null">
|
|
AND ccy.parent_id = #{level1Id}
|
|
</if>
|
|
<if test="level2Id != null">
|
|
AND a.`level_id2` = #{level2Id}
|
|
</if>
|
|
<if test="level3Id != null">
|
|
and a.category_id = #{level3Id}
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
and a.`content_title` LIKE CONCAT('%',#{name},'%')
|
|
</if>
|
|
</select>
|
|
</mapper>
|