EnterpriseInfoMapper.xml 7.81 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.EnterpriseInfoMapper">
    
    <resultMap type="EnterpriseInfo" id="EnterpriseInfoResult">
        <result property="id"    column="id"    />
        <result property="ename"    column="ename"    />
        <result property="creditcode"    column="creditcode"    />
        <result property="legalpersonname"    column="legalpersonname"    />
        <result property="estiblishtime"    column="estiblishtime"    />
        <result property="regcapital"    column="regcapital"    />
        <result property="reginstitute"    column="reginstitute"    />
        <result property="regstatus"    column="regstatus"    />
        <result property="businessscope"    column="businessscope"    />
        <result property="enterpriseaddress"    column="enterpriseaddress"    />
        <result property="menlei"    column="menlei"    />
        <result property="reglocation"    column="reglocation"    />
        <result property="datastatus"    column="datastatus"    />
        <result property="creditfraction"    column="creditfraction"    />
        <result property="creditlevel"    column="creditlevel"    />
        <result property="createTime"    column="createtime"    />
        <result property="updateTime"    column="updatetime"    />
    </resultMap>

    <sql id="selectEnterpriseInfoVo">
        select id, ename, creditcode, legalpersonname, estiblishtime, regcapital, reginstitute, regstatus, businessscope, enterpriseaddress, menlei, reglocation, datastatus, creditfraction, creditlevel, createtime, updatetime from enterprise_info
    </sql>

    <select id="selectEnterpriseInfoList" parameterType="EnterpriseInfo" resultMap="EnterpriseInfoResult">
        <include refid="selectEnterpriseInfoVo"/>
        <where>  
            <if test="ename != null  and ename != ''"> and ename like concat('%', #{ename}, '%')</if>
            <if test="creditcode != null  and creditcode != ''"> and creditcode = #{creditcode}</if>
            <if test="legalpersonname != null  and legalpersonname != ''"> and legalpersonname like concat('%', #{legalpersonname}, '%')</if>
            <if test="estiblishtime != null "> and estiblishtime = #{estiblishtime}</if>
            <if test="regcapital != null  and regcapital != ''"> and regcapital = #{regcapital}</if>
            <if test="reginstitute != null  and reginstitute != ''"> and reginstitute = #{reginstitute}</if>
            <if test="regstatus != null  and regstatus != ''"> and regstatus = #{regstatus}</if>
            <if test="businessscope != null  and businessscope != ''"> and businessscope = #{businessscope}</if>
            <if test="enterpriseaddress != null  and enterpriseaddress != ''"> and enterpriseaddress = #{enterpriseaddress}</if>
            <if test="menlei != null  and menlei != ''"> and menlei = #{menlei}</if>
            <if test="reglocation != null  and reglocation != ''"> and reglocation = #{reglocation}</if>
            <if test="datastatus != null  and datastatus != ''"> and datastatus = #{datastatus}</if>
            <if test="creditfraction != null  and creditfraction != ''"> and creditfraction = #{creditfraction}</if>
            <if test="creditlevel != null  and creditlevel != ''"> and creditlevel = #{creditlevel}</if>
            <if test="createtime != null  and createtime != ''"> and createtime = #{createtime}</if>
            <if test="updatetime != null  and updatetime != ''"> and updatetime = #{updatetime}</if>
        </where>
    </select>
    
    <select id="selectEnterpriseInfoById" parameterType="Long" resultMap="EnterpriseInfoResult">
    </select>

    <insert id="insertEnterpriseInfo" parameterType="EnterpriseInfo">
        insert into enterprise_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="ename != null">ename,</if>
            <if test="creditcode != null">creditcode,</if>
            <if test="legalpersonname != null">legalpersonname,</if>
            <if test="estiblishtime != null">estiblishtime,</if>
            <if test="regcapital != null">regcapital,</if>
            <if test="reginstitute != null">reginstitute,</if>
            <if test="regstatus != null">regstatus,</if>
            <if test="businessscope != null">businessscope,</if>
            <if test="enterpriseaddress != null">enterpriseaddress,</if>
            <if test="menlei != null">menlei,</if>
            <if test="reglocation != null">reglocation,</if>
            <if test="datastatus != null">datastatus,</if>
            <if test="creditfraction != null">creditfraction,</if>
            <if test="creditlevel != null">creditlevel,</if>
            <if test="createtime != null">createtime,</if>
            <if test="updatetime != null">updatetime,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="ename != null">#{ename},</if>
            <if test="creditcode != null">#{creditcode},</if>
            <if test="legalpersonname != null">#{legalpersonname},</if>
            <if test="estiblishtime != null">#{estiblishtime},</if>
            <if test="regcapital != null">#{regcapital},</if>
            <if test="reginstitute != null">#{reginstitute},</if>
            <if test="regstatus != null">#{regstatus},</if>
            <if test="businessscope != null">#{businessscope},</if>
            <if test="enterpriseaddress != null">#{enterpriseaddress},</if>
            <if test="menlei != null">#{menlei},</if>
            <if test="reglocation != null">#{reglocation},</if>
            <if test="datastatus != null">#{datastatus},</if>
            <if test="creditfraction != null">#{creditfraction},</if>
            <if test="creditlevel != null">#{creditlevel},</if>
            <if test="createtime != null">#{createtime},</if>
            <if test="updatetime != null">#{updatetime},</if>
         </trim>
    </insert>

    <update id="updateEnterpriseInfo" parameterType="EnterpriseInfo">
        update enterprise_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="ename != null">ename = #{ename},</if>
            <if test="creditcode != null">creditcode = #{creditcode},</if>
            <if test="legalpersonname != null">legalpersonname = #{legalpersonname},</if>
            <if test="estiblishtime != null">estiblishtime = #{estiblishtime},</if>
            <if test="regcapital != null">regcapital = #{regcapital},</if>
            <if test="reginstitute != null">reginstitute = #{reginstitute},</if>
            <if test="regstatus != null">regstatus = #{regstatus},</if>
            <if test="businessscope != null">businessscope = #{businessscope},</if>
            <if test="enterpriseaddress != null">enterpriseaddress = #{enterpriseaddress},</if>
            <if test="menlei != null">menlei = #{menlei},</if>
            <if test="reglocation != null">reglocation = #{reglocation},</if>
            <if test="datastatus != null">datastatus = #{datastatus},</if>
            <if test="creditfraction != null">creditfraction = #{creditfraction},</if>
            <if test="creditlevel != null">creditlevel = #{creditlevel},</if>
            <if test="createtime != null">createtime = #{createtime},</if>
            <if test="updatetime != null">updatetime = #{updatetime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteEnterpriseInfoById" parameterType="Long">
        delete from enterprise_info where id = #{id}
    </delete>

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