|
@ -43,6 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<result property="taxRate" column="tax_rate" /> |
|
|
<result property="taxRate" column="tax_rate" /> |
|
|
<result property="firstAddTime" column="first_add_time" /> |
|
|
<result property="firstAddTime" column="first_add_time" /> |
|
|
<result property="updateInfoTime" column="update_info_time" /> |
|
|
<result property="updateInfoTime" column="update_info_time" /> |
|
|
|
|
|
<result property="photoAttachId" column="photo_attach_id" /> |
|
|
|
|
|
<result property="photoUrl" column="photo_url" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="selectSysSupplierVo"> |
|
|
<sql id="selectSysSupplierVo"> |
|
@ -59,24 +61,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="selectSysSupplierList" parameterType="SysSupplier" resultMap="SysSupplierResult"> |
|
|
<select id="selectSysSupplierList" parameterType="SysSupplier" resultMap="SysSupplierResult"> |
|
|
<include refid="selectSysSupplierVo"/> |
|
|
select sup.supplier_id, sup.supplier_code, sup.supplier_name, sup.export_sales, |
|
|
|
|
|
sup.supplier_type, sup.use_status, sup.audit_status, sup.supplier_qualification, sup.purchase_buyer, |
|
|
|
|
|
sup.enterprise_name, sup.enterprise_nature, sup.customer_address, sup.manufacturer_category, |
|
|
|
|
|
sup.postal_code, sup.business_scope, sup.customer_country, sup.established_time, |
|
|
|
|
|
sup.legal_representative, sup.customer_contact, sup.contact_number, sup.customer_fax, |
|
|
|
|
|
sup.customer_email, sup.website, sup.payment_terms, sup.supplier_days, sup.actual_payment_days, |
|
|
|
|
|
sup.settlement_bank, sup.exchange_settlement_account, sup.deposit_bank, sup.bank_account, |
|
|
|
|
|
sup.rmb_registered_capital, sup.Industry_code, sup.merchandiser, sup.merchandiser_telephone, |
|
|
|
|
|
sup.financial_contact, sup.confirm_tax, sup.tax_rate, sup.first_add_time, sup.update_info_time |
|
|
|
|
|
from sys_supplier as sup |
|
|
|
|
|
left join ( |
|
|
|
|
|
select |
|
|
|
|
|
att.rel_id |
|
|
|
|
|
,file.url |
|
|
|
|
|
,min(file.create_time) as create_time |
|
|
|
|
|
from sys_attach as att |
|
|
|
|
|
left join sys_attach_file as file |
|
|
|
|
|
on att.id = file.attach_id |
|
|
|
|
|
where att.source_type = 'supplier' and att.source_sub_type = 'photo' |
|
|
|
|
|
group by att.rel_id |
|
|
|
|
|
)file |
|
|
|
|
|
on sup.supplier_id = file.rel_id |
|
|
<where> |
|
|
<where> |
|
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if> |
|
|
<if test="supplierCode != null and supplierCode != ''"> and sup.supplier_code like concat('%', #{supplierCode}, '%')</if> |
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if> |
|
|
<if test="supplierName != null and supplierName != ''"> and sup.supplier_name like concat('%', #{supplierName}, '%')</if> |
|
|
<if test="supplierType != null and supplierType != ''"> and supplier_type = #{supplierType}</if> |
|
|
<if test="supplierType != null and supplierType != ''"> and sup.supplier_type = #{supplierType}</if> |
|
|
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if> |
|
|
<if test="useStatus != null and useStatus != ''"> and sup.use_status = #{useStatus}</if> |
|
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
|
|
<if test="auditStatus != null and auditStatus != ''"> and sup.audit_status = #{auditStatus}</if> |
|
|
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchase_buyer = #{purchaseBuyer}</if> |
|
|
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and sup.purchase_buyer = #{purchaseBuyer}</if> |
|
|
<if test="exportSales != null and exportSales != ''"> and export_sales = #{exportSales}</if> |
|
|
<if test="exportSales != null and exportSales != ''"> and sup.export_sales = #{exportSales}</if> |
|
|
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|
|
<if test="enterpriseName != null and enterpriseName != ''"> and sup.enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|
|
<if test="customerContact != null and customerContact != ''"> and customer_contact like concat('%', #{customerContact}, '%')</if> |
|
|
<if test="customerContact != null and customerContact != ''"> and sup.customer_contact like concat('%', #{customerContact}, '%')</if> |
|
|
<if test="merchandiser != null and merchandiser != ''"> and merchandiser like concat('%', #{merchandiser}, '%')</if> |
|
|
<if test="merchandiser != null and merchandiser != ''"> and sup.merchandiser like concat('%', #{merchandiser}, '%')</if> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectSysSupplierById" parameterType="Long" resultMap="SysSupplierResult"> |
|
|
<select id="selectSysSupplierById" parameterType="Long" resultMap="SysSupplierResult"> |
|
|
<include refid="selectSysSupplierVo"/> |
|
|
select sup.supplier_id, sup.supplier_code, sup.supplier_name, sup.export_sales, |
|
|
where supplier_id = #{supplierId} |
|
|
sup.supplier_type, sup.use_status, sup.audit_status, sup.supplier_qualification, sup.purchase_buyer, |
|
|
|
|
|
sup.enterprise_name, sup.enterprise_nature, sup.customer_address, sup.manufacturer_category, |
|
|
|
|
|
sup.postal_code, sup.business_scope, sup.customer_country, sup.established_time, |
|
|
|
|
|
sup.legal_representative, sup.customer_contact, sup.contact_number, sup.customer_fax, |
|
|
|
|
|
sup.customer_email, sup.website, sup.payment_terms, sup.supplier_days, sup.actual_payment_days, |
|
|
|
|
|
sup.settlement_bank, sup.exchange_settlement_account, sup.deposit_bank, sup.bank_account, |
|
|
|
|
|
sup.rmb_registered_capital, sup.Industry_code, sup.merchandiser, sup.merchandiser_telephone, |
|
|
|
|
|
sup.financial_contact, sup.confirm_tax, sup.tax_rate, sup.first_add_time, sup.update_info_time |
|
|
|
|
|
from sys_supplier as sup |
|
|
|
|
|
left join ( |
|
|
|
|
|
select |
|
|
|
|
|
att.rel_id |
|
|
|
|
|
,file.url |
|
|
|
|
|
,min(file.create_time) as create_time |
|
|
|
|
|
from sys_attach as att |
|
|
|
|
|
left join sys_attach_file as file |
|
|
|
|
|
on att.id = file.attach_id |
|
|
|
|
|
where att.source_type = 'supplier' and att.source_sub_type = 'photo' |
|
|
|
|
|
group by att.rel_id |
|
|
|
|
|
)file |
|
|
|
|
|
on sup.supplier_id = file.rel_id |
|
|
|
|
|
where sup.supplier_id = #{supplierId} |
|
|
</select> |
|
|
</select> |
|
|
<select id="selectSysSupplierBycode" resultMap="SysSupplierResult"> |
|
|
<select id="selectSysSupplierBycode" resultMap="SysSupplierResult"> |
|
|
select supplier_id,supplier_code,supplier_name from sys_supplier where audit_status = 1 |
|
|
select supplier_id,supplier_code,supplier_name from sys_supplier where audit_status = 1 |
|
|