<?php

//===GET===
$sql['get_count'] = "
	SELECT
	   COUNT(jenisKdpId) AS total
	FROM 
	   aset_kdp_ref_jenis_kdp
	WHERE
	   jenisKdpKode LIKE %s
	   OR
	   jenisKdpNama LIKE %s
	LIMIT 1
   ";   


$sql['get_data']= "
	SELECT
	   jenisKdpId AS ID,
	   jenisKdpKode AS KODE,
	   jenisKdpNama AS NAMA	
	FROM 
	   aset_kdp_ref_jenis_kdp
	WHERE
	   jenisKdpKode LIKE %s
	   OR
	   jenisKdpNama LIKE %s
	ORDER BY jenisKdpKode
	LIMIT %s, %s
";

$sql['get_data_by_id']="
	SELECT
	   jenisKdpId   AS ID,
	   jenisKdpKode AS KODE_JENIS,
	   jenisKdpNama AS NAMA_JENIS			
	FROM 
	   aset_kdp_ref_jenis_kdp
	WHERE
	   jenisKdpId = %s   
	LIMIT 1
";


//===DO===

$sql['do_add_jenis_kdp'] = "
	INSERT INTO aset_kdp_ref_jenis_kdp
	SET 
		jenisKdpKode = %s,
		jenisKdpNama = %s,
		jenisKdpUserId = %d      
";

$sql['do_delete_satuan'] = "
   DELETE FROM aset_kdp_ref_jenis_kdp 
   WHERE
    jenisKdpId = %s
";

$sql['do_delete_banyak'] ="
	DELETE FROM aset_kdp_ref_jenis_kdp
	WHERE jenisKdpKode IN (%s)
";

$sql['do_update_jenis_kdp'] = "
	UPDATE aset_kdp_ref_jenis_kdp
	SET
		jenisKdpKode = '%s',
		jenisKdpNama = '%s'
    WHERE jenisKdpKode = '%s'	
";

$sql['cek_kode'] = "
	SELECT jenisKdpKode
	FROM aset_kdp_ref_jenis_kdp
	WHERE jenisKdpKode = '%s'
";
?>
