|
|
|
@ -3,36 +3,6 @@ |
|
|
|
|
|
|
|
<mapper namespace="com.elink.esua.epdc.dao.NewsDao"> |
|
|
|
|
|
|
|
<resultMap type="com.elink.esua.epdc.entity.NewsEntity" id="newsMap"> |
|
|
|
<result property="id" column="ID"/> |
|
|
|
<result property="newsTitle" column="NEWS_TITLE"/> |
|
|
|
<result property="newsContent" column="NEWS_CONTENT"/> |
|
|
|
<result property="newsCateroryId" column="NEWS_CATERORY_ID"/> |
|
|
|
<result property="newsProperty" column="NEWS_PROPERTY"/> |
|
|
|
<result property="newsImageUrl" column="NEWS_IMAGE_URL"/> |
|
|
|
<result property="newsUpDownState" column="NEWS_UP_DOWN_STATE"/> |
|
|
|
<result property="newsReleaseStartTime" column="NEWS_RELEASE_START_TIME"/> |
|
|
|
<result property="newsReleaseEndTime" column="NEWS_RELEASE_END_TIME"/> |
|
|
|
<result property="deptName" column="DEPT_NAME"/> |
|
|
|
<result property="deptId" column="DEPT_ID"/> |
|
|
|
<result property="readingAmount" column="READING_AMOUNT"/> |
|
|
|
<result property="likeNumber" column="LIKE_NUMBER"/> |
|
|
|
<result property="unLikeNumber" column="UN_LIKE_NUMBER"/> |
|
|
|
<result property="delFlag" column="DEL_FLAG"/> |
|
|
|
<result property="revision" column="REVISION"/> |
|
|
|
<result property="createdBy" column="CREATED_BY"/> |
|
|
|
<result property="createdTime" column="CREATED_TIME"/> |
|
|
|
<result property="updatedBy" column="UPDATED_BY"/> |
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
|
<result property="street" column="STREET"/> |
|
|
|
<result property="streetId" column="STREET_ID"/> |
|
|
|
<result property="community" column="COMMUNITY"/> |
|
|
|
<result property="communityId" column="COMMUNITY_ID"/> |
|
|
|
<result property="grid" column="GRID"/> |
|
|
|
<result property="gridId" column="GRID_ID"/> |
|
|
|
<result property="creatorName" column="CREATOR_NAME"/> |
|
|
|
<result property="newsReleaseState" column="NEWS_RELEASE_STATE"/> |
|
|
|
</resultMap> |
|
|
|
<select id="selectCountByCategoryId" resultType="int"> |
|
|
|
SELECT |
|
|
|
COUNT(*) AS count |
|
|
|
@ -41,6 +11,7 @@ |
|
|
|
WHERE |
|
|
|
NEWS_CATERORY_ID = #{categoryId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectListAppNews" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcNewsListResultDTO"> |
|
|
|
SELECT |
|
|
|
en.ID AS id, |
|
|
|
@ -67,24 +38,27 @@ |
|
|
|
en.NEWS_RELEASE_START_TIME DESC |
|
|
|
LIMIT #{pageIndex},#{pageSize} |
|
|
|
</select> |
|
|
|
<select id="selectOneAppNewsDetailById" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcNewsDetailResultDTO"> |
|
|
|
|
|
|
|
<select id="selectOneAppNewsDetail" |
|
|
|
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcNewsDetailResultDTO"> |
|
|
|
SELECT |
|
|
|
en.ID AS id, |
|
|
|
en.NEWS_TITLE AS newsTitle, |
|
|
|
en.NEWS_RELEASE_START_TIME AS newsStartTime, |
|
|
|
IFNULL( |
|
|
|
IFNULL(en.GRID, en.COMMUNITY), |
|
|
|
en.STREET |
|
|
|
) AS deptName, |
|
|
|
IFNULL( IFNULL(en.GRID, en.COMMUNITY), en.STREET ) AS deptName, |
|
|
|
en.NEWS_CONTENT AS newsContent, |
|
|
|
en.READING_AMOUNT AS readingAmount, |
|
|
|
en.UN_LIKE_NUMBER AS unlikeNumber, |
|
|
|
en.LIKE_NUMBER AS likeNumber, |
|
|
|
nc.CATEGORY_NAME AS categoryName |
|
|
|
nc.CATEGORY_NAME AS categoryName, |
|
|
|
CASE nu.ATTITUDE_FLAG WHEN '0' THEN '1' ELSE '0' END AS likeFlag, |
|
|
|
CASE nu.ATTITUDE_FLAG WHEN '1' THEN '1' ELSE '0' END AS unLikeFlag |
|
|
|
FROM |
|
|
|
epdc_news en |
|
|
|
LEFT JOIN epdc_news_category nc ON en.NEWS_CATERORY_ID = nc.ID |
|
|
|
LEFT JOIN epdc_news_user_attitude nu on nu.EPDC_NEWS_ID = en.ID AND nu.USER_ID = #{userId} AND nu.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
en.ID = #{id} |
|
|
|
en.ID = #{newsId} |
|
|
|
|
|
|
|
</select> |
|
|
|
</mapper> |