537837c9cbededa1c39f66f18ef421f306407f17.svn-base 3.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.reg.dao.bus.RegBusSfDao">
    
	<sql id="regBusSfColumns">
		a.id AS "id",
		a.ywh AS "ywh",
		a.ysdm AS "ysdm",
		a.jfry AS "jfry",
		a.jfrq AS "jfrq",
		a.sfry AS "sfry",
		a.sfrq AS "sfrq",
		a.fff AS "fff",
		a.sjffr AS "sjffr",
		a.sfdw AS "sfdw",
		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.sfkmmc AS "sfkmmc",
		a.sfewsf AS "sfewsf",
		a.sfjs AS "sfjs",
		a.sflx AS "sflx",
		a.ysje AS "ysje",
		a.zkhysje AS "zkhysje",
		a.ssje AS "ssje"
	</sql>
	
	<sql id="regBusSfJoins">
	</sql>
    
	<select id="get" resultType="RegBusSf">
		SELECT 
			<include refid="regBusSfColumns"/>
		FROM reg_bus_sf a
		<include refid="regBusSfJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="RegBusSf">
		SELECT 
			<include refid="regBusSfColumns"/>
		FROM reg_bus_sf a
		<include refid="regBusSfJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<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="findAList" resultType="RegBusSf">
		SELECT 
			<include refid="regBusSfColumns"/>
		FROM reg_bus_sf a
		<include refid="regBusSfJoins"/>
		<where>
			<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="RegBusSf">
		SELECT 
			<include refid="regBusSfColumns"/>
		FROM reg_bus_sf a
		<include refid="regBusSfJoins"/>
		<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_sf(
			id,
			ywh,
			ysdm,
			jfry,
			jfrq,
			sfry,
			sfrq,
			fff,
			sjffr,
			sfdw,
			sfkmmc,
			sfewsf,
			sfjs,
			sflx,
			ysje,
			zkhysje,
			ssje,
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			del_flag
		) VALUES (
			#{id},
			#{ywh},
			#{ysdm},
			#{jfry},
			#{jfrq},
			#{sfry},
			#{sfrq},
			#{fff},
			#{sjffr},
			#{sfdw},
			#{sfkmmc},
			#{sfewsf},
			#{sfjs},
			#{sflx},
			#{ysje},
			#{zkhysje},
			#{ssje},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{delFlag}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_sf SET 	
			ywh = #{ywh},
			ysdm = #{ysdm},
			jfry = #{jfry},
			jfrq = #{jfrq},
			sfry = #{sfry},
			sfrq = #{sfrq},
			fff = #{fff},
			sjffr = #{sjffr},
			sfdw = #{sfdw},
			sfkmmc = #{sfkmmc},
			sfewsf = #{sfewsf},
			sfjs = #{sfjs},
			sflx = #{sflx},
			ysje = #{ysje},
			zkhysje = #{zkhysje},
			ssje = #{ssje},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		DELETE FROM reg_bus_sf WHERE id = #{id}
	</update>
	
</mapper>