55859a556556486c81abb162c0d0c22b222c1327.svn-base 3.6 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.base.RegBaseZdjbxxSubDao">
    
	<sql id="regBaseZdjbxxSubColumns">
		a.id AS "id",
		a.zddm AS "zddm",
		a.bdcdyh AS "bdcdyh",
		a.mjdw AS "mjdw",
		a.nydmj AS "nydmj",
		a.gdmj AS "gdmj",
		a.ldmj AS "ldmj",
		a.cdmj AS "cdmj",
		a.qtnydmj AS "qtnydmj",
		a.jsydmj AS "jsydmj",
		a.wlydmj AS "wlydmj",
		a.islogout AS "islogout",
		a.zdid AS "zdid",
		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"
	</sql>
	
	<sql id="regBaseZdjbxxSubJoins">
	</sql>
    
	<select id="get" resultType="RegBaseZdjbxxSub">
		SELECT 
			<include refid="regBaseZdjbxxSubColumns"/>
		FROM reg_base_zdjbxx_sub a
		<include refid="regBaseZdjbxxSubJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBaseZdjbxxSub">
		SELECT 
			<include refid="regBaseZdjbxxSubColumns"/>
		FROM reg_base_zdjbxx_sub a
		<include refid="regBaseZdjbxxSubJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test= "bdcdyh != null and bdcdyh != ''">
				AND  bdcdyh = #{bdcdyh}
			</if >
			<if test= "islogout != null and islogout != ''">
				AND  islogout = #{islogout}
			</if >
			<if test= "zdid != null and zdid != ''">
				AND  zdid = #{zdid}
			</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="RegBaseZdjbxxSub">
		SELECT 
			<include refid="regBaseZdjbxxSubColumns"/>
		FROM reg_base_zdjbxx_sub a
		<include refid="regBaseZdjbxxSubJoins"/>
		<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 reg_base_zdjbxx_sub(
			id,
			zddm,
			bdcdyh,
			mjdw,
			nydmj,
			gdmj,
			ldmj,
			cdmj,
			qtnydmj,
			jsydmj,
			wlydmj,
			islogout,
			zdid,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag
		) VALUES (
			#{id},
			#{zddm},
			#{bdcdyh},
			#{mjdw},
			#{nydmj},
			#{gdmj},
			#{ldmj},
			#{cdmj},
			#{qtnydmj},
			#{jsydmj},
			#{wlydmj},
			#{islogout},
			#{zdid},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_base_zdjbxx_sub SET 	
			zddm = #{zddm},
			bdcdyh = #{bdcdyh},
			mjdw = #{mjdw},
			nydmj = #{nydmj},
			gdmj = #{gdmj},
			ldmj = #{ldmj},
			cdmj = #{cdmj},
			qtnydmj = #{qtnydmj},
			jsydmj = #{jsydmj},
			wlydmj = #{wlydmj},
			islogout = #{islogout},
			zdid = #{zdid},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE reg_base_zdjbxx_sub SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
	
	<update id="deleteSub">
		DELETE FROM reg_base_zdjbxx_sub 
		<where>
			<if test= "islogout != null and islogout != ''">
				AND  islogout = #{islogout}
			</if >
			<if test= "bdcdyh != null and bdcdyh != ''">
				AND  bdcdyh = #{bdcdyh}
			</if >
		</where>
	</update>
	
	<update id="deleteByzdid">
		DELETE FROM reg_base_zdjbxx_sub 
		WHERE zdid = #{zdid}
	</update>
</mapper>