<?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.jkcredit.invoice.mapper.calculateinfor.MounthAccMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.calculate.MounthAcc">
        <id column="id" property="id"/>
        <result column="customerId" property="customerId"/>
        <result column="companyName" property="companyName"/>
        <result column="waybillNum" property="waybillNum"/>
        <result column="tradeId" property="tradeId"/>
        <result column="fee" property="fee"/>
        <result column="exTime" property="exTime"/>
        <result column="buyerName" property="buyerName"/>
        <result column="buyerTaxpayerCode" property="buyerTaxpayerCode"/>
        <result column="enStation" property="enStation"/>
        <result column="exStation" property="exStation"/>
    </resultMap>
    <select id="selectAllMounthAcc" resultMap="BaseResultMap">
        select
        <include refid="baseSql" />
        from  t_mouth_cal
    </select>
    <sql id="baseSql">
        id,
         customerId,
          companyName,
          waybillNum,
          tradeId,
          fee,
          exTime,
          buyerName,
          buyerTaxpayerCode,
          enStation,
          exStation
    </sql>
    <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.calculate.MounthAcc" >
        insert into t_mouth_cal (
         customerId,
          companyName,
          waybillNum,
          tradeId,
          fee,
          exTime,
          buyerName,
          buyerTaxpayerCode,
          enStation,
          exStation
        )
        values ( #{customerId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},#{waybillNum,jdbcType=VARCHAR},
        #{tradeId,jdbcType=VARCHAR}, #{fee,jdbcType=DOUBLE},#{exTime,jdbcType=VARCHAR}
        ,#{buyerName,jdbcType=VARCHAR},#{buyerTaxpayerCode,jdbcType=VARCHAR},#{enStation,jdbcType=VARCHAR},#{exStation,jdbcType=VARCHAR}
        )
    </insert>
    <delete id="deleteAll">
        delete from t_mouth_cal where 1=1
    </delete>
</mapper>
