HwPiccLogMapper.xml 3.16 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.hwPiccLog.mapper.HwPiccLogMapper">
    
    <resultMap type="HwPiccLog" id="HwPiccLogResult">
        <result property="id"    column="id"    />
        <result property="reqcount"    column="reqcount"    />
        <result property="rescount"    column="rescount"    />
        <result property="source"    column="source"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
	
	<sql id="selectHwPiccLogVo">
        select id, reqcount, rescount, source, create_time from hw_picc_log
    </sql>
	
    <select id="selectHwPiccLogList" parameterType="HwPiccLog" resultMap="HwPiccLogResult">
        <include refid="selectHwPiccLogVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="reqcount != null  and reqcount != '' "> and reqcount = #{reqcount}</if>
            <if test="rescount != null  and rescount != '' "> and rescount = #{rescount}</if>
            <if test="source != null  and source != '' "> and source = #{source}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
        </where>
    </select>
    
    <select id="selectHwPiccLogById" parameterType="Long" resultMap="HwPiccLogResult">
        <include refid="selectHwPiccLogVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertHwPiccLog" parameterType="HwPiccLog" useGeneratedKeys="true" keyProperty="id">
        insert into hw_picc_log
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="reqcount != null  and reqcount != ''  ">reqcount,</if>
			<if test="rescount != null  and rescount != ''  ">rescount,</if>
			<if test="source != null  and source != ''  ">source,</if>
			<if test="createTime != null  ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="reqcount != null  and reqcount != ''  ">#{reqcount},</if>
			<if test="rescount != null  and rescount != ''  ">#{rescount},</if>
			<if test="source != null  and source != ''  ">#{source},</if>
			<if test="createTime != null  ">#{createTime},</if>
         </trim>
    </insert>
	 
    <update id="updateHwPiccLog" parameterType="HwPiccLog">
        update hw_picc_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="reqcount != null  and reqcount != ''  ">reqcount = #{reqcount},</if>
            <if test="rescount != null  and rescount != ''  ">rescount = #{rescount},</if>
            <if test="source != null  and source != ''  ">source = #{source},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteHwPiccLogById" parameterType="Long">
        delete from hw_picc_log where id = #{id}
    </delete>
	
    <delete id="deleteHwPiccLogByIds" parameterType="String">
        delete from hw_picc_log where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>