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.

60 lines
2.4 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gaotao.modules.customer.mapper.CustomerMapper">
  4. <select id="selectCustomerList" resultType="com.gaotao.modules.customer.entity.Customer">
  5. select site, customer_no, customer_name, active, create_time, create_by
  6. from customer
  7. <where>
  8. <if test="site != null and site != ''">
  9. and site = #{site}
  10. </if>
  11. <if test="active != null and active != ''">
  12. and active = #{active}
  13. </if>
  14. <if test="customerNo != null and customerNo != ''">
  15. and customer_no like #{customerNo}
  16. </if>
  17. <if test="customerName != null and customerName != ''">
  18. and customer_name like #{customerName}
  19. </if>
  20. </where>
  21. </select>
  22. <select id="generateCustomerNo" resultType="java.lang.Integer">
  23. SELECT ISNULL(MAX(CAST(SUBSTRING(customer_no, 2, LEN(customer_no)-1) AS INT)),0) AS MaxCustomerNo
  24. FROM customer
  25. <where>
  26. <if test="site != null and site != ''">
  27. site = #{site}
  28. </if>
  29. </where>
  30. </select>
  31. <select id="selectCustomerPage" resultType="com.gaotao.modules.customer.entity.Customer">
  32. select site, customer_no, customer_name, active, create_time, create_by
  33. from customer
  34. <where>
  35. <if test="params.site != null and params.site != ''">
  36. and site = #{params.site}
  37. </if>
  38. <if test="params.active != null and params.active != ''">
  39. and active = #{params.active}
  40. </if>
  41. <if test="params.customerNo != null and params.customerNo != ''">
  42. and customer_no like #{params.customerNo}
  43. </if>
  44. <if test="params.customerName != null and params.customerName != ''">
  45. and customer_name like #{params.customerName}
  46. </if>
  47. </where>
  48. </select>
  49. <select id="queryCustomer" resultType="com.gaotao.modules.customer.entity.Customer">
  50. select site, customer_no, customer_name, active, create_time, create_by
  51. from customer
  52. where customer_no = #{customerNo}
  53. and site = #{site}
  54. and active = #{active}
  55. and customer_name = #{customerName}
  56. </select>
  57. </mapper>