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.Belanjaakun_WS;

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

	@Select({
			"insert into transaksi.belanjaakun (belanjaid, ",
			"kodeakunutama, namaakunutama, ",
			"kodeakunkelompok, namaakunkelompok, ",
			"kodeakunjenis, namaakunjenis, ",
			"kodeakunobjek, namaakunobjek, ",
			"kodeakunrinci, namaakunrinci, ",
			"kodeakunsubrinci, namaakunsubrinci, ",
			"kodeakunsubsubrinci, namaakunsubsubrinci, ",
			"nilaibelanja)",
			"values (#{belanjaid,jdbcType=BIGINT}, ",
			"#{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.nilaibelanja,jdbcType=DOUBLE}) ",
			"returning belanjaakunid"
	})
	long insertBelanjakun(@Param("record") Belanjaakun_WS record, @Param("belanjaid") long belanjaid);



	@Results({
//        @Result(column="belanjaakunid", property="belanjaakunid", jdbcType=JdbcType.BIGINT, id=true),
			@Result(column = "belanjaid", property = "belanjaid", jdbcType = JdbcType.BIGINT),
			@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 = "nilaibelanja", property = "nilaibelanja", jdbcType = JdbcType.DOUBLE)
	})
	List<Belanjaakun_WS> selectByExample();


	@Select({
			"select",
			"belanjaakunid, belanjaid, kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok, ",
			"kodeakunjenis, namaakunjenis, kodeakunobjek, namaakunobjek, kodeakunrinci, namaakunrinci, ",
			"kodeakunsubrinci, namaakunsubrinci, kodeakunsubsubrinci, namaakunsubsubrinci, ",
			"nilaibelanja",
			"from transaksi.belanjaakun",
			"where belanjaakunid = #{belanjaakunid,jdbcType=BIGINT}"
	})
	@Results({
//        @Result(column="belanjaakunid", property="belanjaakunid", jdbcType=JdbcType.BIGINT, id=true),
			@Result(column = "belanjaid", property = "belanjaid", jdbcType = JdbcType.BIGINT),
			@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 = "nilaibelanja", property = "nilaibelanja", jdbcType = JdbcType.DOUBLE)
	})
	Belanjaakun_WS selectByPrimaryKey(Long belanjaakunid);

	
	@Update({
			"update transaksi.belanjaakun",
			"set belanjaid = #{belanjaid,jdbcType=BIGINT},",
			"kodeakunutama = #{kodeakunutama,jdbcType=CHAR},",
			"namaakunutama = #{namaakunutama,jdbcType=VARCHAR},",
			"kodeakunkelompok = #{kodeakunkelompok,jdbcType=CHAR},",
			"namaakunkelompok = #{namaakunkelompok,jdbcType=VARCHAR},",
			"kodeakunjenis = #{kodeakunjenis,jdbcType=CHAR},",
			"namaakunjenis = #{namaakunjenis,jdbcType=VARCHAR},",
			"kodeakunobjek = #{kodeakunobjek,jdbcType=CHAR},",
			"namaakunobjek = #{namaakunobjek,jdbcType=VARCHAR},",
			"kodeakunrinci = #{kodeakunrinci,jdbcType=CHAR},",
			"namaakunrinci = #{namaakunrinci,jdbcType=VARCHAR},",
			"kodeakunsubrinci = #{kodeakunsubrinci,jdbcType=CHAR},",
			"namaakunsubrinci = #{namaakunsubrinci,jdbcType=VARCHAR},",
			"kodeakunsubsubrinci = #{kodeakunsubsubrinci,jdbcType=CHAR},",
			"namaakunsubsubrinci = #{namaakunsubsubrinci,jdbcType=VARCHAR},",
			"nilaibelanja = #{nilaibelanja,jdbcType=DOUBLE}",
			"where belanjaakunid = #{belanjaakunid,jdbcType=BIGINT}"
	})
	int updateByPrimaryKey(Belanjaakun_WS record, long belanjaakunid);

	@Delete({
			"delete from transaksi.belanjaakun",
			"where belanjaid = #{belanjaid,jdbcType=BIGINT}"
	})
	int deleteBelanjaakunByBelanjaid(Long belanjaid);
}