deeb76b2d7e45e4205f69dfea3f6b9fa8b30ddae.svn-base 5.47 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.bus.RegBusNydsyqDao">
    
	<sql id="regBusNydsyqColumns">
		a.id AS "id",
		a.ysdm AS "ysdm",
		a.zddm AS "zddm",
		a.bdcdyh AS "bdcdyh",
		a.ywh AS "ywh",
		a.qllx AS "qllx",
		a.djlx AS "djlx",
		a.djyy AS "djyy",
		a.fbf AS "fbf",
		a.cbsyqmj AS "cbsyqmj",
		a.cbsyqssj AS "cbsyqssj",
		a.cbsyjssj AS "cbsyjssj",
		a.tdsyqxz AS "tdsyqxz",
		a.syttlx AS "syttlx",
		a.yzyfs AS "yzyfs",
		a.cyzl AS "cyzl",
		a.syzcl AS "syzcl",
		a.bdcqzh AS "bdcqzh",
		a.qxdm AS "qxdm",
		a.djjg AS "djjg",
		a.dbr AS "dbr",
		a.djsj AS "djsj",
		a.fj AS "fj",
		a.qszt AS "qszt",
		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.isfdsj AS "isfdsj",
		a.islogout AS "islogout"
	</sql>
	
	<sql id="regBusNydsyqJoins">
	</sql>
    
	<select id="get" resultType="RegBusNydsyq">
		SELECT 
			<include refid="regBusNydsyqColumns"/>
		FROM reg_bus_nydsyq a
		<include refid="regBusNydsyqJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusNydsyq">
		SELECT 
			<include refid="regBusNydsyqColumns"/>
		FROM reg_bus_nydsyq a
		<include refid="regBusNydsyqJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="ywh != null and ywh != ''">
				AND a.ywh = #{ywh}
			</if>
			<if test="bdcdyh != null and bdcdyh != ''">
					AND a.bdcdyh LIKE 
						<if test="dbName == 'oracle'">'%'||#{bdcdyh}||'%'</if>
						<if test="dbName == 'mssql'">'%'+#{bdcdyh}+'%'</if>
						<if test="dbName == 'mysql'">concat('%',#{bdcdyh},'%')</if>
			</if>
			<if test="qszt != null and qszt != ''">
				AND a.qszt = #{qszt}
			</if>
			<if test="zddm != null and zddm != ''">
				AND a.zddm = #{zddm}
			</if>
			<if test="qllx != null and qllx != ''">
				AND a.qllx = #{qllx}
			</if>
			<if test="islogout != null and islogout != ''">
				AND a.islogout = #{islogout}
			</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="RegBusNydsyq">
		SELECT 
			<include refid="regBusNydsyqColumns"/>
		FROM reg_bus_nydsyq a
		<include refid="regBusNydsyqJoins"/>
		<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_bus_nydsyq(
			id,
			ysdm,
			zddm,
			bdcdyh,
			ywh,
			qllx,
			djlx,
			djyy,
			fbf,
			cbsyqmj,
			cbsyqssj,
			cbsyjssj,
			tdsyqxz,
			syttlx,
			yzyfs,
			cyzl,
			syzcl,
			bdcqzh,
			qxdm,
			djjg,
			dbr,
			djsj,
			fj,
			qszt,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag,
			isfdsj,
			islogout
		) VALUES (
			#{id},
			#{ysdm},
			#{zddm},
			#{bdcdyh},
			#{ywh},
			#{qllx},
			#{djlx},
			#{djyy},
			#{fbf},
			#{cbsyqmj},
			#{cbsyqssj},
			#{cbsyjssj},
			#{tdsyqxz},
			#{syttlx},
			#{yzyfs},
			#{cyzl},
			#{syzcl},
			#{bdcqzh},
			#{qxdm},
			#{djjg},
			#{dbr},
			#{djsj},
			#{fj},
			#{qszt},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag},
			#{isfdsj},
			#{islogout}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_nydsyq SET 	
			ysdm = #{ysdm},
			zddm = #{zddm},
			bdcdyh = #{bdcdyh},
			ywh = #{ywh},
			qllx = #{qllx},
			djlx = #{djlx},
			djyy = #{djyy},
			fbf = #{fbf},
			cbsyqmj = #{cbsyqmj},
			cbsyqssj = #{cbsyqssj},
			cbsyjssj = #{cbsyjssj},
			tdsyqxz = #{tdsyqxz},
			syttlx = #{syttlx},
			yzyfs = #{yzyfs},
			cyzl = #{cyzl},
			syzcl = #{syzcl},
			bdcqzh = #{bdcqzh},
			qxdm = #{qxdm},
			djjg = #{djjg},
			dbr = #{dbr},
			djsj = #{djsj},
			fj = #{fj},
			qszt = #{qszt},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			isfdsj = #{isfdsj},
			islogout = #{islogout}
		WHERE id = #{id}
	</update>

	<update id="updateRegBusNydsyq">
		UPDATE reg_bus_nydsyq SET 	
			ysdm = #{ysdm},
			zddm = #{zddm},
			bdcdyh = #{bdcdyh},
			ywh = #{ywh},
			qllx = #{qllx},
			djlx = #{djlx},
			djyy = #{djyy},
			fbf = #{fbf},
			cbsyqmj = #{cbsyqmj},
			cbsyqssj = #{cbsyqssj},
			cbsyjssj = #{cbsyjssj},
			tdsyqxz = #{tdsyqxz},
			syttlx = #{syttlx},
			yzyfs = #{yzyfs},
			cyzl = #{cyzl},
			syzcl = #{syzcl},
			bdcqzh = #{bdcqzh},
			qxdm = #{qxdm},
			djjg = #{djjg},
			dbr = #{dbr},
			djsj = #{djsj},
			fj = #{fj},
			qszt = #{qszt},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			isfdsj = #{isfdsj},
			islogout = #{islogout}
		WHERE ywh = #{ywh}
	</update>
	
	<update id="delete">
		UPDATE reg_bus_nydsyq SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
	<!-- 土地承包经营权转移调用 -->
	<update id="deletenydzyywh">
		DELETE FROM reg_bus_nydsyq 
		WHERE ywh = #{ywh}
	</update>

	<update id="deleteRegBusNydsyq">
		DELETE FROM reg_bus_nydsyq a
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="bdcdyh != null and bdcdyh != ''">
				AND a.bdcdyh  = #{bdcdyh}
			</if>
			<if test="ywh != null and ywh != ''">
				AND a.ywh = #{ywh}
			</if>
		</where>
	</update>
</mapper>