From caa6e4cb9d9077dc0fa5f81e26e6e5655e41567b Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 월, 08 11월 2021 17:53:16 +0900
Subject: [PATCH] 업체 관리 백엔드 수정

---
 src/main/resources/migration/V1_11__Alter_Table.sql                 |    7 ++++---
 src/main/resources/mybatis/query-template/companyField-template.xml |   24 ++++++++++++------------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/main/resources/migration/V1_11__Alter_Table.sql b/src/main/resources/migration/V1_11__Alter_Table.sql
index 0428f74..57d1d90 100644
--- a/src/main/resources/migration/V1_11__Alter_Table.sql
+++ b/src/main/resources/migration/V1_11__Alter_Table.sql
@@ -1,9 +1,10 @@
 CREATE TABLE `company_field`(
     `id` BIGINT(11) AUTO_INCREMENT,
     `name` VARCHAR(50) NOT NULL,
-    `tel` VARCHAR (50) NOT NULL,
-    `email` VARCHAR (255) NOT NULL,
-    `memo` VARCHAR(255) NOT NULL,
+    `tel` VARCHAR (50) NULL,
+    `email` VARCHAR (255) NULL,
+    `memo` VARCHAR(255) NULL,
+    `register_id` BIGINT(20) NOT NULL,
     `register_date` TIMESTAMP NULL,
     `modify_id` BIGINT(20) NOT NULL,
     `modify_date` TIMESTAMP NULL,
diff --git a/src/main/resources/mybatis/query-template/companyField-template.xml b/src/main/resources/mybatis/query-template/companyField-template.xml
index 4dd9d58..224bdf3 100644
--- a/src/main/resources/mybatis/query-template/companyField-template.xml
+++ b/src/main/resources/mybatis/query-template/companyField-template.xml
@@ -5,19 +5,19 @@
 
     <select id="find" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.CompanyFieldCondition">
         SELECT
-        c.id as id,
-        c.name as name,
-        c.tel as tel,
-        c.email as email,
-        c.memo as memo
+        cf.id as id,
+        cf.name as name,
+        cf.tel as tel,
+        cf.email as email,
+        cf.memo as memo
         FROM
-        company c
+        company_field cf
         WHERE 1=1
         <if test="name != '' and name != null">
-            AND c.name like CONCAT('%',#{name},'%')
+            AND cf.name like CONCAT('%',#{name},'%')
         </if>
         <if test="id != '' and id != null">
-            AND c.id like CONCAT('%',#{id},'%')
+            AND cf.id like CONCAT('%',#{id},'%')
         </if>
         <if test="pageSize != '' and pageSize != null">
             limit #{pageSize} offset #{page};
@@ -26,15 +26,15 @@
 
     <select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.CompanyFieldCondition">
         SELECT
-        count(c.id)
+        count(cf.id)
         FROM
-        company c
+        company_field cf
         WHERE 1=1
         <if test="name != '' and name != null">
-            AND c.name like CONCAT('%',#{name},'%')
+            AND cf.name like CONCAT('%',#{name},'%')
         </if>
         <if test="id != '' and id != null">
-            AND c.id like CONCAT('%',#{id},'%')
+            AND cf.id like CONCAT('%',#{id},'%')
         </if>
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0