SRegBaseZrzDao.xml 4.38 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.SRegBaseZrzDao">
    
	<sql id="sRegBaseZrzColumns">
		a.id AS "id",
		a.s_area_code AS "sareaCode",
		a.bsm AS "bsm",
		a.ysdm AS "ysdm",
		a.bdcdyh AS "bdcdyh",
		a.zddm AS "zddm",
		a.zrzh AS "zrzh",
		a.xmmc AS "xmmc",
		a.gzwmc AS "gzwmc",
		a.jgrq AS "jgrq",
		a.zcs AS "zcs",
		a.dscs AS "dscs",
		a.dxcs AS "dxcs",
		a.ghyt AS "ghyt",
		a.fwjg AS "fwjg",
		a.zts AS "zts",
		a.jzwjbyt AS "jzwjbyt",
		a.dah AS "dah",
		a.bz AS "bz",
		a.zt AS "zt",
		a.zdftfs AS "zdftfs",
		a.xmid AS "xmid",
		a.ytmc AS "ytmc",
		a.isaudit AS "isaudit",
		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.jzwgd AS "jzwgd",
		a.zzdmj AS "zzdmj",
		a.zydmj AS "zydmj",
		a.ycjzmj AS "ycjzmj",
		a.scjzmj AS "scjzmj",
		a.dxsd AS "dxsd",
		a.zb AS "zb",
		a.qxid AS "qxid"
	</sql>
	
	<sql id="sRegBaseZrzJoins">
	</sql>
    
	<select id="get" resultType="SRegBaseZrz">
		SELECT 
			<include refid="sRegBaseZrzColumns"/>
		FROM s_reg_base_zrz a
		<include refid="sRegBaseZrzJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="getqxid" resultType="SRegBaseZrz">
		SELECT 
			<include refid="sRegBaseZrzColumns"/>
		FROM s_reg_base_zrz a
		<include refid="sRegBaseZrzJoins"/>
		WHERE a.qxid = #{qxid}
	</select>
	
	<select id="findList" resultType="SRegBaseZrz">
		SELECT 
			<include refid="sRegBaseZrzColumns"/>
		FROM s_reg_base_zrz a
		<include refid="sRegBaseZrzJoins"/>
		<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="SRegBaseZrz">
		SELECT 
			<include refid="sRegBaseZrzColumns"/>
		FROM s_reg_base_zrz a
		<include refid="sRegBaseZrzJoins"/>
		<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_zrz(
			id,
			s_area_code,
			bsm,
			ysdm,
			bdcdyh,
			zddm,
			zrzh,
			xmmc,
			gzwmc,
			jgrq,
			zcs,
			dscs,
			dxcs,
			ghyt,
			fwjg,
			zts,
			jzwjbyt,
			dah,
			bz,
			zt,
			zdftfs,
			xmid,
			ytmc,
			isaudit,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag,
			jzwgd,
			zzdmj,
			zydmj,
			ycjzmj,
			scjzmj,
			dxsd,
			zb,
			qxid
		) VALUES (
			#{id},
			#{sareaCode},
			#{bsm},
			#{ysdm},
			#{bdcdyh},
			#{zddm},
			#{zrzh},
			#{xmmc},
			#{gzwmc},
			#{jgrq},
			#{zcs},
			#{dscs},
			#{dxcs},
			#{ghyt},
			#{fwjg},
			#{zts},
			#{jzwjbyt},
			#{dah},
			#{bz},
			#{zt},
			#{zdftfs},
			#{xmid},
			#{ytmc},
			#{isaudit},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag},
			#{jzwgd},
			#{zzdmj},
			#{zydmj},
			#{ycjzmj},
			#{scjzmj},
			#{dxsd},
			#{zb},
			#{qxid}
		)
	</insert>
	
	<update id="update">
		UPDATE s_reg_base_zrz SET 	
			s_area_code = #{sareaCode},
			bsm = #{bsm},
			ysdm = #{ysdm},
			bdcdyh = #{bdcdyh},
			zddm = #{zddm},
			zrzh = #{zrzh},
			xmmc = #{xmmc},
			gzwmc = #{gzwmc},
			jgrq = #{jgrq},
			zcs = #{zcs},
			dscs = #{dscs},
			dxcs = #{dxcs},
			ghyt = #{ghyt},
			fwjg = #{fwjg},
			zts = #{zts},
			jzwjbyt = #{jzwjbyt},
			dah = #{dah},
			bz = #{bz},
			zt = #{zt},
			zdftfs = #{zdftfs},
			xmid = #{xmid},
			ytmc = #{ytmc},
			isaudit = #{isaudit},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			jzwgd = #{jzwgd},
			zzdmj = #{zzdmj},
			zydmj = #{zydmj},
			ycjzmj = #{ycjzmj},
			scjzmj = #{scjzmj},
			dxsd = #{dxsd},
			zb = #{zb},
			qxid = #{qxid}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE s_reg_base_zrz SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>