package sikd.sikd5.sikd5ejb.mapper.transaksi;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import sikd.sikd5.sikd5bean.ws.transaksi.Apbd_WS;

@SuppressWarnings("el-syntax")
public interface ApbddetilakunMapper {
 
    @Delete({
        "delete from transaksi.apbddetilakun",
        "where apbddetilakunid = #{apbddetilakunid,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long apbddetilakunid);

  
    @Insert({
        "insert into transaksi.apbddetilakun (apbddetilid, ",
        "kodekelompokurusan, namakelompokurusan, ",
        "kodeurusan, namaurusan, ",
        "kodeunitorganisasi, namaunitorganisasi, ",
        "kodesubunitorganisasi, namasubunitorganisasi, ",
        "kodeskpd, namaskpd, ",
        "kodeprogram, namaprogram, ",
        "kodekegiatan, namakegiatan, ",
        "kodepaketkegiatan, namapaketkegiatan, ",
        "kodeoutput, namaoutput, ",
        "satuanoutput, volumeoutput, ",
        "kodefungsi, namafungsi, ",
        "kodeakunutama, namaakunutama, ",
        "kodeakunkelompok, namaakunkelompok, ",
        "kodeakunjenis, namaakunjenis, ",
        "kodeakunobjek, namaakunobjek, ",
        "kodeakunrinci, namaakunrinci, ",
        "kodeakunsubrinci, namaakunsubrinci, ",
        "kodeakunsubsubrinci, namaakunsubsubrinci, ",
        "volume, satuan, hargasatuan, ",
        "nilaianggaran)",
        "values (#{apbddetilid,jdbcType=BIGINT}, ",
        "#{record.kodekelompokurusan,jdbcType=CHAR},  #{record.namakelompokurusan,jdbcType=VARCHAR}, ",
        "#{record.kodeurusan,jdbcType=CHAR},  #{record.namaurusan,jdbcType=VARCHAR}, ",
        "#{record.kodeunitorganisasi,jdbcType=CHAR}, #{record.namaunitorganisasi,jdbcType=VARCHAR}, ",
        "#{record.kodesubunitorganisasi,jdbcType=CHAR}, #{record.namasubunitorganisasi,jdbcType=VARCHAR}, ",
        "#{record.kodeskpd,jdbcType=CHAR}, #{record.namaskpd,jdbcType=VARCHAR}, ",
        "#{record.kodeprogram,jdbcType=CHAR}, #{record.namaprogram,jdbcType=VARCHAR}, ",
        "#{record.kodekegiatan,jdbcType=CHAR}, #{record.namakegiatan,jdbcType=VARCHAR}, ",
        "#{record.kodepaketkegiatan,jdbcType=CHAR}, #{record.namapaketkegiatan,jdbcType=VARCHAR}, ",
        "#{record.kodeoutput,jdbcType=CHAR}, #{record.namaoutput,jdbcType=VARCHAR}, ",
        "#{record.satuanoutput,jdbcType=VARCHAR}, #{record.volumeoutput,jdbcType=DOUBLE}, ",
        "#{record.kodefungsi,jdbcType=CHAR}, #{record.namafungsi,jdbcType=VARCHAR}, ",
        "#{record.kodeakunutama,jdbcType=CHAR}, #{record.namaakunutama,jdbcType=VARCHAR}, ",
        "#{record.kodeakunkelompok,jdbcType=CHAR}, #{record.namaakunkelompok,jdbcType=VARCHAR}, ",
        "#{record.kodeakunjenis,jdbcType=CHAR}, #{record.namaakunjenis,jdbcType=VARCHAR}, ",
        "#{record.kodeakunobjek,jdbcType=CHAR}, #{record.namaakunobjek,jdbcType=VARCHAR}, ",
        "#{record.kodeakunrinci,jdbcType=CHAR}, #{record.namaakunrinci,jdbcType=VARCHAR}, ",
        "#{record.kodeakunsubrinci,jdbcType=CHAR}, #{record.namaakunsubrinci,jdbcType=VARCHAR}, ",
        "#{record.kodeakunsubsubrinci,jdbcType=CHAR}, #{record.namaakunsubsubrinci,jdbcType=VARCHAR}, ",
        "#{record.volume,jdbcType=DOUBLE}, #{record.satuan,jdbcType=VARCHAR}, #{record.hargasatuan,jdbcType=DOUBLE}, ",
        "#{record.nilaianggaran,jdbcType=DOUBLE})"
    })
    int insert(@Param("record") Apbd_WS record,@Param("apbddetilid") long apbddetilid);


    @Select({
        "select",
        "apbddetilakunid, apbddetilid, kodekelompokurusan, namakelompokurusan, kodeurusan, ",
        "namaurusan, kodeunitorganisasi, namaunitorganisasi, kodesubunitorganisasi, namasubunitorganisasi, ",
        "kodeskpd, namaskpd, kodeprogram, namaprogram, kodekegiatan, namakegiatan, kodepaketkegiatan, ",
        "namapaketkegiatan, kodeoutput, namaoutput, satuanoutput, volumeoutput, kodefungsi, ",
        "namafungsi, kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok, ",
        "kodeakunjenis, namaakunjenis, kodeakunobjek, namaakunobjek, kodeakunrinci, namaakunrinci, ",
        "kodeakunsubrinci, namaakunsubrinci, kodeakunsubsubrinci, namaakunsubsubrinci, ",
        "volume, satuan, hargasatuan, nilaianggaran",
        "from transaksi.apbddetilakun",
        "where apbddetilakunid = #{apbddetilakunid,jdbcType=BIGINT}"
    })
    @Results({
//        @Result(column="apbddetilakunid", property="apbddetilakunid", jdbcType=JdbcType.BIGINT, id=true),
//        @Result(column="apbddetilid", property="apbddetilid", jdbcType=JdbcType.BIGINT),
        @Result(column="kodekelompokurusan", property="kodekelompokurusan", jdbcType=JdbcType.CHAR),
        @Result(column="namakelompokurusan", property="namakelompokurusan", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeurusan", property="kodeurusan", jdbcType=JdbcType.CHAR),
        @Result(column="namaurusan", property="namaurusan", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeunitorganisasi", property="kodeunitorganisasi", jdbcType=JdbcType.CHAR),
        @Result(column="namaunitorganisasi", property="namaunitorganisasi", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodesubunitorganisasi", property="kodesubunitorganisasi", jdbcType=JdbcType.CHAR),
        @Result(column="namasubunitorganisasi", property="namasubunitorganisasi", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeskpd", property="kodeskpd", jdbcType=JdbcType.CHAR),
        @Result(column="namaskpd", property="namaskpd", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeprogram", property="kodeprogram", jdbcType=JdbcType.CHAR),
        @Result(column="namaprogram", property="namaprogram", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodekegiatan", property="kodekegiatan", jdbcType=JdbcType.CHAR),
        @Result(column="namakegiatan", property="namakegiatan", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodepaketkegiatan", property="kodepaketkegiatan", jdbcType=JdbcType.CHAR),
        @Result(column="namapaketkegiatan", property="namapaketkegiatan", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeoutput", property="kodeoutput", jdbcType=JdbcType.CHAR),
        @Result(column="namaoutput", property="namaoutput", jdbcType=JdbcType.VARCHAR),
        @Result(column="satuanoutput", property="satuanoutput", jdbcType=JdbcType.VARCHAR),
        @Result(column="volumeoutput", property="volumeoutput", jdbcType=JdbcType.DOUBLE),
        @Result(column="kodefungsi", property="kodefungsi", jdbcType=JdbcType.CHAR),
        @Result(column="namafungsi", property="namafungsi", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunutama", property="kodeakunutama", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunutama", property="namaakunutama", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunkelompok", property="kodeakunkelompok", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunkelompok", property="namaakunkelompok", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunjenis", property="kodeakunjenis", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunjenis", property="namaakunjenis", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunobjek", property="kodeakunobjek", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunobjek", property="namaakunobjek", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunrinci", property="kodeakunrinci", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunrinci", property="namaakunrinci", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunsubrinci", property="kodeakunsubrinci", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunsubrinci", property="namaakunsubrinci", jdbcType=JdbcType.VARCHAR),
        @Result(column="kodeakunsubsubrinci", property="kodeakunsubsubrinci", jdbcType=JdbcType.CHAR),
        @Result(column="namaakunsubsubrinci", property="namaakunsubsubrinci", jdbcType=JdbcType.VARCHAR),
        @Result(column="volume", property="volume", jdbcType=JdbcType.DOUBLE),
        @Result(column="satuan", property="satuan", jdbcType=JdbcType.VARCHAR),
        @Result(column="hargasatuan", property="hargasatuan", jdbcType=JdbcType.DOUBLE),
        @Result(column="nilaianggaran", property="nilaianggaran", jdbcType=JdbcType.DOUBLE)
    })
    Apbd_WS selectByPrimaryKey(Long apbddetilakunid);

   
    @Update({
         "update transaksi.apbddetilakun",
//         "set apbddetilid = #{record.apbddetilid,jdbcType=BIGINT},",
          "kodekelompokurusan = #{record.kodekelompokurusan,jdbcType=CHAR},",
          "namakelompokurusan = #{record.namakelompokurusan,jdbcType=VARCHAR},",
          "kodeurusan = #{record.kodeurusan,jdbcType=CHAR},",
          "namaurusan = #{record.namaurusan,jdbcType=VARCHAR},",
          "kodeunitorganisasi = #{record.kodeunitorganisasi,jdbcType=CHAR},",
          "namaunitorganisasi = #{record.namaunitorganisasi,jdbcType=VARCHAR},",
          "kodesubunitorganisasi = #{record.kodesubunitorganisasi,jdbcType=CHAR},",
          "namasubunitorganisasi = #{record.namasubunitorganisasi,jdbcType=VARCHAR},",
          "kodeskpd = #{record.kodeskpd,jdbcType=CHAR},",
          "namaskpd = #{record.namaskpd,jdbcType=VARCHAR},",
          "kodeprogram = #{record.kodeprogram,jdbcType=CHAR},",
          "namaprogram = #{record.namaprogram,jdbcType=VARCHAR},",
          "kodekegiatan = #{record.kodekegiatan,jdbcType=CHAR},",
          "namakegiatan = #{record.namakegiatan,jdbcType=VARCHAR},",
          "kodepaketkegiatan = #{record.kodepaketkegiatan,jdbcType=CHAR},",
          "namapaketkegiatan = #{record.namapaketkegiatan,jdbcType=VARCHAR},",
          "kodeoutput = #{record.kodeoutput,jdbcType=CHAR},",
          "namaoutput = #{record.namaoutput,jdbcType=VARCHAR},",
          "satuanoutput = #{record.satuanoutput,jdbcType=VARCHAR},",
          "volumeoutput = #{record.volumeoutput,jdbcType=DOUBLE},",
          "kodefungsi = #{record.kodefungsi,jdbcType=CHAR},",
          "namafungsi = #{record.namafungsi,jdbcType=VARCHAR},",
          "kodeakunutama = #{record.kodeakunutama,jdbcType=CHAR},",
          "namaakunutama = #{record.namaakunutama,jdbcType=VARCHAR},",
          "kodeakunkelompok = #{record.kodeakunkelompok,jdbcType=CHAR},",
          "namaakunkelompok = #{record.namaakunkelompok,jdbcType=VARCHAR},",
          "kodeakunjenis = #{record.kodeakunjenis,jdbcType=CHAR},",
          "namaakunjenis = #{record.namaakunjenis,jdbcType=VARCHAR},",
          "kodeakunobjek = #{record.kodeakunobjek,jdbcType=CHAR},",
          "namaakunobjek = #{record.namaakunobjek,jdbcType=VARCHAR},",
          "kodeakunrinci = #{record.kodeakunrinci,jdbcType=CHAR},",
          "namaakunrinci = #{record.namaakunrinci,jdbcType=VARCHAR},",
          "kodeakunsubrinci = #{record.kodeakunsubrinci,jdbcType=CHAR},",
          "namaakunsubrinci = #{record.namaakunsubrinci,jdbcType=VARCHAR},",
          "kodeakunsubsubrinci = #{record.kodeakunsubsubrinci,jdbcType=CHAR},",
          "namaakunsubsubrinci = #{record.namaakunsubsubrinci,jdbcType=VARCHAR},",
          "volume = #{record.volume,jdbcType=DOUBLE},",
          "satuan = #{record.satuan,jdbcType=VARCHAR},",
          "hargasatuan = #{record.hargasatuan,jdbcType=DOUBLE},",
          "nilaianggaran = #{record.nilaianggaran,jdbcType=DOUBLE}",
        "where apbddetilakunid = #{apbddetilakunid,jdbcType=BIGINT}"
    })
    
    int updateByPrimaryKey(@Param("record") Apbd_WS record,@Param("apbddetiltakunid") long apbddetiltakunid);
}