master
ck 5 years ago
parent 8c917291d0
commit 5e15ae3e93

@ -1,13 +1,24 @@
package com.bsd.cases.vo;
import com.bsd.cases.model.BaseEntity;
import com.bsd.cases.model.CaseCategory;
import com.bsd.cases.model.CaseContent;
import lombok.Data;
@Data
public class CaseContentBakVo extends CaseContent {
public class CaseContentBakVo extends BaseEntity {
private Long level2Id;
private String contentTitle;
private Long level1Id;
private String url;
private String content;
private Long categoryId;
private String categoryName;
private Long levelId2;
private Long levelId1;
}

@ -38,6 +38,8 @@ logging:
mybatis:
type-aliases-package: com.oceanspot.template.util.model
mapper-locations: classpath:mapper/*.xml
configuration:
map-underscore-to-camel-case: true
mapper:
mappers: com.bsd.cases.util.CommonMapper
not-empty: false

@ -2,17 +2,17 @@
<!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`
SELECT a.id,a.content_title,a.url,a.content,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.`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
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.level2_id = ccy.id
on a.level_id2 = ccy.id
WHERE
1 = 1
1 = 1 AND a.state = 1
<if test="level1Id != null">
AND ccy.parent_id = #{level1Id}
</if>

Loading…
Cancel
Save