117 lines
5.7 KiB
XML
117 lines
5.7 KiB
XML
<?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.intc.invest.mapper.InvestExchangeMapper">
|
|
|
|
<resultMap type="InvestExchangeVo" id="InvestExchangeResult">
|
|
<result property="id" column="id" />
|
|
<result property="name" column="name" />
|
|
<result property="type" column="type" />
|
|
<result property="code" column="code" />
|
|
<result property="shortName" column="short_name" />
|
|
<result property="foundingTime" column="founding_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="remark" column="remark" />
|
|
<result property="introduce" column="introduce" />
|
|
</resultMap>
|
|
|
|
<sql id="selectInvestExchangeVo">
|
|
select a.id, a.name, a.type, a.code, a.short_name, a.founding_time, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.introduce from invest_exchange a
|
|
</sql>
|
|
|
|
<select id="selectInvestExchangeList" parameterType="InvestExchangeDto" resultMap="InvestExchangeResult">
|
|
<include refid="selectInvestExchangeVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="name != null and name != ''"> and (a.name like '%'|| #{name}||'%' or a.short_name like '%'|| #{name}||'%')</if>
|
|
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
|
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectInvestExchangeById" parameterType="Long" resultMap="InvestExchangeResult">
|
|
<include refid="selectInvestExchangeVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertInvestExchange" parameterType="InvestExchange">
|
|
insert into invest_exchange
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="type != null and type != ''">type,</if>
|
|
<if test="code != null and code != ''">code,</if>
|
|
<if test="shortName != null and shortName != ''">short_name,</if>
|
|
<if test="foundingTime != null">founding_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="introduce != null">introduce,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
<if test="code != null and code != ''">#{code},</if>
|
|
<if test="shortName != null and shortName != ''">#{shortName},</if>
|
|
<if test="foundingTime != null">#{foundingTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="introduce != null">#{introduce},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateInvestExchange" parameterType="InvestExchange">
|
|
update invest_exchange
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
|
<if test="shortName != null and shortName != ''">short_name = #{shortName},</if>
|
|
<if test="foundingTime != null">founding_time = #{foundingTime},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="introduce != null">introduce = #{introduce},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteInvestExchangeById" parameterType="Long">
|
|
delete from invest_exchange where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteInvestExchangeByIds" parameterType="String">
|
|
delete from invest_exchange where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<update id="removeInvestExchangeById" parameterType="Long">
|
|
update invest_exchange set del_flag='1' where id = #{id}
|
|
</update>
|
|
|
|
<update id="removeInvestExchangeByIds" parameterType="String">
|
|
update invest_exchange set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|