RegBusFdcq1Dao.xml 3.94 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.RegBusFdcq1Dao">
    
	<sql id="regBusFdcq1Columns">
		a.id AS "id",
		a.ysdm AS "ysdm",
		a.bdcdyh AS "bdcdyh",
		a.ywh AS "ywh",
		a.qllx AS "qllx",
		a.djlx AS "djlx",
		a.djyy AS "djyy",
		a.fdzl AS "fdzl",
		a.tdsyqr AS "tdsyqr",
		a.dytdmj AS "dytdmj",
		a.fttdmj AS "fttdmj",
		a.tdsyqssj AS "tdsyqssj",
		a.tdsyjssj AS "tdsyjssj",
		a.fdcjyjg AS "fdcjyjg",
		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.fcfht AS "fcfht",
		a.xmid AS "xmid",
		a.zdmj AS "zdmj"
	</sql>
	
	<sql id="regBusFdcq1Joins">
	</sql>
    
	<select id="get" resultType="RegBusFdcq1">
		SELECT 
			<include refid="regBusFdcq1Columns"/>
		FROM reg_bus_fdcq1 a
		<include refid="regBusFdcq1Joins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusFdcq1">
		SELECT 
			<include refid="regBusFdcq1Columns"/>
		FROM reg_bus_fdcq1 a
		<include refid="regBusFdcq1Joins"/>
		<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>
		<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="RegBusFdcq1">
		SELECT 
			<include refid="regBusFdcq1Columns"/>
		FROM reg_bus_fdcq1 a
		<include refid="regBusFdcq1Joins"/>
		<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_fdcq1(
			id,
			ysdm,
			bdcdyh,
			ywh,
			qllx,
			djlx,
			djyy,
			fdzl,
			tdsyqr,
			dytdmj,
			fttdmj,
			tdsyqssj,
			tdsyjssj,
			fdcjyjg,
			bdcqzh,
			qxdm,
			djjg,
			dbr,
			djsj,
			fj,
			qszt,
			create_by,
			create_date,
			update_by,
			update_date,
			del_flag,
			fcfht,
			xmid,
			zdmj
		) VALUES (
			#{id},
			#{ysdm},
			#{bdcdyh},
			#{ywh},
			#{qllx},
			#{djlx},
			#{djyy},
			#{fdzl},
			#{tdsyqr},
			#{dytdmj},
			#{fttdmj},
			#{tdsyqssj},
			#{tdsyjssj},
			#{fdcjyjg},
			#{bdcqzh},
			#{qxdm},
			#{djjg},
			#{dbr},
			#{djsj},
			#{fj},
			#{qszt},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{delFlag},
			#{fcfht},
			#{xmid},
			#{zdmj}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_fdcq1 SET 	
			ysdm = #{ysdm},
			bdcdyh = #{bdcdyh},
			ywh = #{ywh},
			qllx = #{qllx},
			djlx = #{djlx},
			djyy = #{djyy},
			fdzl = #{fdzl},
			tdsyqr = #{tdsyqr},
			dytdmj = #{dytdmj},
			fttdmj = #{fttdmj},
			tdsyqssj = #{tdsyqssj},
			tdsyjssj = #{tdsyjssj},
			fdcjyjg = #{fdcjyjg},
			bdcqzh = #{bdcqzh},
			qxdm = #{qxdm},
			djjg = #{djjg},
			dbr = #{dbr},
			djsj = #{djsj},
			fj = #{fj},
			qszt = #{qszt},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			fcfht = #{fcfht},
			xmid = #{xmid},
			zdmj = #{zdmj}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE reg_bus_fdcq1 SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
	<update id="deletefdcq1">
		DELETE FROM reg_bus_fdcq1 
		<where>
			
				 ywh = #{ywh}
			
			<if test= "bdcdyh != null and bdcdyh != ''">
				AND  bdcdyh = #{bdcdyh}
			</if>
		</where>
	</update>
	
	<update id="deleteywh">
		DELETE from reg_bus_fdcq1
		WHERE ywh = #{ywh}
	</update>
</mapper>