<?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.unis.circulateMonitor.modular.goodEnterprise.mapper.GoodEnterpriseMapper">
    <select id="pageList" parameterType="com.baomidou.mybatisplus.core.conditions.Wrapper" resultType="com.unis.circulateMonitor.modular.goodEnterprise.entity.GoodEnterprise">
        SELECT
            gge.*, CONCAT(
                dd.DICT_LABEL,
                dd1.DICT_LABEL,
                dd1.DICT_LABEL,
                dd2.DICT_LABEL,
                gge.enterprise_address
            ) administrativeArea,
            bar.audit_user_id auditUserId,
            su.`NAME` auditUserName,
            bar.audit_time auditTime,
            su1.`NAME` createUserName
        FROM
            biz_cm_go_good_enterprise gge
        LEFT JOIN dev_dict dd ON gge.enterprise_province = dd.ID
        LEFT JOIN dev_dict dd1 ON gge.enterprise_city = dd1.ID
        LEFT JOIN dev_dict dd2 ON gge.enterprise_area = dd2.ID
        LEFT JOIN biz_audit_request bar ON gge.id = bar.request_id
        LEFT JOIN sys_user su ON su.ID = bar.audit_user_id
        LEFT JOIN sys_user su1 ON su1.ID = gge.create_user
        ${ew.customSqlSegment}
    </select>
    <select id="getEnterpriseList" resultType="map">
        SELECT
            id,
            enterprise_name enterpriseName
        FROM
            biz_cm_go_good_enterprise
    </select>
</mapper>