<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE sqlMap   
    PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"   
    "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="com.hst.tmService.dao.BusSsglWjzAppMapper">
	<!--插入数据 -->
	<insert id="insertWsDjhz" parameterClass="com.hst.common.bo.WsDjhz">
		insert into
		WS_DJHZ(WS_DJHZ_XH,NSRSBH,NSRDZDAH,NSR_SWJG_DM,JBDM,
		WS_DM,URL,BCBZ,LSBZ,SSSQQ,
		SSSQZ,HY_DM,SDSSZ_BZ,ZZSQYLX_DM,DJZCLX_DM,
		SWDJBLX_DM,GT_BZ,RWID,CJR_DM,CJRQ,
		XGR_DM,XGRQ,YXBZ,CFTJ,SX_DM,
		SXBZ,XTTS_XH,SSSX_SLXH,WSSLBH,SSSX_DM,URL_EDIT,URL_PRINT,URL_VIEW)
		values(#wsDjhzXh:NUMERIC#,#nsrsbh:VARCHAR#,#nsrdzdah:NUMERIC#,#nsrSwjgDm:VARCHAR#,#jbdm:VARCHAR#,
		#wsDm:VARCHAR#,#url:VARCHAR#,#bcbz:VARCHAR#,#lsbz:VARCHAR#,to_date(#sssqq:DATE#,'yyyy-MM-dd'),
		to_date(#sssqz:DATE#,'yyyy-MM-dd'),#hyDm:VARCHAR#,#sdsszBz:VARCHAR#,#zzsqylxDm:VARCHAR#,#djzclxDm:VARCHAR#,
		#swdjblxDm:VARCHAR#,#gtBz:VARCHAR#,#rwid:NUMERIC#,#cjrDm:VARCHAR#,to_date(#cjrq:DATE#,'yyyy-MM-dd'),
		#xgrDm:VARCHAR#,to_date(#xgrq:DATE#,'yyyy-MM-dd'),#yxbz:VARCHAR#,#cftj:VARCHAR#,#sxDm:VARCHAR#,
		#sxbz:VARCHAR#,#xttsXh:NUMERIC#,#sssxSlxh:NUMERIC#,#wsslbh:VARCHAR#,#sssxDm:VARCHAR#,#urlEdit:VARCHAR#,#urlPrint:VARCHAR#,#urlView:VARCHAR#)
	</insert>

	<!--插入数据 -->
	<insert id="insertSssxSlhz" parameterClass="com.hst.common.bo.SssxSlhz">
		<selectKey keyProperty="sssxSlxh" resultClass="string" type="pre">
			select SEQ_SSSX_SLXH.nextval as sssxSlxh from dual
		</selectKey>
		insert into SSSX_SLHZ(SSSX_SLXH,SSSX_DM,URL,NSRSBH,NSRMC,
		NSRDZDAH,NSR_SWJG_DM,JBDM,LRRQ,SQBZ,
		SQRQ,SLFS,FPFS,SLZT_DM,WS_DJHZ_XH,
		BYSLYJ,SLR_DM,SLRQ,SLR_SWJG_DM,FHBZ,
		FHR_DM,FHRQ,FHR_SWJG_DM,YXBZ,ZFR_DM,
		ZFRQ,CTAIS_DRBZ,CTAIS_WSPZXH,CTAIS_DRR_DM,CTAIS_DRRQ,
		CTAIS_BYZSYY,CTAIS_JKTS,SPJL_XZXM_VALUE_DM,FHJL_XZXM_VALUE_DM,
		LXR_DJXH,YJDZ_DJXX_XH,SQSLFS_DM,SLBH,URL_SWJG,SQRID)
		values(#sssxSlxh:NUMERIC#,#sssxDm:VARCHAR#,#url:VARCHAR#,#nsrsbh:VARCHAR#,#nsrmc:VARCHAR#,
		#nsrdzdah:NUMERIC#,#nsrSwjgDm:VARCHAR#,#jbdm:VARCHAR#,to_date(#lrrq:DATE#,'yyyy-MM-dd'),#sqbz:VARCHAR#,
		to_date(#sqrq:DATE#,'yyyy-MM-dd'),#slfs:VARCHAR#,#fpfs:VARCHAR#,#slztDm:VARCHAR#,#wsDjhzXh:NUMERIC#,
		#byslyj:VARCHAR#,#slrDm:VARCHAR#,to_date(#slrq:DATE#,'yyyy-MM-dd'),#slrSwjgDm:VARCHAR#,#fhbz:VARCHAR#,
		#fhrDm:VARCHAR#,to_date(#fhrq:DATE#,'yyyy-MM-dd'),#fhrSwjgDm:VARCHAR#,#yxbz:VARCHAR#,#zfrDm:VARCHAR#,
		to_date(#zfrq:DATE#,'yyyy-MM-dd'),#ctaisDrbz:VARCHAR#,#ctaisWspzxh:NUMERIC#,#ctaisDrrDm:VARCHAR#,to_date(#ctaisDrrq:DATE#,'yyyy-MM-dd'),
		#ctaisByzsyy:VARCHAR#,#ctaisJkts:VARCHAR#,#spjlXzxmValueDm:VARCHAR#,#fhjlXzxmValueDm:VARCHAR#,
		#lxrDjxh:VARCHAR#,#yjdzDjxxXh:VARCHAR#,#sqslfsDm:VARCHAR#,#slbh:VARCHAR#,#swdOpenUrl:VARCHAR#,#sqrid#)
	</insert>
	<!--插入数据 -->
	<insert id="insertSssxSlsqws" parameterClass="com.hst.common.bo.SssxSlsqws">
		insert into
		SSSX_SLSQWS(SSSX_SLXH,WS_DJHZ_XH)
		values(#sssxSlxh:NUMERIC#,#wsDjhzXh:NUMERIC#)
	</insert>
	
		<!--插入数据-->
	<insert id="insertSssxSlsqSqrxx"  parameterClass="com.hst.common.bo.SssxSlsqSqrxx">
		<selectKey keyProperty="djxxXh" resultClass="String" type="pre"> 
			select SEQ_SSSX_DJXXXH.nextval as djxxXh from dual 
		</selectKey> 
		insert into SSSX_SLSQ_SQRXX(DJXX_XH,NSRBSH,XM,SJHM,GDDH,
		YXBZ,CJRQ)
		values(#djxxXh:NUMERIC#,#nsrbsh:VARCHAR#,#xm:VARCHAR#,#sjhm:VARCHAR#,#gddh:VARCHAR#,
		#yxbz:VARCHAR#,to_date(#cjrq:DATE#,'yyyy-MM-dd'))
	</insert>
	<select id="selectSssxSlsqSqrxxByXX" parameterClass="java.util.Map"
		resultClass="com.hst.common.bo.SssxSlsqSqrxx">
		select a.DJXX_XH as djxxXh,a.NSRBSH as nsrbsh,a.XM as xm,a.SJHM as sjhm,a.GDDH as gddh,
		a.YXBZ as yxbz,a.CJRQ as cjrq from SSSX_SLSQ_SQRXX a  where 
		 a.nsrbsh = #nsrbsh#
		 <isNotEmpty prepend="and" property="xm">
		 	a.xm=#xm#
		 </isNotEmpty>
		 <isNotEmpty prepend="and" property="gddh">
		 	a.gddh=#gddh#
		 </isNotEmpty>
		 <isNotEmpty prepend="and" property="sjhm">
		 	a.sjhm=#sjhm#
		 </isNotEmpty>
    </select>
	
	<!--根据主键更新该表中其它所有字段-->
    <update id="updateSssxSlsqSqrxxByKey" parameterClass="com.hst.common.bo.SssxSlsqSqrxx">
        update SSSX_SLSQ_SQRXX set DJXX_XH=#djxxXh#,NSRBSH=#nsrbsh#,XM=#xm#,SJHM=#sjhm#,GDDH=#gddh#,
		YXBZ=#yxbz#,CJRQ=to_date(#cjrq#, 'YYYY-MM-DD') where DJXX_XH=#djxxXh#
    </update>
    
    
     <select id="getNsrxxByNsrsbh" parameterClass="java.util.Map"
		resultClass="com.hst.common.domain.NsrxxDomain">
		SELECT  A.NSRMC nsrmc,A.NSRSBH nsrsbh,A.NSR_SWJG_DM nsrSwjgDm ,A.ZJHM zjhm ,B.JBDM jbdm,  B.Swjg_Mc  nsrSwjgMc , NSRDZDAH nsrdzdah 
		FROM CTAIS2.DJ_NSRXX A,CTAIS2.DM_SWJG B
        WHERE A.NSR_SWJG_DM=B.SWJG_DM
        AND A.NSRSBH=#nsrsbh#
        AND B.XYBZ='Y'
        AND B.YXBZ='Y'
    </select>
	<!--插入数据 -->
	<insert id="insertWsDjWjzkjsq" parameterClass="com.hst.common.bo.WsDjWjzkjsq">
		INSERT INTO WS_DJ_WJZKJSQ 
				(WS_DJHZ_XH,NSRSBH,NSRMC,FRXM,SFZJMC,SFZJHM,LXR,LXDH,DJZCLX_MC,SWDJD,WCJYDLX,WCJYD,
					YXQ_Q,YXQ_Z,JYFS,XMMC,HTJE,SQRQ,YXBZ )
		values	(#wsDjhzXh#,#nsrsbh#,#nsrmc#,#frxm#,#sfzjmc#,#sfzjhm#,#lxr#,#lxdh#,#djzclxMc#,#swdjd#,#wcjydlx#,#wcjyd#,
					to_date(#yxqQ#,'yyyy-mm-dd'),to_date(#yxqZ#,'yyyy-mm-dd'),#jyfs#,#xmmc#,#htje#,sysdate,#yxbz#)
	</insert>
	
		<!--插入数据 -->
	<insert id="insertWsDjWjzkjsqZb" parameterClass="com.hst.common.bo.WsDjWjzkjsqZb">
		insert into
		WS_DJ_WJZKJSQ_ZB(WS_DJHZ_XH,XH,XMLX,SL,DD,JE,MC)
		values(#wsDjhzXh#,#xh#,#xmlx#,#sl#,#dd#,#je#,#mc#)
	</insert>
</sqlMap>