OverseasreportedpricesMapper.xml 3.61 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.lhcredit.project.business.overseasreportedprices.mapper.OverseasreportedpricesMapper">
    
    <resultMap type="Overseasreportedprices" id="OverseasreportedpricesResult">
        <result property="id"    column="id"    />
        <result property="gj"    column="gj"    />
        <result property="en"    column="en"    />
        <result property="jff"    column="jff"    />
        <result property="type"    column="type"    />
        <result property="jg"    column="jg"    />
    </resultMap>
	
	<sql id="selectOverseasreportedpricesVo">
        select id, gj, en, jff, type, jg from overseasreportedprices
    </sql>
	
    <select id="selectOverseasreportedpricesList" parameterType="Overseasreportedprices" resultMap="OverseasreportedpricesResult">
        <include refid="selectOverseasreportedpricesVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="gj != null  and gj != '' "> and gj = #{gj}</if>
            <if test="en != null  and en != '' "> and en = #{en}</if>
            <if test="jff != null  and jff != '' "> and jff = #{jff}</if>
            <if test="type != null  and type != '' "> and type = #{type}</if>
            <if test="jg != null "> and jg = #{jg}</if>
        </where>
    </select>
    
    <select id="selectOverseasreportedpricesById" parameterType="Integer" resultMap="OverseasreportedpricesResult">
        <include refid="selectOverseasreportedpricesVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertOverseasreportedprices" parameterType="Overseasreportedprices" useGeneratedKeys="true" keyProperty="id">
        insert into overseasreportedprices
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="gj != null  and gj != ''  ">gj,</if>
			<if test="en != null  and en != ''  ">en,</if>
			<if test="jff != null  and jff != ''  ">jff,</if>
			<if test="type != null  and type != ''  ">type,</if>
			<if test="jg != null  ">jg,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="gj != null  and gj != ''  ">#{gj},</if>
			<if test="en != null  and en != ''  ">#{en},</if>
			<if test="jff != null  and jff != ''  ">#{jff},</if>
			<if test="type != null  and type != ''  ">#{type},</if>
			<if test="jg != null  ">#{jg},</if>
         </trim>
    </insert>
	 
    <update id="updateOverseasreportedprices" parameterType="Overseasreportedprices">
        update overseasreportedprices
        <trim prefix="SET" suffixOverrides=",">
            <if test="gj != null  and gj != ''  ">gj = #{gj},</if>
            <if test="en != null  and en != ''  ">en = #{en},</if>
            <if test="jff != null  and jff != ''  ">jff = #{jff},</if>
            <if test="type != null  and type != ''  ">type = #{type},</if>
            <if test="jg != null  ">jg = #{jg},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteOverseasreportedpricesById" parameterType="Integer">
        delete from overseasreportedprices where id = #{id}
    </delete>
	
    <delete id="deleteOverseasreportedpricesByIds" parameterType="String">
        delete from overseasreportedprices where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

    <select id="jgbyjc" parameterType="String" resultMap="OverseasreportedpricesResult">
        select * from country c,overseasreportedprices o where c.gj=o.gj and o.type=#{type} AND c.jc=#{jc}
    </select>

</mapper>