RegBusCSlsqDao.xml 6 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.change.RegBusCSlsqDao">
    
	<sql id="regBusCSlsqColumns">
		a.id AS "id",
		a.ysdm AS "ysdm",
		a.ywh AS "ywh",
		a.djdl AS "djdl",
		a.djxl AS "djxl",
		a.sqzsbs AS "sqzsbs",
		a.sqfbcz AS "sqfbcz",
		a.qxdm AS "qxdm",
		a.slry AS "slry",
		a.slsj AS "slsj",
		a.zl AS "zl",
		a.tzrxm AS "tzrxm",
		a.tzfs AS "tzfs",
		a.tzrdh AS "tzrdh",
		a.tzryddh AS "tzryddh",
		a.tzrdzyj AS "tzrdzyj",
		a.sfwtaj AS "sfwtaj",
		a.jssj AS "jssj",
		a.ajzt AS "ajzt",
		a.bz AS "bz",
		a.proc_ins_id AS "procInsId",
		a.taskdefkey AS "taskdefkey",
		a.proper_type AS "propertype",
		a.fjinfo AS "fjinfo",
		a.str AS "str",
		a.isgs AS "isgs",
		a.islock AS "islock",
		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.bdcqzh AS "bdcqzh",
		a.proid AS proid,
		a.fybh AS fybh,
		a.sllx,
		a.del_flag AS "delFlag"
	</sql>
	
	<sql id="regBusCSlsqJoins">
	</sql>
    
	<select id="get" resultType="RegBusCSlsq">
		SELECT 
			<include refid="regBusCSlsqColumns"/>
		FROM reg_bus_slsq a
		<include refid="regBusCSlsqJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="getByProcInsId" resultType="RegBusCSlsq">
		SELECT 
			<include refid="regBusCSlsqColumns"/>
		FROM reg_bus_slsq a
		<include refid="regBusCSlsqJoins"/>
		WHERE a.proc_ins_id = #{procInsId}
	</select>
	
	<update id="updateInsId">
		UPDATE reg_bus_slsq SET 
			proc_ins_id = #{procInsId},
			update_by = #{updateBy.id}, 
			update_date = #{updateDate}
		WHERE id = #{id}
	</update>
	
	<update id="updateTaskDefKey">
		UPDATE reg_bus_slsq SET 
			taskdefkey = #{taskdefkey},
			fjinfo = #{fjinfo},
			slsj = #{slsj},
			jssj = #{jssj},
			update_by = #{updateBy.id}, 
			update_date = #{updateDate}
		WHERE id = #{id}
	</update>
	
	<update id="updateFjinfo">
		UPDATE reg_bus_slsq SET 
			fjinfo = #{fjinfo},
			update_by = #{updateBy.id}, 
			update_date = #{updateDate}
		WHERE id = #{id}
	</update>
	
	
	<select id="findMaxYwh" resultType="string">
		SELECT MAX(ywh) from reg_bus_slsq
	</select>
	
	<select id="findList" resultType="RegBusCSlsq">
		SELECT 
			<include refid="regBusCSlsqColumns"/>
		FROM reg_bus_slsq a
		<include refid="regBusCSlsqJoins"/>
		<where>
			a.del_flag = #{DEL_FLAG_NORMAL}
			<if test="ywh != null and ywh != ''">
				AND a.ywh LIKE 
					<if test="dbName == 'oracle'">'%'||#{ywh}||'%'</if>
					<if test="dbName == 'mssql'">'%'+#{ywh}+'%'</if>
					<if test="dbName == 'mysql'">concat('%',#{ywh},'%')</if>
			</if>
			<if test="djxl != null and djxl != ''">
				AND a.djxl = #{djxl}
			</if>
			<if test="tzrxm != null and tzrxm != ''">
				AND a.tzrxm LIKE 
					<if test="dbName == 'oracle'">'%'||#{tzrxm}||'%'</if>
					<if test="dbName == 'mssql'">'%'+#{tzrxm}+'%'</if>
					<if test="dbName == 'mysql'">concat('%',#{tzrxm},'%')</if>
			</if> 
			<if test="slry != null and slry != ''">
				AND a.slry LIKE 
					<if test="dbName == 'oracle'">'%'||#{slry}||'%'</if>
					<if test="dbName == 'mssql'">'%'+#{slry}+'%'</if>
					<if test="dbName == 'mysql'">concat('%',#{slry},'%')</if>
			</if>
			<if test="slsj != null and slsj != ''">
			 	<![CDATA[  AND DATE_FORMAT(a.slsj, '%Y-%m-%d') =  DATE_FORMAT(#{slsj}, '%Y-%m-%d')   ]]>
			</if> 
			<if test="taskdefkey != null and taskdefkey != ''">
				AND a.taskdefkey = #{taskdefkey}
			</if>
			<if test="create_by != null and create_by != ''">
				AND a.create_by = #{create_by}
			</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="RegBusCSlsq">
		SELECT 
			<include refid="regBusCSlsqColumns"/>
		FROM reg_bus_slsq a
		<include refid="regBusCSlsqJoins"/>
		<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_slsq(
			id,
			ysdm,
			ywh,
			djdl,
			djxl,
			sqzsbs,
			sqfbcz,
			qxdm,
			slry,
			slsj,
			zl,
			tzrxm,
			tzfs,
			tzrdh,
			tzryddh,
			tzrdzyj,
			sfwtaj,
			jssj,
			ajzt,
			bz,
			proc_ins_id,
			taskdefkey,
			fjinfo,
			str,
			isgs,
			islock,
			proper_type, 
			create_by,
			create_date,
			update_by,
			update_date,
			remarks,
			bdcqzh,
			fybh,
			del_flag
		) VALUES (
			#{id},
			#{ysdm},
			#{ywh},
			#{djdl},
			#{djxl},
			#{sqzsbs},
			#{sqfbcz},
			#{qxdm},
			#{slry},
			#{slsj},
			#{zl},
			#{tzrxm},
			#{tzfs},
			#{tzrdh},
			#{tzryddh},
			#{tzrdzyj},
			#{sfwtaj},
			#{jssj},
			#{ajzt},
			#{bz},
			#{procInsId},
			#{taskdefkey},
			#{fjinfo},
			#{str},
			#{isgs},
			#{islock},
			#{propertype}, 
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate},
			#{remarks},
			#{bdcqzh},
			#{fybh},
			#{delFlag}
		)
	</insert>
	
	<update id="update">
		UPDATE reg_bus_slsq SET 	
			ysdm = #{ysdm},
			ywh = #{ywh},
			djdl = #{djdl},
			djxl = #{djxl},
			sqzsbs = #{sqzsbs},
			sqfbcz = #{sqfbcz},
			qxdm = #{qxdm},
			slry = #{slry},
			slsj = #{slsj},
			zl = #{zl},
			tzrxm = #{tzrxm},
			tzfs = #{tzfs},
			tzrdh = #{tzrdh},
			tzryddh = #{tzryddh},
			tzrdzyj = #{tzrdzyj},
			sfwtaj = #{sfwtaj},
			jssj = #{jssj},
			ajzt = #{ajzt},
			bz = #{bz},
			proc_ins_id = #{procInsId},
			taskdefkey = #{taskdefkey},
			fjinfo = #{fjinfo},
			str = #{str},
			isgs = #{isgs},
			islock = #{islock},
			proper_type = #{propertype},
			update_by = #{updateBy.id},
			update_date = #{updateDate},
			remarks = #{remarks},
			bdcqzh = #{bdcqzh},
			fybh = #{fybh}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		UPDATE reg_bus_slsq SET 
			del_flag = #{DEL_FLAG_DELETE}
		WHERE id = #{id}
	</update>
	
</mapper>