RelatedRelationshipLogMapper.xml 2.36 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.ruoyi.web.controller.business.mapper.RelatedRelationshipLogMapper">
    
    <resultMap type="RelatedRelationshipLog" id="RelatedRelationshipLogResult">
        <result property="id"    column="id"    />
        <result property="searchEnterprise"    column="search_enterprise"    />
        <result property="searchRelationship"    column="search_relationship"    />
        <result property="searchUser"    column="search_user"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>

    <sql id="selectRelatedRelationshipLogVo">
        select id, search_enterprise, search_relationship, search_user, create_time from related_relationship_log
    </sql>

    <select id="selectRelatedRelationshipLogList" parameterType="RelatedRelationshipLog" resultMap="RelatedRelationshipLogResult">
        <include refid="selectRelatedRelationshipLogVo"/>
        <where>  
            <if test="searchEnterprise != null  and searchEnterprise != ''"> and search_enterprise = #{searchEnterprise}</if>
            <if test="searchRelationship != null  and searchRelationship != ''"> and search_relationship = #{searchRelationship}</if>
            <if test="searchUser != null  and searchUser != ''"> and search_user = #{searchUser}</if>
        </where>
    </select>
    

    <insert id="insertRelatedRelationshipLog" parameterType="RelatedRelationshipLog">
        insert into related_relationship_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="searchEnterprise != null">search_enterprise,</if>
            <if test="searchRelationship != null">search_relationship,</if>
            <if test="searchUser != null">search_user,</if>
            <if test="createTime != null">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="searchEnterprise != null">#{searchEnterprise},</if>
            <if test="searchRelationship != null">#{searchRelationship},</if>
            <if test="searchUser != null">#{searchUser},</if>
            <if test="createTime != null">#{createTime},</if>
         </trim>
    </insert>

</mapper>