From 1b30538f3573bbc7ac5db3340f41b279e9e29e36 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期三, 28 二月 2024 18:41:19 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/target/classes/mapper/sd/Customer.xml |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 1 deletions(-)

diff --git a/north-glass-erp/target/classes/mapper/sd/Customer.xml b/north-glass-erp/target/classes/mapper/sd/Customer.xml
index e662c65..69697a9 100644
--- a/north-glass-erp/target/classes/mapper/sd/Customer.xml
+++ b/north-glass-erp/target/classes/mapper/sd/Customer.xml
@@ -2,10 +2,93 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
+
     <select id="getCustomerList">
         select
             *
         from
-            customer
+            sd.customer
     </select>
+    <select id="getseletCustomer">
+        select
+            *
+        from
+            sd.customer c
+        <where>
+            <if test="customer.id != null and customer.id != ''">
+                and c.id regexp #{customer.id}
+            </if>
+            <if test="customer.customerName != null and customer.customerName != ''">
+                and c.customer_name regexp #{customer.customerName}
+            </if>
+            <if test="customer.grade != null and customer.grade != ''">
+                and c.grade regexp #{customer.grade}
+            </if>
+            <if test="customer.moneyLimit != null and customer.moneyLimit != ''">
+                and c.money_limit regexp REGEXP_REPLACE(#{customer.moneyLimit},'\\.0+$','')
+            </if>
+            <if test="customer.address != null and customer.address != ''">
+                and c.address regexp #{customer.address}
+            </if>
+            <if test="customer.contact != null and customer.contact != ''">
+                and c.contact regexp #{customer.contact}
+            </if>
+            <if test="customer.phone != null and customer.phone != ''">
+                and c.phone regexp #{customer.phone}
+            </if>
+
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getseletCustomerPageTotal">
+        select
+            CEILING(count(id)/#{pageSize}) as 'pageTotal',
+            count(id) as 'total'
+        from
+            sd.customer c
+        <where>
+            <if test="customer.id != null and customer.id != ''">
+                and c.id regexp #{customer.id}
+            </if>
+            <if test="customer.customerName != null and customer.customerName != ''">
+                and c.customer_name regexp #{customer.customerName}
+            </if>
+            <if test="customer.grade != null and customer.grade != ''">
+                and c.grade regexp #{customer.grade}
+            </if>
+            <if test="customer.moneyLimit != null and customer.moneyLimit != ''">
+                and c.money_limit regexp REGEXP_REPLACE(#{customer.moneyLimit},'\\.0+$','')
+            </if>
+            <if test="customer.address != null and customer.address != ''">
+                and c.address regexp #{customer.address}
+            </if>
+            <if test="customer.contact != null and customer.contact != ''">
+                and c.contact regexp #{customer.contact}
+            </if>
+            <if test="customer.phone != null and customer.phone != ''">
+                and c.phone regexp #{customer.phone}
+            </if>
+
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <insert id="insertCustomer"  useGeneratedKeys="true" >
+        insert into sd.customer(customer_name,grade,money_limit,address,contact,phone)
+        values (
+                   #{customer.customerName},#{customer.grade},#{customer.moneyLimit},
+                #{customer.address},#{customer.contact},#{customer.phone}
+               )
+    </insert>
+
+    <update id="updateCustomer"  useGeneratedKeys="true" >
+        update sd.customer set customer_name=#{customer.customerName},grade=#{customer.grade},
+                                    money_limit=#{customer.moneyLimit},address= #{customer.address},
+                                    contact=#{customer.contact},phone=#{customer.phone} where id=#{customer.id}
+    </update>
+
+    <delete id="deleteCustomer" >
+        delete from sd.customer  where id=#{customer.id}
+    </delete>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0