RegBusSjhjtableDao.xml 9.64 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.thinkgem.jeesite.modules.reg.dao.updata.RegBusSjhjtableDao">
    
	<sql id="regBusSjhjtableColumns">
		a.bizmsgid AS "bizmsgid",
		a.asid AS "asid",
		a.areacode AS "areacode",
		a.rectype AS "rectype",
		a.righttype AS "righttype",
		a.regtype AS "regtype",
		a.createdate AS "createdate",
		a.recflowid AS "recflowid",
		a.regorgid AS "regorgid",
		a.parcelid AS "parcelid",
		a.estatenum AS "estatenum",
		a.preestatenum AS "preestatenum",
		a.precertid AS "precertid",
		a.certcount AS "certcount",
		a.proofcount AS "proofcount",
		a.digitalsign AS "digitalsign",
		a.issuccess AS "issuccess",
		a.exption AS "exption"
	</sql>
	
	<sql id="regBusSjhjtableJoins">
	</sql>
    
	<select id="get" resultType="RegBusSjhjtable">
		SELECT 
			<include refid="regBusSjhjtableColumns"/>
		FROM reg_bus_sjhjtable a
		<include refid="regBusSjhjtableJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusSjhjtable">
		SELECT 
			<include refid="regBusSjhjtableColumns"/>
		FROM reg_bus_sjhjtable a
		<include refid="regBusSjhjtableJoins"/>
		<where>
			<if test="asid != null and asid != ''">
				AND a.asid = #{asid}
			</if>
			<if test="rectype != null and rectype != ''">
				AND a.rectype = #{rectype}
			</if>
			<if test="areacode != null and areacode != ''">
				AND a.areacode = #{areacode}
			</if>
			<if test="recflowid != null and recflowid != ''">
				AND a.recflowid = #{recflowid}
			</if>
			<if test="estatenum != null and estatenum != ''">
				AND a.estatenum = #{estatenum}
			</if>
		</where>
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
			</otherwise>
		</choose>
	</select>
	
	<select id="findAllList" resultType="RegBusSjhjtable">
		SELECT 
			<include refid="regBusSjhjtableColumns"/>
		FROM reg_bus_sjhjtable a
		<include refid="regBusSjhjtableJoins"/>
		<where>
			
		</where>		
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
			</otherwise>
		</choose>
	</select>
	
	
	<select id="allnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate)  and areacode = #{areacode} and issuccess != '2' 
	</select>
	<select id="scnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype in ('1000101','1000301','1000401','1000402','1000403','1000501','1000601','1000901','1001201') and areacode = #{areacode} and issuccess != '2' 
	</select>
	<select id="zynum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype in ('2000101','2000301','2000401','2000402','2000403','2000501','2000601','2000901','2001201') and areacode = #{areacode}  and issuccess != '2' 
	</select>
	<select id="bgnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype in ('3000101','3000301','3000401','3000402','3000403','3000501','3000601','3000901','3001201') and areacode = #{areacode}  and issuccess != '2'  
	</select>
	<select id="zxnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate)  and areacode = #{areacode} 
		and rectype = '4000101' and issuccess != '2' 
	</select>
	<select id="gznum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype in ('5000101','5000301','5000401','5000402','5000403','5000501','5000601','5000901','5001201') and areacode = #{areacode} and issuccess != '2'  
	</select>
	<select id="yynum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype = '6000101'  and areacode = #{areacode} and issuccess != '2' 
	</select>
	<select id="ygnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate)
		and rectype = '7000101'  and areacode = #{areacode} and issuccess != '2'  
	</select>
	<select id="cfnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype = '8000101'  and areacode = #{areacode} and issuccess != '2' 
	</select>
	<select id="dyaqnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype = '9000101' and areacode = #{areacode} and issuccess != '2' 
	</select>
	<select id="dyiqnum" resultType="string">
		select count(*) from reg_bus_sjhjtable where trunc(createdate) = trunc(sysdate) 
		and rectype = '9000102'  and areacode = #{areacode} and issuccess != '2' 
	</select>
	
	<select id="businessTypeCount" resultType="string">
		select count(*) from (select count(*) from REG_BUS_SJHJTABLE
		where trunc(createdate) = trunc(sysdate) and areacode = #{areacode} and issuccess != '2'   group by rectype)
	</select>
	
	<select id="allnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0'
	</select>
	<select id="scnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype in 
		('1000101','1000301','1000401','1000402','1000403','1000501','1000601','1000901','1001201')
	</select>
	<select id="zynum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype in 
		('2000101','2000301','2000401','2000402','2000403','2000501','2000601','2000901','2001201')
	</select>
	<select id="bgnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype in 
		('3000101','3000301','3000401','3000402','3000403','3000501','3000601','3000901','3001201')
	</select>
	<select id="zxnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype in ('4000101','4000201')
	</select>
	<select id="gznum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype in
		('5000101','5000301','5000401','5000402','5000403','5000501','5000601','5000901','5001201')
	</select>
	<select id="yynum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype = '6000101'
	</select>
	<select id="ygnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype = '7000101'
	</select>
	<select id="cfnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype = '8000101'
	</select>
	<select id="dyaqnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype = '9000101'
	</select>
	<select id="dyiqnum1" resultType="string">
		select count(*) from reg_bus_sjhjtable where to_char(createdate,'yyyymmdd') &gt;= #{qssj1} 
		and to_char(createdate,'yyyymmdd') &lt;= #{jssj1} and issuccess='0' and rectype = '9000102'
	</select>
	
	<select id="findMaxBizmsgid" resultType="string">
		select MAX(SUBSTRING(bizmsgid, -12)) from reg_bus_sjhjtable
	</select>
	
	<select id="findMaxBizmsgidofOracle" resultType="string">
		select MAX(substr(bizmsgid, -12)) from reg_bus_sjhjtable
	</select>
	
	<insert id="insert">
		INSERT INTO reg_bus_sjhjtable(
			bizmsgid,
			asid,
			areacode,
			rectype,
			righttype,
			regtype,
			createdate,
			recflowid,
			regorgid,
			parcelid,
			estatenum,
			preestatenum,
			precertid,
			certcount,
			proofcount,
			digitalsign,
			issuccess,
			exption
		) VALUES (
			#{bizmsgid},
			#{asid},
			#{areacode},
			#{rectype},
			#{righttype},
			#{regtype},
			#{createdate},
			#{recflowid},
			#{regorgid},
			#{parcelid},
			#{estatenum},
			#{preestatenum},
			#{precertid},
			#{certcount},
			#{proofcount},
			#{digitalsign},
			#{issuccess},
			#{exption}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_sjhjtable SET 	
			bizmsgid = #{bizmsgid},
			asid = #{asid},
			areacode = #{areacode},
			rectype = #{rectype},
			righttype = #{righttype},
			regtype = #{regtype},
			createdate = #{createdate},
			recflowid = #{recflowid},
			regorgid = #{regorgid},
			parcelid = #{parcelid},
			estatenum = #{estatenum},
			preestatenum = #{preestatenum},
			precertid = #{precertid},
			certcount = #{certcount},
			proofcount = #{proofcount},
			digitalsign = #{digitalsign},
			issuccess = #{issuccess},
			exption = #{exption}
		WHERE bizmsgid = #{bizmsgid}
	</update>
	
	<update id="delete">
		DELETE FROM reg_bus_sjhjtable
		WHERE id = #{id}
	</update>
	
	<!--生成报文编号时,存储过程的调用 -->
	<select id="Frandom" resultType="String">
		select sbsjhquery(#{qxdm}) from dual
	</select>
</mapper>