ganzi-api/inventory-dao/src/main/resources/mapper/NewsCntMapper.xml

669 lines
26 KiB
XML
Raw Normal View History

2022-09-16 15:07:17 +08:00
<?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.rzyc.mapper.NewsCntMapper">
<resultMap id="BaseResultMap" type="com.rzyc.model.NewsCnt">
<id column="NewsCntId" jdbcType="VARCHAR" property="newscntid" />
<result column="NewsClassId" jdbcType="VARCHAR" property="newsclassid" />
<result column="SortId" jdbcType="INTEGER" property="sortid" />
<result column="NewTitle" jdbcType="VARCHAR" property="newtitle" />
<result column="coverImage" jdbcType="VARCHAR" property="coverImage" />
<result column="KeyWord" jdbcType="VARCHAR" property="keyword" />
<result column="SysLabel" jdbcType="VARCHAR" property="syslabel" />
<result column="sysUnitId" jdbcType="VARCHAR" property="sysUnitId" />
<result column="NewSource" jdbcType="VARCHAR" property="newsource" />
<result column="ReadNum" jdbcType="INTEGER" property="readnum" />
<result column="SysEditer" jdbcType="VARCHAR" property="sysediter" />
<result column="PublicTime" jdbcType="TIMESTAMP" property="publictime" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.rzyc.model.NewsCnt">
<result column="SysCnt" jdbcType="LONGVARCHAR" property="syscnt" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
NewsCntId, NewsClassId, SortId, NewTitle,coverImage, KeyWord, SysLabel,
sysUnitId,NewSource, ReadNum,
SysEditer, PublicTime, CreatedOn, CreatedBy, ModifiedOn, ModifiedBy
</sql>
<sql id="Blob_Column_List">
SysCnt
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.rzyc.model.NewsCntExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from NewsCnt
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.rzyc.model.NewsCntExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from NewsCnt
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from NewsCnt
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from NewsCnt
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.rzyc.model.NewsCntExample">
delete from NewsCnt
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.rzyc.model.NewsCnt">
insert into NewsCnt (NewsCntId, NewsClassId, SortId,
NewTitle, coverImage,KeyWord, SysLabel,sysUnitId,
NewSource, ReadNum, SysEditer,del_state,
PublicTime, CreatedOn, CreatedBy,
ModifiedOn, ModifiedBy, SysCnt
)
values (#{newscntid,jdbcType=VARCHAR}, #{newsclassid,jdbcType=VARCHAR}, #{sortid,jdbcType=INTEGER},
#{newtitle,jdbcType=VARCHAR},
#{coverImage,jdbcType=VARCHAR},
#{keyword,jdbcType=VARCHAR},
#{syslabel,jdbcType=VARCHAR},
#{sysUnitId,jdbcType=VARCHAR},
#{newsource,jdbcType=VARCHAR}, #{readnum,jdbcType=INTEGER},
#{sysediter,jdbcType=VARCHAR},
#{delState,jdbcType=INTEGER},
#{publictime,jdbcType=TIMESTAMP}, #{createdon,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR},
#{modifiedon,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR}, #{syscnt,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.rzyc.model.NewsCnt">
insert into NewsCnt
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="newscntid != null">
NewsCntId,
</if>
<if test="newsclassid != null">
NewsClassId,
</if>
<if test="sortid != null">
SortId,
</if>
<if test="newtitle != null">
NewTitle,
</if>
<if test="coverImage != null">
coverImage,
</if>
<if test="keyword != null">
KeyWord,
</if>
<if test="syslabel != null">
SysLabel,
</if>
<if test="sysUnitId != null">
sysUnitId,
</if>
<if test="newsource != null">
NewSource,
</if>
<if test="readnum != null">
ReadNum,
</if>
<if test="sysediter != null">
SysEditer,
</if>
<if test="publictime != null">
PublicTime,
</if>
<if test="createdon != null">
CreatedOn,
</if>
<if test="createdby != null">
CreatedBy,
</if>
<if test="modifiedon != null">
ModifiedOn,
</if>
<if test="modifiedby != null">
ModifiedBy,
</if>
<if test="syscnt != null">
SysCnt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="newscntid != null">
#{newscntid,jdbcType=VARCHAR},
</if>
<if test="newsclassid != null">
#{newsclassid,jdbcType=VARCHAR},
</if>
<if test="sortid != null">
#{sortid,jdbcType=INTEGER},
</if>
<if test="newtitle != null">
#{newtitle,jdbcType=VARCHAR},
</if>
<if test="coverImage != null">
#{coverImage,jdbcType=VARCHAR},
</if>
<if test="keyword != null">
#{keyword,jdbcType=VARCHAR},
</if>
<if test="syslabel != null">
#{syslabel,jdbcType=VARCHAR},
</if>
<if test="sysUnitId != null">
#{sysUnitId,jdbcType=VARCHAR},
</if>
<if test="newsource != null">
#{newsource,jdbcType=VARCHAR},
</if>
<if test="readnum != null">
#{readnum,jdbcType=INTEGER},
</if>
<if test="sysediter != null">
#{sysediter,jdbcType=VARCHAR},
</if>
<if test="publictime != null">
#{publictime,jdbcType=TIMESTAMP},
</if>
<if test="createdon != null">
#{createdon,jdbcType=TIMESTAMP},
</if>
<if test="createdby != null">
#{createdby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
#{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
#{modifiedby,jdbcType=VARCHAR},
</if>
<if test="syscnt != null">
#{syscnt,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.rzyc.model.NewsCntExample" resultType="java.lang.Long">
select count(*) from NewsCnt
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update NewsCnt
<set>
<if test="record.newscntid != null">
NewsCntId = #{record.newscntid,jdbcType=VARCHAR},
</if>
<if test="record.newsclassid != null">
NewsClassId = #{record.newsclassid,jdbcType=VARCHAR},
</if>
<if test="record.sortid != null">
SortId = #{record.sortid,jdbcType=INTEGER},
</if>
<if test="record.newtitle != null">
NewTitle = #{record.newtitle,jdbcType=VARCHAR},
</if>
<if test="record.coverImage != null">
coverImage = #{record.coverImage,jdbcType=VARCHAR},
</if>
<if test="record.keyword != null">
KeyWord = #{record.keyword,jdbcType=VARCHAR},
</if>
<if test="record.syslabel != null">
SysLabel = #{record.syslabel,jdbcType=VARCHAR},
</if>
<if test="record.sysUnitId != null">
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
</if>
<if test="record.newsource != null">
NewSource = #{record.newsource,jdbcType=VARCHAR},
</if>
<if test="record.readnum != null">
ReadNum = #{record.readnum,jdbcType=INTEGER},
</if>
<if test="record.sysediter != null">
SysEditer = #{record.sysediter,jdbcType=VARCHAR},
</if>
<if test="record.publictime != null">
PublicTime = #{record.publictime,jdbcType=TIMESTAMP},
</if>
<if test="record.createdon != null">
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
</if>
<if test="record.createdby != null">
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
</if>
<if test="record.modifiedon != null">
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="record.modifiedby != null">
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
</if>
<if test="record.syscnt != null">
SysCnt = #{record.syscnt,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update NewsCnt
set NewsCntId = #{record.newscntid,jdbcType=VARCHAR},
NewsClassId = #{record.newsclassid,jdbcType=VARCHAR},
SortId = #{record.sortid,jdbcType=INTEGER},
NewTitle = #{record.newtitle,jdbcType=VARCHAR},
coverImage = #{record.coverImage,jdbcType=VARCHAR},
KeyWord = #{record.keyword,jdbcType=VARCHAR},
SysLabel = #{record.syslabel,jdbcType=VARCHAR},
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
NewSource = #{record.newsource,jdbcType=VARCHAR},
ReadNum = #{record.readnum,jdbcType=INTEGER},
SysEditer = #{record.sysediter,jdbcType=VARCHAR},
PublicTime = #{record.publictime,jdbcType=TIMESTAMP},
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
SysCnt = #{record.syscnt,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update NewsCnt
set NewsCntId = #{record.newscntid,jdbcType=VARCHAR},
NewsClassId = #{record.newsclassid,jdbcType=VARCHAR},
SortId = #{record.sortid,jdbcType=INTEGER},
NewTitle = #{record.newtitle,jdbcType=VARCHAR},
coverImage = #{record.coverImage,jdbcType=VARCHAR},
KeyWord = #{record.keyword,jdbcType=VARCHAR},
SysLabel = #{record.syslabel,jdbcType=VARCHAR},
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
NewSource = #{record.newsource,jdbcType=VARCHAR},
ReadNum = #{record.readnum,jdbcType=INTEGER},
SysEditer = #{record.sysediter,jdbcType=VARCHAR},
PublicTime = #{record.publictime,jdbcType=TIMESTAMP},
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.NewsCnt">
update NewsCnt
<set>
<if test="newsclassid != null">
NewsClassId = #{newsclassid,jdbcType=VARCHAR},
</if>
<if test="sortid != null">
SortId = #{sortid,jdbcType=INTEGER},
</if>
<if test="newtitle != null">
NewTitle = #{newtitle,jdbcType=VARCHAR},
</if>
<if test="coverImage != null">
coverImage = #{coverImage,jdbcType=VARCHAR},
</if>
<if test="keyword != null">
KeyWord = #{keyword,jdbcType=VARCHAR},
</if>
<if test="syslabel != null">
SysLabel = #{syslabel,jdbcType=VARCHAR},
</if>
<if test="sysUnitId != null">
sysUnitId = #{sysUnitId,jdbcType=VARCHAR},
</if>
<if test="newsource != null">
NewSource = #{newsource,jdbcType=VARCHAR},
</if>
<if test="readnum != null">
ReadNum = #{readnum,jdbcType=INTEGER},
</if>
<if test="sysediter != null">
SysEditer = #{sysediter,jdbcType=VARCHAR},
</if>
<if test="publictime != null">
PublicTime = #{publictime,jdbcType=TIMESTAMP},
</if>
<if test="createdon != null">
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
</if>
<if test="createdby != null">
CreatedBy = #{createdby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
</if>
<if test="syscnt != null">
SysCnt = #{syscnt,jdbcType=LONGVARCHAR},
</if>
</set>
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.rzyc.model.NewsCnt">
update NewsCnt
set NewsClassId = #{newsclassid,jdbcType=VARCHAR},
SortId = #{sortid,jdbcType=INTEGER},
NewTitle = #{newtitle,jdbcType=VARCHAR},
coverImage = #{coverImage,jdbcType=VARCHAR},
KeyWord = #{keyword,jdbcType=VARCHAR},
SysLabel = #{syslabel,jdbcType=VARCHAR},
sysUnitId = #{sysUnitId,jdbcType=VARCHAR},
NewSource = #{newsource,jdbcType=VARCHAR},
ReadNum = #{readnum,jdbcType=INTEGER},
SysEditer = #{sysediter,jdbcType=VARCHAR},
PublicTime = #{publictime,jdbcType=TIMESTAMP},
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
CreatedBy = #{createdby,jdbcType=VARCHAR},
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
SysCnt = #{syscnt,jdbcType=LONGVARCHAR}
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.rzyc.model.NewsCnt">
update NewsCnt
set NewsClassId = #{newsclassid,jdbcType=VARCHAR},
SortId = #{sortid,jdbcType=INTEGER},
NewTitle = #{newtitle,jdbcType=VARCHAR},
coverImage = #{coverImage,jdbcType=VARCHAR},
KeyWord = #{keyword,jdbcType=VARCHAR},
SysLabel = #{syslabel,jdbcType=VARCHAR},
sysUnitId = #{sysUnitId,jdbcType=VARCHAR},
NewSource = #{newsource,jdbcType=VARCHAR},
ReadNum = #{readnum,jdbcType=INTEGER},
SysEditer = #{sysediter,jdbcType=VARCHAR},
PublicTime = #{publictime,jdbcType=TIMESTAMP},
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
CreatedBy = #{createdby,jdbcType=VARCHAR},
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{modifiedby,jdbcType=VARCHAR}
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</update>
<!--分页返回字段-->
<resultMap id="NewsPageResultMap" type="com.rzyc.model.NewsCnt">
<id column="NewsCntId" jdbcType="VARCHAR" property="newscntid" />
<result column="NewsClassId" jdbcType="VARCHAR" property="newsclassid" />
<result column="SortId" jdbcType="INTEGER" property="sortid" />
<result column="NewTitle" jdbcType="VARCHAR" property="newtitle" />
<result column="coverImage" jdbcType="VARCHAR" property="coverImage" />
<result column="KeyWord" jdbcType="VARCHAR" property="keyword" />
<result column="SysLabel" jdbcType="VARCHAR" property="syslabel" />
<result column="sysUnitId" jdbcType="VARCHAR" property="sysUnitId" />
<result column="NewSource" jdbcType="VARCHAR" property="newsource" />
<result column="ReadNum" jdbcType="INTEGER" property="readnum" />
<result column="SysEditer" jdbcType="VARCHAR" property="sysediter" />
<result column="PublicTime" jdbcType="TIMESTAMP" property="publictime" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
</resultMap>
<!--动态列表-->
<resultMap id="DynamicPageResultMap" type="com.rzyc.model.Dynamic">
<id column="NewsCntId" jdbcType="VARCHAR" property="dynamicid" />
<result column="NewsClassId" jdbcType="VARCHAR" property="newsclassid" />
<result column="dynamictype" jdbcType="VARCHAR" property="dynamictype" />
<result column="NewTitle" jdbcType="VARCHAR" property="title" />
<result column="coverImage" jdbcType="VARCHAR" property="cover" />
<result column="KeyWord" jdbcType="VARCHAR" property="keyword" />
<result column="NewSource" jdbcType="VARCHAR" property="unitName" />
<result column="SysCnt" jdbcType="VARCHAR" property="content" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="PublicTime" jdbcType="TIMESTAMP" property="publictime" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
</resultMap>
<sql id="Page_Column_List">
NewsCntId, NewsClassId, SortId, NewTitle,coverImage, KeyWord, SysLabel, NewSource, ReadNum,
SysEditer, PublicTime, CreatedOn, CreatedBy, ModifiedOn, ModifiedBy
</sql>
<sql id="Dynamic_Column_List">
NewsCntId, NewsClassId,NewTitle,coverImage, NewSource,
CreatedOn, CreatedBy, ModifiedOn, ModifiedBy,SysCnt,PublicTime
</sql>
<!--新闻分页-->
<select id="newsCntPage" resultMap="DynamicPageResultMap">
SELECT
nl.`NewsType` dynamictype, nc.NewsCntId, nc.NewsClassId,nc.NewTitle,nc.coverImage, nc.NewSource,
nc.CreatedOn, nc.CreatedBy, nc.ModifiedOn, nc.ModifiedBy,nc.SysCnt,nc.PublicTime
FROM NewsCnt nc
LEFT JOIN NewsClass nl ON nc.`NewsClassId` = nl.`NewsClassId`
WHERE nc.`NewTitle` LIKE #{condition}
AND nc.`NewsClassId` IS NOT NULL
and nc.del_state = 1
ORDER BY nc.`PublicTime` DESC
LIMIT #{start},#{end}
</select>
<!--新闻总数-->
<select id="countNewsCntPage" resultType="java.lang.Long">
SELECT
count(*)
FROM NewsCnt nc
LEFT JOIN NewsClass nl ON nc.`NewsClassId` = nl.`NewsClassId`
WHERE nc.`NewTitle` LIKE #{condition}
AND nc.`NewsClassId` IS NOT NULL
and nc.del_state = 1
</select>
<!--动态详情-->
<select id="newCntDetail" resultMap="DynamicPageResultMap">
SELECT nl.`NewsType` dynamictype, nc.NewsCntId, nc.NewsClassId,nc.NewTitle,nc.coverImage, nc.NewSource,
nc.CreatedOn, nc.CreatedBy, nc.ModifiedOn, nc.ModifiedBy,nc.PublicTime,nc.SysCnt
FROM NewsCnt nc
LEFT JOIN NewsClass nl ON nc.`NewsClassId` = nl.`NewsClassId`
WHERE nc.NewsCntId = #{newsCntId}
</select>
<!--最新一条动态-->
<select id="newestDynamic" resultMap="BaseResultMap">
SELECT * FROM NewsCnt nc
where nc.NewsClassId is not null
and nc.del_state = 1
ORDER BY nc.`PublicTime` DESC LIMIT 1
</select>
<!-- 修改动态 -->
<update id="changeNewsCnt" parameterType="com.rzyc.model.NewsCnt">
update NewsCnt
set NewsClassId = #{newsclassid,jdbcType=VARCHAR},
NewTitle = #{newtitle,jdbcType=VARCHAR},
coverImage = #{coverImage,jdbcType=VARCHAR},
KeyWord = #{keyword,jdbcType=VARCHAR},
SysLabel = #{syslabel,jdbcType=VARCHAR},
sysUnitId = #{sysUnitId,jdbcType=VARCHAR},
NewSource = #{newsource,jdbcType=VARCHAR},
ReadNum = #{readnum,jdbcType=INTEGER},
SysEditer = #{sysediter,jdbcType=VARCHAR},
PublicTime = #{publictime,jdbcType=TIMESTAMP},
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
SysCnt = #{syscnt,jdbcType=LONGVARCHAR},
ModifiedBy = #{modifiedby,jdbcType=VARCHAR}
where NewsCntId = #{newscntid,jdbcType=VARCHAR}
</update>
<!--新闻分页-->
<select id="newsCntList" resultMap="DynamicPageResultMap">
SELECT
nl.`NewsType` dynamictype, nc.NewsCntId, nc.NewsClassId,nc.NewTitle,nc.coverImage, nc.NewSource,
nc.CreatedOn, nc.CreatedBy, nc.ModifiedOn, nc.ModifiedBy,nc.PublicTime
FROM NewsCnt nc
LEFT JOIN NewsClass nl ON nc.`NewsClassId` = nl.`NewsClassId`
WHERE nc.`NewTitle` LIKE #{}
AND nc.`NewsClassId` IS NOT NULL
<if test="null != newsClassId and '' != newsClassId">
AND nc.`NewsClassId` = #{newsClassId}
</if>
and nc.del_state = 1
ORDER BY nc.`PublicTime` DESC
</select>
<!--修改动态-->
<update id="changeNews" >
update NewsCnt
set NewsClassId = #{record.newsclassid,jdbcType=VARCHAR},
SortId = #{record.sortid,jdbcType=INTEGER},
NewTitle = #{record.newtitle,jdbcType=VARCHAR},
coverImage = #{record.coverImage,jdbcType=VARCHAR},
KeyWord = #{record.keyword,jdbcType=VARCHAR},
SysLabel = #{record.syslabel,jdbcType=VARCHAR},
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
NewSource = #{record.newsource,jdbcType=VARCHAR},
SysCnt = #{record.syscnt,jdbcType=LONGVARCHAR},
ReadNum = #{record.readnum,jdbcType=INTEGER},
SysEditer = #{record.sysediter,jdbcType=VARCHAR},
PublicTime = #{record.publictime,jdbcType=TIMESTAMP},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
where NewsCntId = #{record.newscntid,jdbcType=VARCHAR}
</update>
<!--动态详情-->
<resultMap id="NewsResultMap" type="com.rzyc.model.NewsCnt">
<id column="NewsCntId" jdbcType="VARCHAR" property="newscntid" />
<result column="NewsClassId" jdbcType="VARCHAR" property="newsclassid" />
<result column="dynamictype" jdbcType="VARCHAR" property="dynamictype" />
<result column="SortId" jdbcType="INTEGER" property="sortid" />
<result column="NewTitle" jdbcType="VARCHAR" property="newtitle" />
<result column="coverImage" jdbcType="VARCHAR" property="coverImage" />
<result column="KeyWord" jdbcType="VARCHAR" property="keyword" />
<result column="SysLabel" jdbcType="VARCHAR" property="syslabel" />
<result column="sysUnitId" jdbcType="VARCHAR" property="sysUnitId" />
<result column="NewSource" jdbcType="VARCHAR" property="newsource" />
<result column="ReadNum" jdbcType="INTEGER" property="readnum" />
<result column="SysEditer" jdbcType="VARCHAR" property="sysediter" />
<result column="PublicTime" jdbcType="TIMESTAMP" property="publictime" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
<result column="SysCnt" jdbcType="LONGVARCHAR" property="syscnt" />
</resultMap>
<!--动态详情-->
<select id="findById" resultMap="NewsResultMap">
SELECT nl.`NewsType` dynamictype, nc.NewsCntId, nc.NewsClassId,nc.NewTitle,nc.coverImage, nc.NewSource,
nc.CreatedOn, nc.CreatedBy, nc.ModifiedOn, nc.ModifiedBy,nc.PublicTime,nc.SysCnt
FROM NewsCnt nc
LEFT JOIN NewsClass nl ON nc.`NewsClassId` = nl.`NewsClassId`
WHERE nc.NewsCntId = #{newsCntId}
</select>
<!--删除动态-->
<update id="delNewsCnt">
update `NewsCnt`
set del_state = 2 ,
ModifiedBy=#{chinaName},
ModifiedOn=now()
where NewsCntId = #{newsCntId}
</update>
</mapper>