<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc=" ">
	<query id="SlmGlPay.query" desc="获取数据">
		SELECT
		T.PAY_NO,
		T.PAY_TYPE_CODE,
		T.PAY_TYPE_DESC,
		T.PAY_VALUE,
		T.INVOICE_NO,
		(SELECT BASENAME FROM COM_BASE_INFO  WHERE VALIDFLAG='1' AND BASECODE = T.PAY_NM) PAY_NM,
		(SELECT BASENAME FROM COM_BASE_INFO  WHERE VALIDFLAG='1' AND BASECODE = T.REC_NM) REC_NM,
		T.BAL_YEAR_MONTH,
		T.VALIDFLAG,
		T.REMARK,
		T.CREATE_USERID,
		T.CREATE_NAME,
		TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
		T.UPDATE_USERID,
		T.UPDATE_NAME,
		TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
		T.DELETE_USERID,
		T.DELETE_NAME,
		TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME
		FROM SLM_GL_PAY T
		WHERE 1=1
		 AND T.VALIDFLAG = '10'
	</query>

	<query id="SlmGlPay.queryCount" desc="获取数据">
		SELECT
		COUNT(*)
		FROM SLM_GL_PAY T
		WHERE 1=1 AND TO_CHAR(T.CREATE_TIME, 'yyyyMMdd') = TO_CHAR(SYSDATE, 'yyyyMMdd')
	</query>

	<query id="SlmGlPay.insert" desc="新增数据">
		INSERT INTO SLM_GL_PAY(
		PAY_NO,
		PAY_TYPE_CODE,
		PAY_TYPE_DESC,
		PAY_VALUE,
		INVOICE_NO,
		PAY_NM,
		REC_NM,
		BAL_YEAR_MONTH,
		VALIDFLAG,
		REMARK,
		CREATE_USERID,
		CREATE_NAME,
		CREATE_TIME
		)
		VALUES(
		?,
		?,
		?,
		?,
		?,
		?,
		?,
		TO_CHAR(SYSDATE, 'yyyyMM'),
		'10',
		?,
		?,
		?,
		SYSDATE
		)
	</query>

	<query id="SlmGlPay.delete" desc="废除">
		UPDATE SLM_GL_PAY T
		SET
		T.VALIDFLAG = '00',
		T.DELETE_USERID = ?,
		T.DELETE_NAME = ?,
		T.DELETE_TIME = SYSDATE
		WHERE
		1=1
		AND T.PAY_NO = ?
	</query>

	<query id="SlmGlPay.queryBase" desc="查询制造商">
		SELECT T.BASECODE,T.BASENAME FROM COM_BASE_INFO T WHERE T.VALIDFLAG='1'
	</query>
</queryMap>