TEnterpriseInfoMapper.xml 8.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
<?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.zehong.system.mapper.TEnterpriseInfoMapper">

    <resultMap type="TEnterpriseInfo" id="TEnterpriseInfoResult">
        <result property="enterpriseId"    column="enterprise_id"    />
        <result property="createEnterpriseId"    column="create_enterprise_id"    />
        <result property="enterpriseName"    column="enterprise_name"    />
        <result property="enterpriseType"    column="enterprise_type"    />
        <result property="registerAddress"    column="register_address"    />
        <result property="legalRepresentative"    column="legal_representative"    />
        <result property="businessArea"    column="business_area"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="iconType"    column="icon_type"    />
        <result property="licenseKey"    column="license_key"    />
        <result property="licenseValidityTime"    column="license_validity_time"    />
        <result property="annualSupervisionInspection"    column="annual_supervision_inspection"    />
        <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="isDel"    column="is_del"    />
        <result property="remarks"    column="remarks"    />
        <result property="doDusiness"    column="do_business"    />
    </resultMap>

    <sql id="selectTEnterpriseInfoVo">
        select enterprise_id, enterprise_name, register_address, legal_representative,enterprise_type,
        business_area, longitude, latitude, icon_type, license_key, license_validity_time, annual_supervision_inspection,
        create_by, create_time, update_by, update_time, remarks,do_business from t_enterprise_info
    </sql>

    <select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult">
        <include refid="selectTEnterpriseInfoVo"/>
        <where>
            1=1 and is_del='0'
            <if test="enterpriseId != -2 and enterpriseId != null and enterpriseId != ''">
             and enterprise_id = #{enterpriseId}
             </if>
            <if test="enterpriseName != null  and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
            <if test="registerAddress != null  and registerAddress != ''"> and register_address = #{registerAddress}</if>
            <if test="enterpriseType != null">and enterprise_type =#{enterpriseType}</if>
            <if test="legalRepresentative != null  and legalRepresentative != ''"> and legal_representative = #{legalRepresentative}</if>
            <if test="businessArea != null  and businessArea != ''"> and business_area = #{businessArea}</if>
            <if test="licenseKey != null  and licenseKey != ''"> and license_key = #{licenseKey}</if>
            <if test="licenseValidityTime != null  and licenseValidityTime != ''"> and license_validity_time = #{licenseValidityTime}</if>
            <if test="annualSupervisionInspection != null  and annualSupervisionInspection != ''"> and annual_supervision_inspection = #{annualSupervisionInspection}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
        </where>
        group by enterprise_id desc
    </select>

    <select id="selectTEnterpriseInfoById" parameterType="Long" resultMap="TEnterpriseInfoResult">
        <include refid="selectTEnterpriseInfoVo"/>
        where enterprise_id = #{enterpriseId} and is_del='0'
    </select>

    <insert id="insertTEnterpriseInfo" parameterType="TEnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
        insert into t_enterprise_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="createEnterpriseId != null">create_enterprise_id,</if>
            <if test="enterpriseName != null">enterprise_name,</if>
            <if test="enterpriseType!=null">enterprise_type,</if>
            <if test="registerAddress != null">register_address,</if>
            <if test="legalRepresentative != null">legal_representative,</if>
            <if test="businessArea != null">business_area,</if>
            <if test="longitude != null">longitude,</if>
            <if test="latitude != null">latitude,</if>
            <if test="iconType != null">icon_type,</if>
            <if test="licenseKey != null">license_key,</if>
            <if test="licenseValidityTime != null">license_validity_time,</if>
            <if test="annualSupervisionInspection != null">annual_supervision_inspection,</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="isDel != null">is_del,</if>
            <if test="remarks != null">remarks,</if>
            <if test="doDusiness != null">do_business,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="createEnterpriseId != null">#{createEnterpriseId},</if>
            <if test="enterpriseName != null">#{enterpriseName},</if>
            <if test="enterpriseType != null"> #{enterpriseType},</if>
            <if test="registerAddress != null">#{registerAddress},</if>
            <if test="legalRepresentative != null">#{legalRepresentative},</if>
            <if test="businessArea != null">#{businessArea},</if>
            <if test="longitude != null">#{longitude},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="iconType != null">#{iconType},</if>
            <if test="licenseKey != null">#{licenseKey},</if>
            <if test="licenseValidityTime != null">#{licenseValidityTime},</if>
            <if test="annualSupervisionInspection != null">#{annualSupervisionInspection},</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="isDel != null">#{isDel},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="doDusiness != null">#{doDusiness},</if>
         </trim>
    </insert>

    <update id="updateTEnterpriseInfo" parameterType="TEnterpriseInfo">
        update t_enterprise_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
            <if test="enterpriseType!=null"> enterprise_type = #{enterpriseType},</if>
            <if test="registerAddress != null">register_address = #{registerAddress},</if>
            <if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
            <if test="businessArea != null">business_area = #{businessArea},</if>
            <if test="longitude != null">longitude = #{longitude},</if>
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="iconType != null">icon_type = #{iconType},</if>
            <if test="licenseKey != null">license_key = #{licenseKey},</if>
            <if test="licenseValidityTime != null">license_validity_time = #{licenseValidityTime},</if>
            <if test="annualSupervisionInspection != null">annual_supervision_inspection = #{annualSupervisionInspection},</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="remarks != null">remarks = #{remarks},</if>
            <if test="doDusiness != null">do_business=#{doDusiness},</if>
        </trim>
        where enterprise_id = #{enterpriseId}
    </update>

    <update id="deleteTEnterpriseInfoById" parameterType="Long">
        update  t_enterprise_info set is_del='1' where enterprise_id = #{enterpriseId}
    </update>

    <update id="deleteTEnterpriseInfoByIds" parameterType="String">
        update  t_enterprise_info set is_del='1' where enterprise_id in
        <foreach item="enterpriseId" collection="array" open="(" separator="," close=")">
            #{enterpriseId}
        </foreach>
    </update>
</mapper>