|
|
|
@ -1,28 +1,31 @@ |
|
|
|
<?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.spring.modules.customer.mapper.CustomerInformationMapper"> |
|
|
|
|
|
|
|
<!-- 客户信息列表 --> |
|
|
|
<select id="customerInformationSearch" parameterType="com.spring.modules.customer.vo.CustomerInformationVo" resultType="com.spring.modules.customer.vo.CustomerInformationVo"> |
|
|
|
SELECT |
|
|
|
site, |
|
|
|
<select id="customerInformationSearch" parameterType="com.spring.modules.customer.vo.CustomerInformationVo" |
|
|
|
resultType="com.spring.modules.customer.vo.CustomerInformationVo"> |
|
|
|
SELECT site, |
|
|
|
customer_no, |
|
|
|
customer_desc, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_customer_customer_currency',customer_currency,site) as customer_currency, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_customer_customer_currency', customer_currency, |
|
|
|
site) as customer_currency, |
|
|
|
turnover_of_year, |
|
|
|
potential_revenue_of_year, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_important_customer',important_customer,site) as important_customer, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_important_customer', important_customer, |
|
|
|
site) as important_customer, |
|
|
|
customer_group_id1, |
|
|
|
dbo.get_customer_group_name(site, customer_group_id1, '1') as customerGroupName1, |
|
|
|
customer_group_id2, |
|
|
|
dbo.get_customer_group_name(site, customer_group_id2, '2') as customerGroupName2, |
|
|
|
customer_status, |
|
|
|
case when customer_status = 'Y' then '启用' |
|
|
|
case |
|
|
|
when customer_status = 'Y' then '启用' |
|
|
|
when customer_status = 'N' then '停用' |
|
|
|
else '' end as customerStatusDesc, |
|
|
|
customer_type, |
|
|
|
customer_description, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_customer_industry',customer_industry,site) as customer_industry, |
|
|
|
dbo.plm_get_dictDataLabel('plm_customer_information_customer_industry', customer_industry, |
|
|
|
site) as customer_industry, |
|
|
|
create_date, |
|
|
|
create_by, |
|
|
|
update_date, |
|
|
|
@ -43,10 +46,11 @@ |
|
|
|
AND customer_status = #{query.customerStatus} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
order by CAST(SUBSTRING(customer_no, 2, 6) AS INT) desc |
|
|
|
</select> |
|
|
|
<select id="customerInformationSearchForCheck" parameterType="com.spring.modules.customer.vo.CustomerInformationVo" resultType="com.spring.modules.customer.vo.CustomerInformationVo"> |
|
|
|
SELECT |
|
|
|
site, |
|
|
|
<select id="customerInformationSearchForCheck" parameterType="com.spring.modules.customer.vo.CustomerInformationVo" |
|
|
|
resultType="com.spring.modules.customer.vo.CustomerInformationVo"> |
|
|
|
SELECT site, |
|
|
|
customer_no, |
|
|
|
customer_desc, |
|
|
|
customer_currency, |
|
|
|
@ -81,6 +85,14 @@ |
|
|
|
AND customer_status = #{query.customerStatus} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
order by CAST(SUBSTRING(customer_no, 2, 6) AS INT) desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryNextCustomerNo" resultType="java.lang.String"> |
|
|
|
select |
|
|
|
'C'+Right('00000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(customer_no, 2, 6))), 0) + 1), 5) |
|
|
|
AS next_customer_no |
|
|
|
from plm_customer_information |
|
|
|
where site = #{site} |
|
|
|
</select> |
|
|
|
</mapper> |