123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?xml version="1.0" encoding="UTF-8"?>
- <das-client>
- <Sqls>
- <Sql name='getArticleList'>
- <![CDATA[
- select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber
- from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 and m.ArticleState =1 @Condition
-
- ]]>
- </Sql>
- <Sql name='getArticleListCount'>
- <![CDATA[
- select count(*) from Org_Article m
- LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 and m.ArticleState =1 @Condition
- ]]>
- </Sql>
- <Sql name='getArticleById'>
- <![CDATA[
- select m.*,IFNULL(n.BrowseNumber,0) as BrowseNumber,IFNULL(n.PointNumber,0) as PointNumber,IFNULL(n.CollectionNumber,0) as CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber
- from Org_Article m JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 @Condition
- ]]>
- </Sql>
- <!--<Sql name='getCollectionArticleList'>
- <![CDATA[
- select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
- select m.* from Org_Article m INNER JOIN User_ArticleCollection n on m.articleid=n.ArticleId and 1=1 @UserParam) as aa LEFT JOIN
- User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
- ]]>
- </Sql>-->
- <Sql name='getCollectionArticleList'>
- <![CDATA[
- select aa.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,IFNULL(n.CommentNumber,0) as CommentNumber, IFNULL(n.PushNumber,0) as PushNumber from (
- select m.* from Org_Article m INNER JOIN User_ArticleCollection n on m.articleid=n.ArticleId and 1=1 and m.ArticleState =1 @UserParam) as aa LEFT JOIN
- User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
- ]]>
- </Sql>
- <Sql name='getCollectionArticleListCount'>
- <![CDATA[
- select count(*) from (
- select m.* from Org_Article m INNER JOIN User_ArticleCollection n on m.articleid=n.ArticleId and 1=1 and m.ArticleState =1 @UserParam) as aa LEFT JOIN
- User_ArticleStatistics n on aa.ArticleId=n.ArticleId where 1=1 @Condition
- ]]>
- </Sql>
- <Sql name='pointNumberCount'>
- <![CDATA[
- select * from User_Behavior where BehaviorAction=1 and 1=1 @Condition
- ]]>
- </Sql>
- <Sql name='collectionNumberCount'>
- <![CDATA[
- select * from User_ArticleCollection where 1=1 @Condition
- ]]>
- </Sql>
- <Sql name='updateArticleStatistic'>
- <![CDATA[
- update User_ArticleStatistics set @behaviorParam where @ArticleId
- ]]>
- </Sql>
- <Sql name='updateCollectionStatistic'>
- <![CDATA[
- update User_ArticleStatistics set @behaviorParam= (
- select count(*) from User_ArticleCollection where 1=1 @Condition) where @ArticleId
- ]]>
- </Sql>
- <Sql name='updateCommentStatistic'>
- <![CDATA[
- update User_ArticleStatistics set @behaviorParam= (
- select count(*) from User_ArticleComment where 1=1 @Condition) where @ArticleId
- ]]>
- </Sql>
- <Sql name='insertArticleStatistic'>
- <![CDATA[
-
- INSERT INTO User_ArticleStatistics (
- ArticleId
- )
- SELECT ?
- FROM dual where not exists( select ArticleId from User_ArticleStatistics where 1=1 and ArticleId=? );
-
- ]]>
- </Sql>
- <Sql name='deleteArticleStatistic'>
- <![CDATA[
-
- delete from User_ArticleStatistics
- ]]>
- </Sql>
- <Sql name='queryArticleStatistic'>
- <![CDATA[
- select * from (
- select count(case behavioraction when '1' then 'PointNumber' end) as PointNumber,
- count(case behavioraction when '3' then 'ShareNumber' end) as ShareNumber,
- count(case behavioraction when '4' then 'BrowseNumber' end) as BrowseNumber,ArticleId
- from User_Behavior where 1=1 @Condition) as aa LEFT JOIN
- (select count(*) as CommentNumber,ArticleId from User_ArticleComment where 1=1 @Condition) as bb ON aa.articleid=bb.articleid
- LEFT JOIN
- (select count(*) as CollectionNumber,ArticleId from User_ArticleCollection where 1=1 @Condition and usertype=2)as cc
- ON aa.articleid=bb.articleid
- ]]>
- </Sql>
- <Sql name='insertArticleInitStatistic'>
- <![CDATA[
- INSERT INTO User_ArticleStatistics (ArticleId, BrowseNumber, PointNumber, CommentNumber, ShareNumber, CollectionNumber,PushNumber) VALUES (?,?,?,?,?,?,?);
- ]]>
- </Sql>
- <Sql name='getDoctorArticleList'>
- <![CDATA[
- select * from (
- select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m
- LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where m.isauthentication=1 and 1=1 and m.ArticleState =1 @Condition
- union
- select m.* ,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m
- LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where m.isauthentication=2 and 1=1 and m.ArticleState =1 @Condition @Operatorid
- ) as aa @PageParam
-
- ]]>
- </Sql>
- <Sql name='getDoctorArticleListCount'>
- <![CDATA[
- select articleid from (
- select articleid from Org_Article where isauthentication=1 and 1=1 and m.ArticleState =1 @Condition
- union
- select articleid from Org_Article where isauthentication=2 and 1=1 and m.ArticleState =1 @Condition @Operatorid
- ) as aa
- ]]>
- </Sql>
- <Sql name='getDoctorArticalByUserId'>
- <![CDATA[
- select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m
- LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 and m.ArticleState =1 @Condition
- ]]>
- </Sql>
- <Sql name='getDoctorArticalByUserIdCount'>
- <![CDATA[
- select m.*,n.BrowseNumber,n.PointNumber,n.CollectionNumber,n.CommentNumber from Org_Article m
- LEFT JOIN User_ArticleStatistics n on m.ArticleId=n.ArticleId where 1=1 and m.ArticleState =1 @Condition
-
- ]]>
- </Sql>
- </Sqls>
- </das-client>
|