RegBusYwrxxDao.xml 3.74 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.RegBusYwrxxDao">
    
	<sql id="regBusYwrxxColumns">
		a.id AS "id",
		a.ysdm AS "ysdm",
		a.ywh AS "ywh",
		a.bdcdyh AS "bdcdyh",
		a.sxh AS "sxh",
		a.sfczr AS "sfczr",
		a.ywrmc AS "ywrmc",
		a.ywrzjzl AS "ywrzjzl",
		a.ywrzjh AS "ywrzjh",
		a.ywrtxdz AS "ywrtxdz",
		a.ywryb AS "ywryb",
		a.sshy AS "sshy",
		a.gj AS "gj",
		a.hjszss AS "hjszss",
		a.xb AS "xb",
		a.dh AS "dh",
		a.gzdw AS "gzdw",
		a.dzyj AS "dzyj",
		a.qlrlx AS "qlrlx",
		a.fddbrfzr AS "fddbrfzr",
		a.fddbrfzrdh AS "fddbrfzrdh",
		a.dlrmc AS "dlrmc",
		a.dlrdh AS "dlrdh",
		a.dljgmc AS "dljgmc",
		a.bz AS "bz",
		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="regBusYwrxxJoins">
	</sql>
    
	<select id="get" resultType="RegBusYwrxx">
		SELECT 
			<include refid="regBusYwrxxColumns"/>
		FROM reg_bus_ywrxx a
		<include refid="regBusYwrxxJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusYwrxx">
		SELECT 
			<include refid="regBusYwrxxColumns"/>
		FROM reg_bus_ywrxx a
		<include refid="regBusYwrxxJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="ywh != null and ywh != ''">
				AND a.ywh = #{ywh}
			</if>
			<if test="ywrmc != null and ywrmc != ''">
				AND a.ywrmc = #{ywrmc}
			</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="RegBusYwrxx">
		SELECT 
			<include refid="regBusYwrxxColumns"/>
		FROM reg_bus_ywrxx a
		<include refid="regBusYwrxxJoins"/>
		<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_ywrxx(
			id,
			ysdm,
			ywh,
			bdcdyh,
			sxh,
			sfczr,
			ywrmc,
			ywrzjzl,
			ywrzjh,
			ywrtxdz,
			ywryb,
			sshy,
			gj,
			hjszss,
			xb,
			dh,
			gzdw,
			dzyj,
			qlrlx,
			fddbrfzr,
			fddbrfzrdh,
			dlrmc,
			dlrdh,
			dljgmc,
			bz,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag
		) VALUES (
			#{id},
			#{ysdm},
			#{ywh},
			#{bdcdyh},
			#{sxh},
			#{sfczr},
			#{ywrmc},
			#{ywrzjzl},
			#{ywrzjh},
			#{ywrtxdz},
			#{ywryb},
			#{sshy},
			#{gj},
			#{hjszss},
			#{xb},
			#{dh},
			#{gzdw},
			#{dzyj},
			#{qlrlx},
			#{fddbrfzr},
			#{fddbrfzrdh},
			#{dlrmc},
			#{dlrdh},
			#{dljgmc},
			#{bz},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_ywrxx SET 	
			ysdm = #{ysdm},
			ywh = #{ywh},
			bdcdyh = #{bdcdyh},
			sxh = #{sxh},
			sfczr = #{sfczr},
			ywrmc = #{ywrmc},
			ywrzjzl = #{ywrzjzl},
			ywrzjh = #{ywrzjh},
			ywrtxdz = #{ywrtxdz},
			ywryb = #{ywryb},
			sshy = #{sshy},
			gj = #{gj},
			hjszss = #{hjszss},
			xb = #{xb},
			dh = #{dh},
			gzdw = #{gzdw},
			dzyj = #{dzyj},
			qlrlx = #{qlrlx},
			fddbrfzr = #{fddbrfzr},
			fddbrfzrdh = #{fddbrfzrdh},
			dlrmc = #{dlrmc},
			dlrdh = #{dlrdh},
			dljgmc = #{dljgmc},
			bz = #{bz},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		DELETE from reg_bus_ywrxx 
		WHERE id = #{id}
	</update>
	
</mapper>