123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?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.ruoyi.system.mapper.NewsInfoMapper">
-
- <resultMap type="NewsInfo" id="NewsInfoResult">
- <result property="newsInfoId" column="news_info_id" />
- <result property="newsInfoTitle" column="news_info_title" />
- <result property="newsInfoAuthor" column="news_info_author" />
- <result property="newsInfoSource" column="news_info_source" />
- <result property="newsInfoContent" column="news_info_content" />
- <result property="newsInfoTime" column="news_info_time" />
- <result property="newsInfoClick" column="news_info_click" />
- <result property="newsInfoInittime" column="news_info_inittime" />
- <result property="newsInfoType" column="news_info_type" />
- <result property="newsInfoCarousel" column="news_info_carousel" />
- <result property="newsInfoUrl" column="news_info_url" />
- <result property="newsInfoAuthorid" column="news_info_authorId" />
- </resultMap>
- <sql id="selectNewsInfoVo">
- select news_info_id, news_info_title, news_info_author, news_info_source, news_info_content, news_info_time, news_info_click, news_info_inittime, news_info_type, news_info_carousel, news_info_url, news_info_authorId from news_info
- </sql>
- <select id="selectNewsInfoList" parameterType="NewsInfo" resultMap="NewsInfoResult">
- <include refid="selectNewsInfoVo"/>
- <where>
- <if test="newsInfoTitle != null and newsInfoTitle != ''"> and news_info_title like concat('%', #{newsInfoTitle}, '%')</if>
- <if test="newsInfoAuthor != null and newsInfoAuthor != ''"> and news_info_author = #{newsInfoAuthor}</if>
- <if test="newsInfoSource != null and newsInfoSource != ''"> and news_info_source = #{newsInfoSource}</if>
- <if test="newsInfoContent != null and newsInfoContent != ''"> and news_info_content like concat('%', #{newsInfoContent}, '%')</if>
- <if test="params.beginNewsInfoTime != null and params.beginNewsInfoTime != '' and params.endNewsInfoTime != null and params.endNewsInfoTime != ''"> and news_info_time between #{params.beginNewsInfoTime} and #{params.endNewsInfoTime}</if>
- <if test="newsInfoClick != null "> and news_info_click = #{newsInfoClick}</if>
- <if test="newsInfoInittime != null "> and news_info_inittime = #{newsInfoInittime}</if>
- <if test="newsInfoType != null "> and news_info_type = #{newsInfoType}</if>
- <if test="newsInfoCarousel != null "> and news_info_carousel = #{newsInfoCarousel}</if>
- <if test="newsInfoUrl != null and newsInfoUrl != ''"> and news_info_url = #{newsInfoUrl}</if>
- <if test="newsInfoAuthorid != null "> and news_info_authorId = #{newsInfoAuthorid}</if>
- </where>
- </select>
-
- <select id="selectNewsInfoByNewsInfoId" parameterType="Long" resultMap="NewsInfoResult">
- <include refid="selectNewsInfoVo"/>
- where news_info_id = #{newsInfoId}
- </select>
-
- <insert id="insertNewsInfo" parameterType="NewsInfo" useGeneratedKeys="true" keyProperty="newsInfoId">
- insert into news_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="newsInfoTitle != null and newsInfoTitle != ''">news_info_title,</if>
- <if test="newsInfoAuthor != null and newsInfoAuthor != ''">news_info_author,</if>
- <if test="newsInfoSource != null">news_info_source,</if>
- <if test="newsInfoContent != null and newsInfoContent != ''">news_info_content,</if>
- <if test="newsInfoTime != null">news_info_time,</if>
- <if test="newsInfoClick != null">news_info_click,</if>
- <if test="newsInfoInittime != null">news_info_inittime,</if>
- <if test="newsInfoType != null">news_info_type,</if>
- <if test="newsInfoCarousel != null">news_info_carousel,</if>
- <if test="newsInfoUrl != null">news_info_url,</if>
- <if test="newsInfoAuthorid != null">news_info_authorId,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="newsInfoTitle != null and newsInfoTitle != ''">#{newsInfoTitle},</if>
- <if test="newsInfoAuthor != null and newsInfoAuthor != ''">#{newsInfoAuthor},</if>
- <if test="newsInfoSource != null">#{newsInfoSource},</if>
- <if test="newsInfoContent != null and newsInfoContent != ''">#{newsInfoContent},</if>
- <if test="newsInfoTime != null">#{newsInfoTime},</if>
- <if test="newsInfoClick != null">#{newsInfoClick},</if>
- <if test="newsInfoInittime != null">#{newsInfoInittime},</if>
- <if test="newsInfoType != null">#{newsInfoType},</if>
- <if test="newsInfoCarousel != null">#{newsInfoCarousel},</if>
- <if test="newsInfoUrl != null">#{newsInfoUrl},</if>
- <if test="newsInfoAuthorid != null">#{newsInfoAuthorid},</if>
- </trim>
- </insert>
- <update id="updateNewsInfo" parameterType="NewsInfo">
- update news_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="newsInfoTitle != null and newsInfoTitle != ''">news_info_title = #{newsInfoTitle},</if>
- <if test="newsInfoAuthor != null and newsInfoAuthor != ''">news_info_author = #{newsInfoAuthor},</if>
- <if test="newsInfoSource != null">news_info_source = #{newsInfoSource},</if>
- <if test="newsInfoContent != null and newsInfoContent != ''">news_info_content = #{newsInfoContent},</if>
- <if test="newsInfoTime != null">news_info_time = #{newsInfoTime},</if>
- <if test="newsInfoClick != null">news_info_click = #{newsInfoClick},</if>
- <if test="newsInfoInittime != null">news_info_inittime = #{newsInfoInittime},</if>
- <if test="newsInfoType != null">news_info_type = #{newsInfoType},</if>
- <if test="newsInfoCarousel != null">news_info_carousel = #{newsInfoCarousel},</if>
- <if test="newsInfoUrl != null">news_info_url = #{newsInfoUrl},</if>
- <if test="newsInfoAuthorid != null">news_info_authorId = #{newsInfoAuthorid},</if>
- </trim>
- where news_info_id = #{newsInfoId}
- </update>
- <delete id="deleteNewsInfoByNewsInfoId" parameterType="Long">
- delete from news_info where news_info_id = #{newsInfoId}
- </delete>
- <delete id="deleteNewsInfoByNewsInfoIds" parameterType="String">
- delete from news_info where news_info_id in
- <foreach item="newsInfoId" collection="array" open="(" separator="," close=")">
- #{newsInfoId}
- </foreach>
- </delete>
- </mapper>
|