8fbc0dd4dd44af990b4c491a70fe9f7a93d36e2b.svn-base 6.45 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.sumdata.dao.datatable.SRegBaseHDao">
    
	<sql id="sRegBaseHColumns">
		a.id AS "id",
		a.s_area_code AS "sareaCode",
		a.bdcdyh AS "bdcdyh",
		a.fwbm AS "fwbm",
		a.jgzwmc AS "jgzwmc",
		a.ysdm AS "ysdm",
		a.zrzh AS "zrzh",
		a.ljzh AS "ljzh",
		a.ch AS "ch",
		a.zl AS "zl",
		a.mjdw AS "mjdw",
		a.sjcs AS "sjcs",
		a.hh AS "hh",
		a.shbw AS "shbw",
		a.hx AS "hx",
		a.hxjg AS "hxjg",
		a.fwyt1 AS "fwyt1",
		a.qlxz AS "qlxz",
		a.xmmc AS "xmmc",
		a.fwlx AS "fwlx",
		a.fwxz AS "fwxz",
		a.fcfht AS "fcfht",
		a.zt AS "zt",
		a.cid AS "cid",
		a.xyposition AS "xyposition",
		a.beginc AS "beginc",
		a.endc AS "endc",
		a.status AS "status",
		a.rights AS "rights",
		a.isdiya AS "isdiya",
		a.ischafeng AS "ischafeng",
		a.isyiyi AS "isyiyi",
		a.isaudit AS "isaudit",
		a.islogout AS "islogout",
		a.create_by AS "createBy.id",
		a.create_date AS "createDate",
		a.update_by AS "updateBy.id",
		a.update_date AS "updateDate",
		a.remarks AS "remarks",
		a.del_flag AS "delFlag",
		a.ycjzmj AS "ycjzmj",
		a.yctnjzmj AS "yctnjzmj",
		a.ycftjzmj AS "ycftjzmj",
		a.ycdxbfjzmj AS "ycdxbfjzmj",
		a.ycqtjzmj AS "ycqtjzmj",
		a.ycftxs AS "ycftxs",
		a.scjzmj AS "scjzmj",
		a.sctnjzmj AS "sctnjzmj",
		a.scftjzmj AS "scftjzmj",
		a.scdxbfjzmj AS "scdxbfjzmj",
		a.scqtjzmj AS "scqtjzmj",
		a.scftxs AS "scftxs",
		a.gytdmj AS "gytdmj",
		a.fttdmj AS "fttdmj",
		a.dytdmj AS "dytdmj",
		a.zddm AS "zddm",
		a.ytmc AS "ytmc",
		a.fwlxmc AS "fwlxmc",
		a.fwxzmc AS "fwxzmc",
		a.qxid AS "qxid",
		a.fwyt2 AS "fwyt2",
		a.fwyt3 AS "fwyt3",
		a.iszy AS "iszy"
	</sql>
	
	<sql id="sRegBaseHJoins">
	</sql>
    
	<select id="get" resultType="SRegBaseH">
		SELECT 
			<include refid="sRegBaseHColumns"/>
		FROM s_reg_base_h a
		<include refid="sRegBaseHJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="getqxid" resultType="SRegBaseH">
		SELECT 
			<include refid="sRegBaseHColumns"/>
		FROM s_reg_base_h a
		<include refid="sRegBaseHJoins"/>
		WHERE a.qxid = #{qxid}
	</select>
	
	<select id="getbdcdyh" resultType="SRegBaseH">
		SELECT 
			<include refid="sRegBaseHColumns"/>
		FROM s_reg_base_h a
		<include refid="sRegBaseHJoins"/>
		WHERE a.bdcdyh = #{bdcdyh}  and a.islogout='0' and nvl(a.iszy,0) = 0 
	</select>
	
	<select id="findList" resultType="SRegBaseH">
		SELECT 
			<include refid="sRegBaseHColumns"/>
		FROM s_reg_base_h a
		<include refid="sRegBaseHJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="sareaCode != null and sareaCode != ''">
				AND a.s_area_code = #{sareaCode}
			</if>
			<if test="qxid != null and qxid != ''">
				AND a.qxid = #{qxid}
			</if>
		</where>
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
				ORDER BY a.update_date DESC
			</otherwise>
		</choose>
	</select>
	
	<select id="findAllList" resultType="SRegBaseH">
		SELECT 
			<include refid="sRegBaseHColumns"/>
		FROM s_reg_base_h a
		<include refid="sRegBaseHJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
		</where>		
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
				ORDER BY a.update_date DESC
			</otherwise>
		</choose>
	</select>
	
	<insert id="insert">
		INSERT INTO s_reg_base_h(
			id,
			s_area_code,
			bdcdyh,
			fwbm,
			jgzwmc,
			ysdm,
			zrzh,
			ljzh,
			ch,
			zl,
			mjdw,
			sjcs,
			hh,
			shbw,
			hx,
			hxjg,
			fwyt1,
			qlxz,
			xmmc,
			fwlx,
			fwxz,
			fcfht,
			zt,
			cid,
			xyposition,
			beginc,
			endc,
			status,
			rights,
			isdiya,
			ischafeng,
			isyiyi,
			isaudit,
			islogout,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag,
			ycjzmj,
			yctnjzmj,
			ycftjzmj,
			ycdxbfjzmj,
			ycqtjzmj,
			ycftxs,
			scjzmj,
			sctnjzmj,
			scftjzmj,
			scdxbfjzmj,
			scqtjzmj,
			scftxs,
			gytdmj,
			fttdmj,
			dytdmj,
			zddm,
			ytmc,
			fwlxmc,
			fwxzmc,
			qxid,
			fwyt2,
			fwyt3,
			iszy
		) VALUES (
			#{id},
			#{sareaCode},
			#{bdcdyh},
			#{fwbm},
			#{jgzwmc},
			#{ysdm},
			#{zrzh},
			#{ljzh},
			#{ch},
			#{zl},
			#{mjdw},
			#{sjcs},
			#{hh},
			#{shbw},
			#{hx},
			#{hxjg},
			#{fwyt1},
			#{qlxz},
			#{xmmc},
			#{fwlx},
			#{fwxz},
			#{fcfht},
			#{zt},
			#{cid},
			#{xyposition},
			#{beginc},
			#{endc},
			#{status},
			#{rights},
			#{isdiya},
			#{ischafeng},
			#{isyiyi},
			#{isaudit},
			#{islogout},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag},
			#{ycjzmj},
			#{yctnjzmj},
			#{ycftjzmj},
			#{ycdxbfjzmj},
			#{ycqtjzmj},
			#{ycftxs},
			#{scjzmj},
			#{sctnjzmj},
			#{scftjzmj},
			#{scdxbfjzmj},
			#{scqtjzmj},
			#{scftxs},
			#{gytdmj},
			#{fttdmj},
			#{dytdmj},
			#{zddm},
			#{ytmc},
			#{fwlxmc},
			#{fwxzmc},
			#{qxid},
			#{fwyt2},
			#{fwyt3},
			#{iszy}
		)
	</insert>
	
	<update id="update">
		UPDATE s_reg_base_h SET 	
			s_area_code = #{sareaCode},
			bdcdyh = #{bdcdyh},
			fwbm = #{fwbm},
			jgzwmc = #{jgzwmc},
			ysdm = #{ysdm},
			zrzh = #{zrzh},
			ljzh = #{ljzh},
			ch = #{ch},
			zl = #{zl},
			mjdw = #{mjdw},
			sjcs = #{sjcs},
			hh = #{hh},
			shbw = #{shbw},
			hx = #{hx},
			hxjg = #{hxjg},
			fwyt1 = #{fwyt1},
			qlxz = #{qlxz},
			xmmc = #{xmmc},
			fwlx = #{fwlx},
			fwxz = #{fwxz},
			fcfht = #{fcfht},
			zt = #{zt},
			cid = #{cid},
			xyposition = #{xyposition},
			beginc = #{beginc},
			endc = #{endc},
			status = #{status},
			rights = #{rights},
			isdiya = #{isdiya},
			ischafeng = #{ischafeng},
			isyiyi = #{isyiyi},
			isaudit = #{isaudit},
			islogout = #{islogout},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			ycjzmj = #{ycjzmj},
			yctnjzmj = #{yctnjzmj},
			ycftjzmj = #{ycftjzmj},
			ycdxbfjzmj = #{ycdxbfjzmj},
			ycqtjzmj = #{ycqtjzmj},
			ycftxs = #{ycftxs},
			scjzmj = #{scjzmj},
			sctnjzmj = #{sctnjzmj},
			scftjzmj = #{scftjzmj},
			scdxbfjzmj = #{scdxbfjzmj},
			scqtjzmj = #{scqtjzmj},
			scftxs = #{scftxs},
			gytdmj = #{gytdmj},
			fttdmj = #{fttdmj},
			dytdmj = #{dytdmj},
			zddm = #{zddm},
			ytmc = #{ytmc},
			fwlxmc = #{fwlxmc},
			fwxzmc = #{fwxzmc},
			qxid = #{qxid},
			fwyt2 = #{fwyt2},
			fwyt3 = #{fwyt3},
			iszy = #{iszy}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE s_reg_base_h SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>