AdsDimFinancialYearWeekInfoDao.xml 2.5 KB
Newer Older
Q
qinyingjie 已提交
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 33 34
<?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.kwan.springbootkwan.mapper.AdsDimFinancialYearWeekInfoDao">

    <resultMap type="com.kwan.springbootkwan.entity.AdsDimFinancialYearWeekInfo" id="AdsDimFinancialYearWeekInfoMap">
        <result property="financialYear" column="financial_year" jdbcType="INTEGER"/>
        <result property="financialYearWeek" column="financial_year_week" jdbcType="INTEGER"/>
        <result property="financialYearStart" column="financial_year_start" jdbcType="TIMESTAMP"/>
        <result property="financialYearEnd" column="financial_year_end" jdbcType="TIMESTAMP"/>
        <result property="weekStartDay" column="week_start_day" jdbcType="TIMESTAMP"/>
        <result property="weekEndDay" column="week_end_day" jdbcType="TIMESTAMP"/>
        <result property="weekInSeason" column="week_in_season" jdbcType="INTEGER"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="" useGeneratedKeys="true">
        insert into kwan.ads_dim_financial_year_week_info(financial_year, financial_year_week, financial_year_start, financial_year_end, week_start_day, week_end_day, week_in_season)
        values
        <foreach collection="entities" item="entity" separator=",">
        (#{entity.financialYear}, #{entity.financialYearWeek}, #{entity.financialYearStart}, #{entity.financialYearEnd}, #{entity.weekStartDay}, #{entity.weekEndDay}, #{entity.weekInSeason})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
        insert into kwan.ads_dim_financial_year_week_info(financial_year, financial_year_week, financial_year_start, financial_year_end, week_start_day, week_end_day, week_in_season)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.financialYear}, #{entity.financialYearWeek}, #{entity.financialYearStart}, #{entity.financialYearEnd}, #{entity.weekStartDay}, #{entity.weekEndDay}, #{entity.weekInSeason})
        </foreach>
        on duplicate key update
         financial_year = values(financial_year) , financial_year_week = values(financial_year_week) , financial_year_start = values(financial_year_start) , financial_year_end = values(financial_year_end) , week_start_day = values(week_start_day) , week_end_day = values(week_end_day) , week_in_season = values(week_in_season)     </insert>

</mapper>