qirong
2023-04-07 a499e5a737991461554805af6b72fba65a680776
ycl-platform/src/main/resources/mapper/NewsChannelDao.xml
@@ -1,6 +1,6 @@
<?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.ycl.dao.NewsChannelDao">
<mapper namespace="com.ycl.mapper.NewsChannelDao">
    <resultMap type="com.ycl.entity.NewsChannel" id="NewsChannelMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
@@ -25,7 +25,16 @@
            (#{entity.name}, #{entity.code}, #{entity.createTime})
        </foreach>
        on duplicate key update
         name = values(name) , code = values(code) , create_time = values(create_time)     </insert>
         name = values(name) , code = values(code) , create_time = values(create_time)
    </insert>
    <insert id="insertOneChannel" keyProperty="id" useGeneratedKeys="true">
        insert into news_website.news_channel(name, code, create_time)
        values (#{entity.name}, #{entity.code}, #{entity.createTime})
    </insert>
    <select id="selectAllChannel" resultType="com.ycl.entity.NewsChannel">
        select * from news_channel
    </select>
</mapper>