You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.4 KiB
61 lines
2.4 KiB
<?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.gaotao.modules.customer.mapper.CustomerMapper">
|
|
|
|
<select id="selectCustomerList" resultType="com.gaotao.modules.customer.entity.Customer">
|
|
select site, customer_no, customer_name, active, create_time, create_by
|
|
from customer
|
|
<where>
|
|
<if test="site != null and site != ''">
|
|
and site = #{site}
|
|
</if>
|
|
<if test="active != null and active != ''">
|
|
and active = #{active}
|
|
</if>
|
|
<if test="customerNo != null and customerNo != ''">
|
|
and customer_no like #{customerNo}
|
|
</if>
|
|
<if test="customerName != null and customerName != ''">
|
|
and customer_name like #{customerName}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="generateCustomerNo" resultType="java.lang.Integer">
|
|
SELECT ISNULL(MAX(CAST(SUBSTRING(customer_no, 2, LEN(customer_no)-1) AS INT)),0) AS MaxCustomerNo
|
|
FROM customer
|
|
<where>
|
|
<if test="site != null and site != ''">
|
|
site = #{site}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectCustomerPage" resultType="com.gaotao.modules.customer.entity.Customer">
|
|
select site, customer_no, customer_name, active, create_time, create_by
|
|
from customer
|
|
<where>
|
|
<if test="params.site != null and params.site != ''">
|
|
and site = #{params.site}
|
|
</if>
|
|
<if test="params.active != null and params.active != ''">
|
|
and active = #{params.active}
|
|
</if>
|
|
<if test="params.customerNo != null and params.customerNo != ''">
|
|
and customer_no like #{params.customerNo}
|
|
</if>
|
|
<if test="params.customerName != null and params.customerName != ''">
|
|
and customer_name like #{params.customerName}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="queryCustomer" resultType="com.gaotao.modules.customer.entity.Customer">
|
|
select site, customer_no, customer_name, active, create_time, create_by
|
|
from customer
|
|
where customer_no = #{customerNo}
|
|
and site = #{site}
|
|
and active = #{active}
|
|
and customer_name = #{customerName}
|
|
</select>
|
|
</mapper>
|