<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="CrmMatZcServer.Query" desc="crm库存信息查询">
		<![CDATA[
			 SELECT
				   T.MAT_NO,
				   T.PRODUCT_FLAG,
				   T.MAT_STATUS,
				   T.LOT_NO,
				   T.STOVE_NO,
				   T.JUDGE_STOVE_NO,
				   T.BATCH_NO,
				   T.BATCH_GROUD_NO,
				   T.MATERIAL_NO,
				   T.MATERIAL_NAME,
				   T.PRODUCCODE,
				   T.PRODUCNAME,
				   T.STEELCODE,
				   T.STEELNAME,
				   T.GRADECODE,
				   T.GRADENAME,
				   T.SPEC_CODE,
				   T.SPEC_NAME,
				   T.MODEL_CODE,
				   T.MODEL_DESC,
				   T.STD_CODE,
				   T.STD_NAME,
				   T.STD_STYLE,
				   T.STD_STYLE_DESC,
				   T.PRO_ORDER_NO,
				   T.ORDER_NO,
				   T.ORDER_SEQ,
				   T.ORDER_SEQ_NO,
				   T.ORD_PK,
				   T.ORD_LN_PK,
				   T.ORD_LN_DLY_PK,
				   T.PLINE_CODE,
				   T.PLINE_NAME,
				   T.ACT_DIMATER,
				   T.ACT_HEIGHT,
				   T.ACT_LEN,
				   T.ACT_LEN_MIN,
				   T.ACT_LEN_MAX,
				   T.ACT_COUNT,
				   T.ACT_WEIGHT,
				   T.BELONG_CODE,
				   T.BELONG_NAME,
				   T.IN_MOLD,
				   TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME,
				   T.STORAGE_NO,
				   T.LOCATION_NO,
				   T.STORAGE_NAME,
				   T.LOCATION_NAME,
				   DECODE(T.DATA_STATUS, '0', '新增', '1', '修改', '2','删除') DATA_STATUS,
				   DECODE(T.IS_FLAG, '0', '未同步', '1', '已同步', '2', 'crm数据问题', '3', '产销数据问题', '4', '数据过滤') IS_FLAG,
				   TO_CHAR(T.SYNCHRO_TIME, 'YYYY-MM-DD HH24:MI:SS') SYNCHRO_TIME,
				   T.SUPPLY_UNIT_CODE,
				   T.SUPPLY_UNIT,
				   T.PROBLEM_MSG,
				   TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
				   T.INITIAL_ID
			 FROM CRM_MAT_ZC T
			 WHERE
				1 = 1
		]]>
	</query>

	<query id="CrmMatZcServer.updateIsFlag" desc="修改crm同步状态">
		<![CDATA[
			UPDATE CRM_MAT_ZC SET IS_FLAG = '0' WHERE INITIAL_ID = ?
		]]>
	</query>
</queryMap>