invest_modeMapper.xml 2.8 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.eport.rest.dao.InvestModeDao">
    
	<sql id="InvestModeEntityColumns">
		a1.INVEST_MODE_CODE AS "investModeCode"
		,a1.INVEST_MODE_NAME AS "investModeName"
	</sql>
	
	<sql id="InvestModeEntityListColumns">
		a1.INVEST_MODE_CODE AS "investModeCode"
	</sql>
	
	<!--查询表中所有资料(所有字段) -->
	<select id="listAll"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.InvestModeEntity"
		>
		select  
			<include refid="InvestModeEntityColumns"/>
		FROM invest_mode  a1
		WHERE 1=1
	</select>
		
	<!--分页查询资料(所有字段) -->
	<select id="pageAll"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.InvestModeEntity"
		>
		select  
			<include refid="InvestModeEntityColumns"/>
		FROM invest_mode  a1
		WHERE 1=1
	</select>
		
	
		<!--查询表中所有资料(仅列表显示字段) -->
		<select id="list"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.InvestModeEntity"
		>
		select  
			<include refid="InvestModeEntityListColumns"/>
		FROM invest_mode  a1
		WHERE 1=1
		</select>
		
	
		<!--分页查询资料(仅列表显示字段) -->
		<select id="page"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.InvestModeEntity"
		>
		select  
			<include refid="InvestModeEntityListColumns"/>
		FROM invest_mode  a1
		WHERE 1=1
		</select>
		
	
		<!--根据主键查询数据 -->
		<select id="findByPK"  
		parameterType="Integer" 
		resultType="com.eport.rest.entity.InvestModeEntity"
		>
		select  
		<include refid="InvestModeEntityColumns"/>
		FROM invest_mode  a1
		WHERE a1.INVEST_MODE_CODE=#{par}
		</select>
		
	
		<!--新增数据 -->
		<insert id="insert"  
		parameterType="com.eport.rest.entity.InvestModeEntity" 
		>
		<selectKey resultType="Integer" order="AFTER" keyProperty="investModeCode">
		<if test="investModeCode != null ">
		select #{investModeCode} from dual
		</if>
		<if test="investModeCode == null ">
		SELECT LAST_INSERT_ID() AS investModeCode
		</if>
		 </selectKey>
		insert  
		  INTO invest_mode (
		INVEST_MODE_NAME
		<if test="investModeCode != null ">
		,INVEST_MODE_CODE
		</if>
		  ) VALUES (
		#{investModeName,jdbcType=VARCHAR}
		<if test="investModeCode != null ">
		,#{investModeCode,jdbcType=varchar}
		</if>
		  )
		</insert>
		
	
		<!--更新数据 -->
		<update id="update"  
		parameterType="com.eport.rest.entity.InvestModeEntity" 
		>
		update  
		invest_mode
		<set>
		<if test="investModeName != null ">
		INVEST_MODE_NAME = #{investModeName},
		</if>
		</set>
		WHERE INVEST_MODE_CODE = #{investModeCode}
		</update>
		
	
		<!--根据主键删除数据 -->
		<delete id="delete"  
		parameterType="HashMap" 
		>
		delete  
		from invest_mode 
		 WHERE INVEST_MODE_CODE in (${par})
		</delete>
		
	
</mapper>