SRegBusBdcqzsdjxxDao.xml 5.51 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.SRegBusBdcqzsdjxxDao">
    
	<sql id="sRegBusBdcqzsdjxxColumns">
		a.id AS "id",
		a.s_area_code AS "sareaCode",
		a.ywh AS "ywh",
		a.bdcqzh AS "bdcqzh",
		a.bdcqzbh AS "bdcqzbh",
		a.ysxlh AS "ysxlh",
		a.dbsj AS "dbsj",
		a.qlrmc AS "qlrmc",
		a.gyqk AS "gyqk",
		a.zl AS "zl",
		a.zddm AS "zddm",
		a.bdcdyh AS "bdcdyh",
		a.qllx AS "qllx",
		a.qlxz AS "qlxz",
		a.yt AS "yt",
		a.mj AS "mj",
		a.syqx AS "syqx",
		a.qlqtzk AS "qlqtzk",
		a.fj AS "fj",
		a.dydjxx AS "dydjxx",
		a.jcdydjxx AS "jcdydjxx",
		a.cfqk AS "cfqk",
		a.jccf AS "jccf",
		a.th AS "th",
		a.pwh AS "pwh",
		a.hbjk AS "hbjk",
		a.hbhth AS "hbhth",
		a.fzsj AS "fzsj",
		a.zzsj AS "zzsj",
		a.djlx AS "djlx",
		a.status AS "status",
		a.islogout AS "islogout",
		a.isfdsj AS "isfdsj",
		a.ishistory AS "ishistory",
		a.isprint AS "isprint",
		a.rights AS "rights",
		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.oldid AS "oldid",
		a.qxid AS "qxid"
	</sql>
	
	<sql id="sRegBusBdcqzsdjxxJoins">
	</sql>
    
	<select id="get" resultType="SRegBusBdcqzsdjxx">
		SELECT 
			<include refid="sRegBusBdcqzsdjxxColumns"/>
		FROM s_reg_bus_bdcqzsdjxx a
		<include refid="sRegBusBdcqzsdjxxJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="getqxid" resultType="SRegBusBdcqzsdjxx">
		SELECT 
			<include refid="sRegBusBdcqzsdjxxColumns"/>
		FROM s_reg_bus_bdcqzsdjxx a
		<include refid="sRegBusBdcqzsdjxxJoins"/>
		WHERE a.qxid = #{qxid}
	</select>
	
	<select id="findList" resultType="SRegBusBdcqzsdjxx">
		SELECT 
			<include refid="sRegBusBdcqzsdjxxColumns"/>
		FROM s_reg_bus_bdcqzsdjxx a
		<include refid="sRegBusBdcqzsdjxxJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="sareaCode != null and sareaCode != ''">
				AND a.s_area_code = #{sareaCode}
			</if>
			
			<if test="dbsj != null and dbsj != ''">
			    <if test="dbsj != 'NOTNULL' and dbsj != 'ISNULL'">
			        AND a.dbsj = #{dbsj}
			    </if>			 
			</if>
			<if test="ywh != null and ywh != ''">
				AND a.ywh = #{ywh}
			</if>
			<if test="islogout != null and islogout != ''">
			    AND a.islogout = #{islogout}
			</if>
			<if test="bdcqzh != null and bdcqzh != ''">
				AND a.bdcqzh LIKE 
					<if test="dbName == 'oracle'">'%'||#{bdcqzh}||'%'</if>
					<if test="dbName == 'mssql'">'%'+#{bdcqzh}+'%'</if>
					<if test="dbName == 'mysql'">concat('%',#{bdcqzh},'%')</if>
			</if>
			    and dbsj is not null or trim(dbsj)!=''
		</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="SRegBusBdcqzsdjxx">
		SELECT 
			<include refid="sRegBusBdcqzsdjxxColumns"/>
		FROM s_reg_bus_bdcqzsdjxx a
		<include refid="sRegBusBdcqzsdjxxJoins"/>
		<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_bus_bdcqzsdjxx(
			id,
			s_area_code,
			ywh,
			bdcqzh,
			bdcqzbh,
			ysxlh,
			dbsj,
			qlrmc,
			gyqk,
			zl,
			zddm,
			bdcdyh,
			qllx,
			qlxz,
			yt,
			mj,
			syqx,
			qlqtzk,
			fj,
			dydjxx,
			jcdydjxx,
			cfqk,
			jccf,
			th,
			pwh,
			hbjk,
			hbhth,
			fzsj,
			zzsj,
			djlx,
			status,
			islogout,
			isfdsj,
			ishistory,
			isprint,
			rights,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag,
			oldid,
			qxid
		) VALUES (
			#{id},
			#{sareaCode},
			#{ywh},
			#{bdcqzh},
			#{bdcqzbh},
			#{ysxlh},
			#{dbsj},
			#{qlrmc},
			#{gyqk},
			#{zl},
			#{zddm},
			#{bdcdyh},
			#{qllx},
			#{qlxz},
			#{yt},
			#{mj},
			#{syqx},
			#{qlqtzk},
			#{fj},
			#{dydjxx},
			#{jcdydjxx},
			#{cfqk},
			#{jccf},
			#{th},
			#{pwh},
			#{hbjk},
			#{hbhth},
			#{fzsj},
			#{zzsj},
			#{djlx},
			#{status},
			#{islogout},
			#{isfdsj},
			#{ishistory},
			#{isprint},
			#{rights},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag},
			#{oldid},
			#{qxid}
		)
	</insert>
	
	<update id="update">
		UPDATE s_reg_bus_bdcqzsdjxx SET 	
			s_area_code = #{sareaCode},
			ywh = #{ywh},
			bdcqzh = #{bdcqzh},
			bdcqzbh = #{bdcqzbh},
			ysxlh = #{ysxlh},
			dbsj = #{dbsj},
			qlrmc = #{qlrmc},
			gyqk = #{gyqk},
			zl = #{zl},
			zddm = #{zddm},
			bdcdyh = #{bdcdyh},
			qllx = #{qllx},
			qlxz = #{qlxz},
			yt = #{yt},
			mj = #{mj},
			syqx = #{syqx},
			qlqtzk = #{qlqtzk},
			fj = #{fj},
			dydjxx = #{dydjxx},
			jcdydjxx = #{jcdydjxx},
			cfqk = #{cfqk},
			jccf = #{jccf},
			th = #{th},
			pwh = #{pwh},
			hbjk = #{hbjk},
			hbhth = #{hbhth},
			fzsj = #{fzsj},
			zzsj = #{zzsj},
			djlx = #{djlx},
			status = #{status},
			islogout = #{islogout},
			isfdsj = #{isfdsj},
			ishistory = #{ishistory},
			isprint = #{isprint},
			rights = #{rights},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			oldid = #{oldid},
			qxid = #{qxid}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE s_reg_bus_bdcqzsdjxx SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>