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

5 years ago
<?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">
5 years ago
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,
5 years ago
a.state,a.`level_id2`,ccy.parent_id as `level_id1`
5 years ago
FROM (select cc.`id`,cc.`content_title`,cc.`url`,cc.`category_id`,ccy.`name` as level3_name,
5 years ago
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
5 years ago
on a.level_id2 = ccy.id
WHERE
5 years ago
1 = 1 AND a.state = 1
<if test="level1Id != null">
AND ccy.parent_id = #{level1Id}
</if>
<if test="level2Id != null">
5 years ago
AND a.`level_id2` = #{level2Id}
</if>
<if test="level3Id != null">
and a.category_id = #{level3Id}
</if>
<if test="name != null and name != ''">
5 years ago
and a.`content_title` LIKE CONCAT('%',#{name},'%')
</if>
</select>
5 years ago
</mapper>