<?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.tanpu.fund.mapper.generator.PublicFundManagerMapper"> <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> <!--@Table public_fund_manager--> <id column="ts_code" jdbcType="VARCHAR" property="tsCode" /> <id column="ann_date" jdbcType="VARCHAR" property="annDate" /> <id column="name" jdbcType="VARCHAR" property="name" /> <id column="end_date" jdbcType="VARCHAR" property="endDate" /> <result column="gender" jdbcType="VARCHAR" property="gender" /> <result column="birth_year" jdbcType="VARCHAR" property="birthYear" /> <result column="edu" jdbcType="VARCHAR" property="edu" /> <result column="nationality" jdbcType="VARCHAR" property="nationality" /> <result column="begin_date" jdbcType="VARCHAR" property="beginDate" /> <result column="resume" jdbcType="VARCHAR" property="resume" /> </resultMap> <sql id="Example_Where_Clause"> <!--@mbg.generated--> <where> <foreach collection="oredCriteria" item="criteria" separator="or"> <if test="criteria.valid"> <trim prefix="(" prefixOverrides="and" suffix=")"> <foreach collection="criteria.criteria" item="criterion"> <choose> <when test="criterion.noValue"> and ${criterion.condition} </when> <when test="criterion.singleValue"> and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Update_By_Example_Where_Clause"> <!--@mbg.generated--> <where> <foreach collection="example.oredCriteria" item="criteria" separator="or"> <if test="criteria.valid"> <trim prefix="(" prefixOverrides="and" suffix=")"> <foreach collection="criteria.criteria" item="criterion"> <choose> <when test="criterion.noValue"> and ${criterion.condition} </when> <when test="criterion.singleValue"> and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Base_Column_List"> <!--@mbg.generated--> ts_code, ann_date, `name`, end_date, gender, birth_year, edu, nationality, begin_date, resume </sql> <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.PublicFundManagerExample" resultMap="BaseResultMap"> <!--@mbg.generated--> select <if test="distinct"> distinct </if> <include refid="Base_Column_List" /> from public_fund_manager <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> <if test="orderByClause != null"> order by ${orderByClause} </if> </select> <select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap"> <!--@mbg.generated--> select <include refid="Base_Column_List" /> from public_fund_manager where ts_code = #{tsCode,jdbcType=VARCHAR} and ann_date = #{annDate,jdbcType=VARCHAR} and `name` = #{name,jdbcType=VARCHAR} and end_date = #{endDate,jdbcType=VARCHAR} </select> <delete id="deleteByPrimaryKey" parameterType="map"> <!--@mbg.generated--> delete from public_fund_manager where ts_code = #{tsCode,jdbcType=VARCHAR} and ann_date = #{annDate,jdbcType=VARCHAR} and `name` = #{name,jdbcType=VARCHAR} and end_date = #{endDate,jdbcType=VARCHAR} </delete> <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.PublicFundManagerExample"> <!--@mbg.generated--> delete from public_fund_manager <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </delete> <insert id="insert" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> insert into public_fund_manager (ts_code, ann_date, `name`, end_date, gender, birth_year, edu, nationality, begin_date, resume) values (#{tsCode,jdbcType=VARCHAR}, #{annDate,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{birthYear,jdbcType=VARCHAR}, #{edu,jdbcType=VARCHAR}, #{nationality,jdbcType=VARCHAR}, #{beginDate,jdbcType=VARCHAR}, #{resume,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> insert into public_fund_manager <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> ts_code, </if> <if test="annDate != null"> ann_date, </if> <if test="name != null"> `name`, </if> <if test="endDate != null"> end_date, </if> <if test="gender != null"> gender, </if> <if test="birthYear != null"> birth_year, </if> <if test="edu != null"> edu, </if> <if test="nationality != null"> nationality, </if> <if test="beginDate != null"> begin_date, </if> <if test="resume != null"> resume, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="tsCode != null"> #{tsCode,jdbcType=VARCHAR}, </if> <if test="annDate != null"> #{annDate,jdbcType=VARCHAR}, </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> <if test="endDate != null"> #{endDate,jdbcType=VARCHAR}, </if> <if test="gender != null"> #{gender,jdbcType=VARCHAR}, </if> <if test="birthYear != null"> #{birthYear,jdbcType=VARCHAR}, </if> <if test="edu != null"> #{edu,jdbcType=VARCHAR}, </if> <if test="nationality != null"> #{nationality,jdbcType=VARCHAR}, </if> <if test="beginDate != null"> #{beginDate,jdbcType=VARCHAR}, </if> <if test="resume != null"> #{resume,jdbcType=VARCHAR}, </if> </trim> </insert> <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.PublicFundManagerExample" resultType="java.lang.Long"> <!--@mbg.generated--> select count(*) from public_fund_manager <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </select> <update id="updateByExampleSelective" parameterType="map"> <!--@mbg.generated--> update public_fund_manager <set> <if test="record.tsCode != null"> ts_code = #{record.tsCode,jdbcType=VARCHAR}, </if> <if test="record.annDate != null"> ann_date = #{record.annDate,jdbcType=VARCHAR}, </if> <if test="record.name != null"> `name` = #{record.name,jdbcType=VARCHAR}, </if> <if test="record.endDate != null"> end_date = #{record.endDate,jdbcType=VARCHAR}, </if> <if test="record.gender != null"> gender = #{record.gender,jdbcType=VARCHAR}, </if> <if test="record.birthYear != null"> birth_year = #{record.birthYear,jdbcType=VARCHAR}, </if> <if test="record.edu != null"> edu = #{record.edu,jdbcType=VARCHAR}, </if> <if test="record.nationality != null"> nationality = #{record.nationality,jdbcType=VARCHAR}, </if> <if test="record.beginDate != null"> begin_date = #{record.beginDate,jdbcType=VARCHAR}, </if> <if test="record.resume != null"> resume = #{record.resume,jdbcType=VARCHAR}, </if> </set> <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> </update> <update id="updateByExample" parameterType="map"> <!--@mbg.generated--> update public_fund_manager set ts_code = #{record.tsCode,jdbcType=VARCHAR}, ann_date = #{record.annDate,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR}, end_date = #{record.endDate,jdbcType=VARCHAR}, gender = #{record.gender,jdbcType=VARCHAR}, birth_year = #{record.birthYear,jdbcType=VARCHAR}, edu = #{record.edu,jdbcType=VARCHAR}, nationality = #{record.nationality,jdbcType=VARCHAR}, begin_date = #{record.beginDate,jdbcType=VARCHAR}, resume = #{record.resume,jdbcType=VARCHAR} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> </update> <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> update public_fund_manager <set> <if test="gender != null"> gender = #{gender,jdbcType=VARCHAR}, </if> <if test="birthYear != null"> birth_year = #{birthYear,jdbcType=VARCHAR}, </if> <if test="edu != null"> edu = #{edu,jdbcType=VARCHAR}, </if> <if test="nationality != null"> nationality = #{nationality,jdbcType=VARCHAR}, </if> <if test="beginDate != null"> begin_date = #{beginDate,jdbcType=VARCHAR}, </if> <if test="resume != null"> resume = #{resume,jdbcType=VARCHAR}, </if> </set> where ts_code = #{tsCode,jdbcType=VARCHAR} and ann_date = #{annDate,jdbcType=VARCHAR} and `name` = #{name,jdbcType=VARCHAR} and end_date = #{endDate,jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> update public_fund_manager set gender = #{gender,jdbcType=VARCHAR}, birth_year = #{birthYear,jdbcType=VARCHAR}, edu = #{edu,jdbcType=VARCHAR}, nationality = #{nationality,jdbcType=VARCHAR}, begin_date = #{beginDate,jdbcType=VARCHAR}, resume = #{resume,jdbcType=VARCHAR} where ts_code = #{tsCode,jdbcType=VARCHAR} and ann_date = #{annDate,jdbcType=VARCHAR} and `name` = #{name,jdbcType=VARCHAR} and end_date = #{endDate,jdbcType=VARCHAR} </update> <update id="updateBatch" parameterType="java.util.List"> <!--@mbg.generated--> update public_fund_manager <trim prefix="set" suffixOverrides=","> <trim prefix="gender = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.gender,jdbcType=VARCHAR} </foreach> </trim> <trim prefix="birth_year = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.birthYear,jdbcType=VARCHAR} </foreach> </trim> <trim prefix="edu = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.edu,jdbcType=VARCHAR} </foreach> </trim> <trim prefix="nationality = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.nationality,jdbcType=VARCHAR} </foreach> </trim> <trim prefix="begin_date = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.beginDate,jdbcType=VARCHAR} </foreach> </trim> <trim prefix="resume = case" suffix="end,"> <foreach collection="list" index="index" item="item"> when ts_code = #{item.tsCode,jdbcType=VARCHAR} then #{item.resume,jdbcType=VARCHAR} </foreach> </trim> </trim> where ts_code in <foreach close=")" collection="list" item="item" open="(" separator=", "> #{item.tsCode,jdbcType=VARCHAR} </foreach> </update> <insert id="batchInsert" parameterType="map"> <!--@mbg.generated--> insert into public_fund_manager (ts_code, ann_date, `name`, end_date, gender, birth_year, edu, nationality, begin_date, resume) values <foreach collection="list" item="item" separator=","> (#{item.tsCode,jdbcType=VARCHAR}, #{item.annDate,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.endDate,jdbcType=VARCHAR}, #{item.gender,jdbcType=VARCHAR}, #{item.birthYear,jdbcType=VARCHAR}, #{item.edu,jdbcType=VARCHAR}, #{item.nationality,jdbcType=VARCHAR}, #{item.beginDate,jdbcType=VARCHAR}, #{item.resume,jdbcType=VARCHAR}) </foreach> </insert> <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> insert into public_fund_manager (ts_code, ann_date, `name`, end_date, gender, birth_year, edu, nationality, begin_date, resume) values (#{tsCode,jdbcType=VARCHAR}, #{annDate,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{birthYear,jdbcType=VARCHAR}, #{edu,jdbcType=VARCHAR}, #{nationality,jdbcType=VARCHAR}, #{beginDate,jdbcType=VARCHAR}, #{resume,jdbcType=VARCHAR}) on duplicate key update ts_code = #{tsCode,jdbcType=VARCHAR}, ann_date = #{annDate,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR}, end_date = #{endDate,jdbcType=VARCHAR}, gender = #{gender,jdbcType=VARCHAR}, birth_year = #{birthYear,jdbcType=VARCHAR}, edu = #{edu,jdbcType=VARCHAR}, nationality = #{nationality,jdbcType=VARCHAR}, begin_date = #{beginDate,jdbcType=VARCHAR}, resume = #{resume,jdbcType=VARCHAR} </insert> <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.PublicFundManager"> <!--@mbg.generated--> insert into public_fund_manager <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> ts_code, </if> <if test="annDate != null"> ann_date, </if> <if test="name != null"> `name`, </if> <if test="endDate != null"> end_date, </if> <if test="gender != null"> gender, </if> <if test="birthYear != null"> birth_year, </if> <if test="edu != null"> edu, </if> <if test="nationality != null"> nationality, </if> <if test="beginDate != null"> begin_date, </if> <if test="resume != null"> resume, </if> </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> #{tsCode,jdbcType=VARCHAR}, </if> <if test="annDate != null"> #{annDate,jdbcType=VARCHAR}, </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> <if test="endDate != null"> #{endDate,jdbcType=VARCHAR}, </if> <if test="gender != null"> #{gender,jdbcType=VARCHAR}, </if> <if test="birthYear != null"> #{birthYear,jdbcType=VARCHAR}, </if> <if test="edu != null"> #{edu,jdbcType=VARCHAR}, </if> <if test="nationality != null"> #{nationality,jdbcType=VARCHAR}, </if> <if test="beginDate != null"> #{beginDate,jdbcType=VARCHAR}, </if> <if test="resume != null"> #{resume,jdbcType=VARCHAR}, </if> </trim> on duplicate key update <trim suffixOverrides=","> <if test="tsCode != null"> ts_code = #{tsCode,jdbcType=VARCHAR}, </if> <if test="annDate != null"> ann_date = #{annDate,jdbcType=VARCHAR}, </if> <if test="name != null"> `name` = #{name,jdbcType=VARCHAR}, </if> <if test="endDate != null"> end_date = #{endDate,jdbcType=VARCHAR}, </if> <if test="gender != null"> gender = #{gender,jdbcType=VARCHAR}, </if> <if test="birthYear != null"> birth_year = #{birthYear,jdbcType=VARCHAR}, </if> <if test="edu != null"> edu = #{edu,jdbcType=VARCHAR}, </if> <if test="nationality != null"> nationality = #{nationality,jdbcType=VARCHAR}, </if> <if test="beginDate != null"> begin_date = #{beginDate,jdbcType=VARCHAR}, </if> <if test="resume != null"> resume = #{resume,jdbcType=VARCHAR}, </if> </trim> </insert> </mapper>