<?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.hzya.frame.plugin.lets.dao.impl.IntegrationTaskLivingDetailsDaoImplV2">

    <resultMap id="get-IntegrationTaskLivingDetailsEntity-result" type="com.hzya.frame.plugin.lets.entity.IntegrationTaskLivingDetailsEntityV2" >
       <result property="id" column="id" jdbcType="VARCHAR"/>
           <result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/>
           <result property="result" column="result" jdbcType="VARCHAR"/>
           <result property="queryCondition" column="query_condition" jdbcType="VARCHAR"/>
           <result property="rootAppPk" column="root_app_pk" jdbcType="VARCHAR"/>
           <result property="rootAppBill" column="root_app_bill" jdbcType="VARCHAR"/>
           <result property="rootAppNewData" column="root_app_new_data" jdbcType="VARCHAR"/>
           <result property="newTransmitInfo" column="new_transmit_info" jdbcType="VARCHAR"/>
           <result property="newPushDate" column="new_push_date" jdbcType="TIMESTAMP"/>
           <result property="repairPust" column="repair_pust" jdbcType="VARCHAR"/>
           <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
           <result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
           <result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
           <result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
           <result property="sts" column="sts" jdbcType="VARCHAR"/>
           <result property="sorts" column="sorts" jdbcType="INTEGER"/>
           <result property="senceId" column="sence_id" jdbcType="VARCHAR"/>
           <result property="newState" column="new_state" jdbcType="VARCHAR"/>
           <result property="businessDate" column="business_date" jdbcType="VARCHAR"/>
           <result property="pluginId" column="plugin_id" jdbcType="VARCHAR"/>
           <result property="processingTime" column="processing_time" jdbcType="TIMESTAMP"/>
           <result property="processingRemarks" column="processing_remarks" jdbcType="VARCHAR"/>
           <result property="processorName" column="processor_name" jdbcType="VARCHAR"/>
           <result property="processor" column="processor" jdbcType="VARCHAR"/>
           <result property="newSystemNumber" column="new_system_number" jdbcType="VARCHAR"/>
           <result property="newSystemPrimary" column="new_system_primary" jdbcType="VARCHAR"/>
        </resultMap>

    <!-- 查询的字段-->
    <sql id = "IntegrationTaskLivingDetailsEntity_Base_Column_List">
        id
       ,task_linving_id 
        ,result 
        ,query_condition 
        ,root_app_pk 
        ,root_app_bill 
        ,root_app_new_data 
        ,new_transmit_info 
        ,new_push_date 
        ,repair_pust 
        ,create_time 
        ,create_user_id 
        ,modify_time 
        ,modify_user_id 
        ,sts 
        ,sorts 
        ,sence_id 
        ,new_state 
        ,business_date 
        ,plugin_id 
        ,processing_time 
        ,processing_remarks 
        ,processor_name 
        ,processor 
        ,new_system_number 
        ,new_system_primary 
     </sql>

<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
  insert into integration_task_living_details(id,new_state,root_app_new_data,new_transmit_info,new_push_date,business_date,plugin_id,root_app_pk,root_app_bill,create_time,modify_time,sts,new_system_primary,new_system_number)
    values
    <foreach collection="list" item="entity" separator=",">
    (#{entity.id},#{entity.new_state},#{entity.root_app_new_data},#{entity.new_transmit_info},#{entity.new_push_date},#{entity.business_date},#{entity.plugin_id},#{entity.root_app_pk},#{entity.root_app_bill},NOW(),NOW(),'Y',#{entity.new_system_primary},#{entity.new_system_number})
    </foreach>
</insert>

<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
    insert into integration_task_living_details(id,new_state,root_app_new_data,new_transmit_info,new_push_date,business_date,plugin_id,root_app_pk,root_app_bill,create_time,modify_time,sts,new_system_primary,new_system_number)
    values
    <foreach collection="list" item="entity" separator=",">
        (#{entity.id},#{entity.new_state},#{entity.root_app_new_data},#{entity.new_transmit_info},#{entity.new_push_date},#{entity.business_date},#{entity.plugin_id},#{entity.root_app_pk},#{entity.root_app_bill},NOW(),NOW(),'Y',#{entity.new_system_primary},#{entity.new_system_number})
    </foreach>
    on duplicate key update
    id = values(id),
    root_app_pk = values(root_app_pk),
    root_app_bill = values(root_app_bill),
    root_app_new_data = values(root_app_new_data),
    new_transmit_info = values(new_transmit_info),
    new_push_date = values(new_push_date),
    create_time = values(create_time),
    modify_time = values(modify_time),
    sts = values(sts),
    new_state = values(new_state),
    business_date = values(business_date),
    plugin_id = values(plugin_id),
    new_system_primary = values(new_system_primary),
    new_system_number = values(new_system_number)
</insert>
</mapper>

