1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <insert id="insertOrUpdateNewsBody" parameterType="com.easy.dataCenter.bean.pojo.AiNewsBody" useGeneratedKeys="true"> INSERT INTO `test` (`id`,`news_id`, `news_publish_time`, `news_publish_site`,`news_title`, `news_body`, `quota`, `news_message_id`,`news_store_time`, `create_time`) VALUES ( ${@com.baomidou.mybatisplus.core.toolkit.IdWorker@getId()}, #{newsBody.newsId}, #{newsBody.newsPublishTime}, #{newsBody.newsPublishSite}, #{newsBody.newsTitle}, #{newsBody.newsBody}, #{newsBody.quota}, #{newsBody.newsMessageId}, #{newsBody.newsStoreTime}, #{newsBody.createTime}) ON DUPLICATE KEY UPDATE <if test="newsBody.newsPublishTime != null and newsBody.newsPublishTime != ''"> `news_publish_time` = #{newsBody.newsPublishTime}, </if> <if test="newsBody.newsPublishSite != null and newsBody.newsPublishSite != ''"> `news_publish_site` = #{newsBody.newsPublishSite}, </if> <if test="newsBody.newsTitle != null and newsBody.newsTitle != ''"> `news_title` = #{newsBody.newsTitle}, </if> <if test="newsBody.newsBody != null and newsBody.newsBody != ''"> `news_body`=#{newsBody.newsBody}, </if> <if test="newsBody.quota != null and newsBody.quota != ''"> `quota` = #{newsBody.quota} </if> </insert>
|