SRegBasePersonDao.xml 3.95 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.SRegBasePersonDao">
    
	<sql id="sRegBasePersonColumns">
		a.id AS "id",
		a.s_area_code AS "sareaCode",
		a.pcode AS "pcode",
		a.rymc AS "rymc",
		a.zjzl AS "zjzl",
		a.zjh AS "zjh",
		a.sshy AS "sshy",
		a.gj AS "gj",
		a.hjszss AS "hjszss",
		a.xb AS "xb",
		a.dh AS "dh",
		a.dz AS "dz",
		a.yb AS "yb",
		a.gzdw AS "gzdw",
		a.dzyj AS "dzyj",
		a.rylx AS "rylx",
		a.dlrymc AS "dlrymc",
		a.dlrydh AS "dlrydh",
		a.dljg AS "dljg",
		a.bz AS "bz",
		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.qxid AS "qxid",
		a.fzjg AS "fzjg",
		a.idimgpers AS "idimgpers"
	</sql>
	
	<sql id="sRegBasePersonJoins">
	</sql>
    
	<select id="get" resultType="SRegBasePerson">
		SELECT 
			<include refid="sRegBasePersonColumns"/>
		FROM s_reg_base_person a
		<include refid="sRegBasePersonJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="getqxid" resultType="SRegBasePerson">
		SELECT 
			<include refid="sRegBasePersonColumns"/>
		FROM s_reg_base_person a
		<include refid="sRegBasePersonJoins"/>
		WHERE a.qxid = #{qxid}
	</select>
	
	<select id="findList" resultType="SRegBasePerson">
		SELECT 
			<include refid="sRegBasePersonColumns"/>
		FROM s_reg_base_person a
		<include refid="sRegBasePersonJoins"/>
		<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="SRegBasePerson">
		SELECT 
			<include refid="sRegBasePersonColumns"/>
		FROM s_reg_base_person a
		<include refid="sRegBasePersonJoins"/>
		<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_person(
			id,
			s_area_code,
			pcode,
			rymc,
			zjzl,
			zjh,
			sshy,
			gj,
			hjszss,
			xb,
			dh,
			dz,
			yb,
			gzdw,
			dzyj,
			rylx,
			dlrymc,
			dlrydh,
			dljg,
			bz,
			isaudit,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag,
			qxid,
			fzjg,
			idimgpers
		) VALUES (
			#{id},
			#{sareaCode},
			#{pcode},
			#{rymc},
			#{zjzl},
			#{zjh},
			#{sshy},
			#{gj},
			#{hjszss},
			#{xb},
			#{dh},
			#{dz},
			#{yb},
			#{gzdw},
			#{dzyj},
			#{rylx},
			#{dlrymc},
			#{dlrydh},
			#{dljg},
			#{bz},
			#{isaudit},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag},
			#{qxid},
			#{fzjg},
			#{idimgpers}
		)
	</insert>
	
	<update id="update">
		UPDATE s_reg_base_person SET 	
			s_area_code = #{sareaCode},
			pcode = #{pcode},
			rymc = #{rymc},
			zjzl = #{zjzl},
			zjh = #{zjh},
			sshy = #{sshy},
			gj = #{gj},
			hjszss = #{hjszss},
			xb = #{xb},
			dh = #{dh},
			dz = #{dz},
			yb = #{yb},
			gzdw = #{gzdw},
			dzyj = #{dzyj},
			rylx = #{rylx},
			dlrymc = #{dlrymc},
			dlrydh = #{dlrydh},
			dljg = #{dljg},
			bz = #{bz},
			isaudit = #{isaudit},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			qxid = #{qxid},
			fzjg = #{fzjg},
			idimgpers = #{idimgpers}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE s_reg_base_person SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>