WFDynamicUserMapper.xml 7.2 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.sa.ibiz.demo.demo.mapper.WFDynamicUserMapper">

	<update id="updateOne"
		parameterType="com.sa.ibiz.demo.demo.domain.WFDynamicUser">
		update T_SRFWFDYNAMICUSER t
		<trim prefix="set" suffixOverrides=",">
		<if test="wfdynamicuser.extensions.createdatedirtyflag != null and true == wfdynamicuser.extensions.createdatedirtyflag"> createdate = #{wfdynamicuser.createdate}, </if>
		<if test="wfdynamicuser.extensions.createmandirtyflag != null and true == wfdynamicuser.extensions.createmandirtyflag"> createman = #{wfdynamicuser.createman}, </if>
		<if test="wfdynamicuser.extensions.paramsdirtyflag != null and true == wfdynamicuser.extensions.paramsdirtyflag"> params = #{wfdynamicuser.params}, </if>
		<if test="wfdynamicuser.extensions.updatedatedirtyflag != null and true == wfdynamicuser.extensions.updatedatedirtyflag"> updatedate = #{wfdynamicuser.updatedate}, </if>
		<if test="wfdynamicuser.extensions.updatemandirtyflag != null and true == wfdynamicuser.extensions.updatemandirtyflag"> updateman = #{wfdynamicuser.updateman}, </if>
		<if test="wfdynamicuser.extensions.userobjectdirtyflag != null and true == wfdynamicuser.extensions.userobjectdirtyflag"> userobject = #{wfdynamicuser.userobject}, </if>
		<if test="wfdynamicuser.extensions.usertypedirtyflag != null and true == wfdynamicuser.extensions.usertypedirtyflag"> usertype = #{wfdynamicuser.usertype}, </if>
		<if test="wfdynamicuser.extensions.wfdynamicusernamedirtyflag != null and true == wfdynamicuser.extensions.wfdynamicusernamedirtyflag"> wfdynamicusername = #{wfdynamicuser.wfdynamicusername}, </if>
		</trim>
		where t.wfdynamicuserid = #{wfdynamicuser.wfdynamicuserid}
	</update>

	<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="db2">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="mysql">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="oracle">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="postgresql">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="ppas">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>
		<select id="selectById"  resultMap="WFDynamicUserResultMap" databaseId="sqlserver">
			<![CDATA[	select t1.* from (
			select * from v_wfdynamicuser
			)t1     where  wfdynamicuserid=#{id}]]>
		</select>

	<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
	<resultMap id="WFDynamicUserResultMap" type="com.sa.ibiz.demo.demo.domain.WFDynamicUser" autoMapping="true">
			<id property="wfdynamicuserid" column="wfdynamicuserid" /><!--主键字段映射-->

		
		
	</resultMap>


	   		<!--输出平台内配置的数据查询[DEFAULT]-->
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="db2">
				<![CDATA[select t1.* from (
						SELECT t1.CREATEDATE, t1.CREATEMAN, t1.UPDATEDATE, t1.UPDATEMAN, t1.USEROBJECT, t1.USERTYPE, t1.WFDYNAMICUSERID, t1.WFDYNAMICUSERNAME FROM T_SRFWFDYNAMICUSER t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="mysql">
				<![CDATA[select t1.* from (
						SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USEROBJECT`, t1.`USERTYPE`, t1.`WFDYNAMICUSERID`, t1.`WFDYNAMICUSERNAME` FROM `T_SRFWFDYNAMICUSER` t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="oracle">
				<![CDATA[select t1.* from (
						SELECT t1.CREATEDATE, t1.CREATEMAN, t1.UPDATEDATE, t1.UPDATEMAN, t1.USEROBJECT, t1.USERTYPE, t1.WFDYNAMICUSERID, t1.WFDYNAMICUSERNAME FROM T_SRFWFDYNAMICUSER t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="postgresql">
				<![CDATA[select t1.* from (
						SELECT t1.CREATEDATE AS CREATEDATE, t1.CREATEMAN AS CREATEMAN, t1.UPDATEDATE AS UPDATEDATE, t1.UPDATEMAN AS UPDATEMAN, t1.USEROBJECT AS USEROBJECT, t1.USERTYPE AS USERTYPE, t1.WFDYNAMICUSERID AS WFDYNAMICUSERID, t1.WFDYNAMICUSERNAME AS WFDYNAMICUSERNAME FROM T_SRFWFDYNAMICUSER t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="ppas">
				<![CDATA[select t1.* from (
						SELECT t1.CREATEDATE AS CREATEDATE, t1.CREATEMAN AS CREATEMAN, t1.UPDATEDATE AS UPDATEDATE, t1.UPDATEMAN AS UPDATEMAN, t1.USEROBJECT AS USEROBJECT, t1.USERTYPE AS USERTYPE, t1.WFDYNAMICUSERID AS WFDYNAMICUSERID, t1.WFDYNAMICUSERNAME AS WFDYNAMICUSERNAME FROM T_SRFWFDYNAMICUSER t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
			<select id="searchDefault"  parameterType="com.sa.ibiz.demo.demo.service.dto.WFDynamicUserSearchFilter"  resultMap="WFDynamicUserResultMap" databaseId="sqlserver">
				<![CDATA[select t1.* from (
						SELECT t1.[CREATEDATE], t1.[CREATEMAN], t1.[UPDATEDATE], t1.[UPDATEMAN], t1.[USEROBJECT], t1.[USERTYPE], t1.[WFDYNAMICUSERID], t1.[WFDYNAMICUSERNAME] FROM [T_SRFWFDYNAMICUSER] t1  
								)t1]]>
					<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
						   <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
			</select>
</mapper>