RegBusDyiqDao.xml 3.79 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.RegBusDyiqDao">
    
	<sql id="regBusDyiqColumns">
		a.id AS "id",
		a.ysdm AS "ysdm",
		a.ywh AS "ywh",
		a.gydbdcdyh AS "gydbdcdyh",
		a.gydqlr AS "gydqlr",
		a.gydqlrzjzl AS "gydqlrzjzl",
		a.gydqlrzjh AS "gydqlrzjh",
		a.xydbdcdyh AS "xydbdcdyh",
		a.xydzl AS "xydzl",
		a.xydqlr AS "xydqlr",
		a.xydqlrzjzl AS "xydqlrzjzl",
		a.xydqlrzjh AS "xydqlrzjh",
		a.djlx AS "djlx",
		a.djyy AS "djyy",
		a.dyqnr AS "dyqnr",
		a.bdcdjzmh AS "bdcdjzmh",
		a.qlqssj AS "qlqssj",
		a.qljssj AS "qljssj",
		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"
	</sql>
	
	<sql id="regBusDyiqJoins">
	</sql>
    
	<select id="get" resultType="RegBusDyiq">
		SELECT 
			<include refid="regBusDyiqColumns"/>
		FROM reg_bus_dyiq a
		<include refid="regBusDyiqJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusDyiq">
		SELECT 
			<include refid="regBusDyiqColumns"/>
		FROM reg_bus_dyiq a
		<include refid="regBusDyiqJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="ywh != null and ywh != ''">
				AND a.ywh = #{ywh}
			</if>
			<if test="gydbdcdyh != null and gydbdcdyh != ''">
				AND a.gydbdcdyh = #{gydbdcdyh}
			</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="RegBusDyiq">
		SELECT 
			<include refid="regBusDyiqColumns"/>
		FROM reg_bus_dyiq a
		<include refid="regBusDyiqJoins"/>
		<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_dyiq(
			id,
			ysdm,
			ywh,
			gydbdcdyh,
			gydqlr,
			gydqlrzjzl,
			gydqlrzjh,
			xydbdcdyh,
			xydzl,
			xydqlr,
			xydqlrzjzl,
			xydqlrzjh,
			djlx,
			djyy,
			dyqnr,
			bdcdjzmh,
			qlqssj,
			qljssj,
			qxdm,
			djjg,
			dbr,
			djsj,
			fj,
			qszt,
			create_by,
			create_date,
			update_by,
			update_date,
			del_flag
		) VALUES (
			#{id},
			#{ysdm},
			#{ywh},
			#{gydbdcdyh},
			#{gydqlr},
			#{gydqlrzjzl},
			#{gydqlrzjh},
			#{xydbdcdyh},
			#{xydzl},
			#{xydqlr},
			#{xydqlrzjzl},
			#{xydqlrzjh},
			#{djlx},
			#{djyy},
			#{dyqnr},
			#{bdcdjzmh},
			#{qlqssj},
			#{qljssj},
			#{qxdm},
			#{djjg},
			#{dbr},
			#{djsj},
			#{fj},
			#{qszt},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{delFlag}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_dyiq SET 	
			ysdm = #{ysdm},
			ywh = #{ywh},
			gydbdcdyh = #{gydbdcdyh},
			gydqlr = #{gydqlr},
			gydqlrzjzl = #{gydqlrzjzl},
			gydqlrzjh = #{gydqlrzjh},
			xydbdcdyh = #{xydbdcdyh},
			xydzl = #{xydzl},
			xydqlr = #{xydqlr},
			xydqlrzjzl = #{xydqlrzjzl},
			xydqlrzjh = #{xydqlrzjh},
			djlx = #{djlx},
			djyy = #{djyy},
			dyqnr = #{dyqnr},
			bdcdjzmh = #{bdcdjzmh},
			qlqssj = #{qlqssj},
			qljssj = #{qljssj},
			qxdm = #{qxdm},
			djjg = #{djjg},
			dbr = #{dbr},
			djsj = #{djsj},
			fj = #{fj},
			qszt = #{qszt},
			update_by = #{updateBy.id},
			update_date = #{updateDate}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE reg_bus_dyiq SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>