|
|
|
|
@ -36,7 +36,7 @@ |
|
|
|
|
<result column="BASIC_DISPLAY" property="basicDisplay" /> |
|
|
|
|
<!-- 一对一关联栏目 --> |
|
|
|
|
<association property="column" column="COLUMN_CATEGORY_ID" |
|
|
|
|
javaType="net.mingsoft.basic.entity.ColumnEntity"> |
|
|
|
|
javaType="net.mingsoft.basic.entity.ColumnEntity"> |
|
|
|
|
<result property="columnPath" column="column_path" /> |
|
|
|
|
<result property="categoryTitle" column="category_title" /> |
|
|
|
|
<result property="categoryId" column="category_id" /> |
|
|
|
|
@ -50,6 +50,7 @@ |
|
|
|
|
<result column="ARTICLE_BASICID" property="articleId" /> |
|
|
|
|
<result column="column_path" property="columnPath"/> |
|
|
|
|
<result column="column_url" property="columnUrl" /> |
|
|
|
|
<result column="column_listurl" property="columnListUrl" /> |
|
|
|
|
<result column="category_title" property="categoryTitle" /> |
|
|
|
|
<result column="category_id" property="categoryId" /> |
|
|
|
|
<result column="COLUMN_CM_ID" property="columnContentModelId" /> |
|
|
|
|
@ -85,7 +86,7 @@ |
|
|
|
|
<result column="BASIC_DISPLAY" property="basicDisplay" /> |
|
|
|
|
<!-- 一对一关联栏目 --> |
|
|
|
|
<association property="column" |
|
|
|
|
javaType="net.mingsoft.basic.entity.ColumnEntity"> |
|
|
|
|
javaType="net.mingsoft.basic.entity.ColumnEntity"> |
|
|
|
|
<result property="columnPath" column="column_path" /> |
|
|
|
|
<result property="categoryTitle" column="category_title" /> |
|
|
|
|
<result property="categoryId" column="category_id" /> |
|
|
|
|
@ -237,7 +238,7 @@ |
|
|
|
|
<if test="basicCategoryIds != null"> |
|
|
|
|
and b.BASIC_CATEGORYID in |
|
|
|
|
<foreach collection="basicCategoryIds" index="index" item="categoryId" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{categoryId} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
@ -270,7 +271,7 @@ |
|
|
|
|
<if test="basicCategoryIds != null"> |
|
|
|
|
and b.BASIC_CATEGORYID in |
|
|
|
|
<foreach collection="basicCategoryIds" index="index" item="categoryId" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{categoryId} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
@ -321,8 +322,8 @@ |
|
|
|
|
<select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" > |
|
|
|
|
select |
|
|
|
|
ARTICLE_BASICID,cl.*,c.* |
|
|
|
|
FROM cms_article a LEFT JOIN basic b ON a.ARTICLE_BASICID = b.BASIC_ID |
|
|
|
|
LEFT JOIN basic_column cl ON b.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID |
|
|
|
|
FROM cms_article a LEFT JOIN basic ON a.ARTICLE_BASICID = basic.BASIC_ID |
|
|
|
|
LEFT JOIN basic_column cl ON basic.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID |
|
|
|
|
JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID |
|
|
|
|
where |
|
|
|
|
<if test="appId > 0"> |
|
|
|
|
@ -330,14 +331,17 @@ |
|
|
|
|
</if> |
|
|
|
|
<!-- 查询子栏目数据 --> |
|
|
|
|
<if test="categoryId > 0"> |
|
|
|
|
and (b.basic_categoryid=#{categoryId} or b.basic_categoryid in |
|
|
|
|
(select category_id FROM category where <include refid="queryWhereCategoryId"></include>)) |
|
|
|
|
and (basic.basic_categoryid=#{categoryId} or basic.basic_categoryid in |
|
|
|
|
(select category_id FROM category where <include refid="queryWhereCategoryId"></include>)) |
|
|
|
|
</if> |
|
|
|
|
<if test="beginTime!=null and beginTime!=''"> |
|
|
|
|
and b.basic_updatetime >= #{beginTime} |
|
|
|
|
and basic.basic_updatetime >= #{beginTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="endTime!=null and endTime!=''"> |
|
|
|
|
and b.basic_updatetime >= #{endTime} |
|
|
|
|
and basic.basic_updatetime >= #{endTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="orderBy!=null and order!=null and orderBy!='' and order!=''"> |
|
|
|
|
ORDER BY `${orderBy}` ${order} |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
@ -359,24 +363,24 @@ |
|
|
|
|
<!-- 根据字段条件查找文章实体开始 --> |
|
|
|
|
<sql id="queryLike" databaseId="mysql"> |
|
|
|
|
like CONCAT("%", |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
,"%") |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
,"%") |
|
|
|
|
</sql> |
|
|
|
|
<sql id="queryLike" databaseId="oracle"> |
|
|
|
|
like '%'|| |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
||'%' |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
||'%' |
|
|
|
|
</sql> |
|
|
|
|
<sql id="queryLike" databaseId="sqlServer"> |
|
|
|
|
like '%'+ |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
+'%' |
|
|
|
|
<foreach item="val" index="index" collection="item[3]"> |
|
|
|
|
<if test="index==0">#{val}</if> |
|
|
|
|
</foreach> |
|
|
|
|
+'%' |
|
|
|
|
</sql> |
|
|
|
|
<!-- 已过期 --> |
|
|
|
|
<select id="queryListForSearch" resultMap="resultMap"> |
|
|
|
|
@ -398,12 +402,12 @@ |
|
|
|
|
and |
|
|
|
|
b.BASIC_CATEGORYID in |
|
|
|
|
<foreach item="id" index="key" collection="ids" open="(" |
|
|
|
|
separator="," close=")"> |
|
|
|
|
separator="," close=")"> |
|
|
|
|
#{id.categoryId} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<foreach item="item" index="key" collection="map" open="" |
|
|
|
|
separator="" close=""> |
|
|
|
|
separator="" close=""> |
|
|
|
|
<if test=" item[0] == false"> |
|
|
|
|
and ${key} |
|
|
|
|
</if> |
|
|
|
|
@ -421,7 +425,7 @@ |
|
|
|
|
<if test="item[2] == false"> |
|
|
|
|
between |
|
|
|
|
<foreach item="val" index="index" collection="item[3]" |
|
|
|
|
separator="and"> |
|
|
|
|
separator="and"> |
|
|
|
|
#{val} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
@ -465,7 +469,7 @@ |
|
|
|
|
and FIND_IN_SET(category_categoryid,'${ids}') |
|
|
|
|
</if> |
|
|
|
|
<foreach item="item" index="key" collection="map" open="" |
|
|
|
|
separator="" close=""> |
|
|
|
|
separator="" close=""> |
|
|
|
|
<if test=" item[0] == false"> |
|
|
|
|
and ${key} |
|
|
|
|
</if> |
|
|
|
|
@ -483,7 +487,7 @@ |
|
|
|
|
<if test="item[2] == false"> |
|
|
|
|
between |
|
|
|
|
<foreach item="val" index="index" collection="item[3]" |
|
|
|
|
separator="and"> |
|
|
|
|
separator="and"> |
|
|
|
|
#{val} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
@ -509,8 +513,8 @@ |
|
|
|
|
<include refid="basic_data_list" /> |
|
|
|
|
from |
|
|
|
|
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
<if test="contentModelTableName!=null"> |
|
|
|
|
left join ${contentModelTableName} cmt on |
|
|
|
|
cmt.basicid=basic_id |
|
|
|
|
@ -533,10 +537,10 @@ |
|
|
|
|
<sql id="selectOne"> |
|
|
|
|
from |
|
|
|
|
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
|
|
|
|
|
where category_appid=#{appId} |
|
|
|
|
where category_appid=#{appId} |
|
|
|
|
<if test="flag==false"> |
|
|
|
|
and basic_id < ${basicId} |
|
|
|
|
|
|
|
|
|
@ -600,10 +604,10 @@ |
|
|
|
|
<select id="getByCategoryId" resultMap="resultMap"> |
|
|
|
|
select |
|
|
|
|
<include refid="basic_data_list" /> |
|
|
|
|
from |
|
|
|
|
from |
|
|
|
|
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) |
|
|
|
|
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) |
|
|
|
|
where basic_categoryId=#{categoryId} order by basic_id desc |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
@ -613,7 +617,7 @@ |
|
|
|
|
<where> |
|
|
|
|
ARTICLE_BASICID in |
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" |
|
|
|
|
separator="," close=")">#{item}</foreach> |
|
|
|
|
separator="," close=")">#{item}</foreach> |
|
|
|
|
</where> |
|
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|