Explorar o código

공지사항 수정 및 가맹점등록 기능 mapper ,xml 작업

dwkim %!s(int64=2) %!d(string=hai) anos
pai
achega
e6225a762c

+ 27 - 0
src/main/java/com/oqpo/api/entity/stinfo/AfflSaleInfoEntity.java

@@ -0,0 +1,27 @@
1
+package com.oqpo.api.entity.stinfo;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import java.io.Serializable;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+public class AfflSaleInfoEntity implements Serializable {
13
+    private static final long serialVersionUID = -3590936033715917450L;
14
+
15
+    private String afflShopId ;
16
+    private String afflShopNm ;
17
+    private String saleMgrId ;
18
+    private String saleMgrNm ;
19
+    private String delYn ;
20
+    private String sysRregDttm ;
21
+    private String sysRegId ;
22
+    private String sysChgDttm ;
23
+    private String sysChgId ;
24
+
25
+    private SaleMgrMgntEntity saleMgrInfo ;
26
+
27
+}

+ 55 - 0
src/main/java/com/oqpo/api/entity/stinfo/AfflShopBaseInfoEntity.java

@@ -0,0 +1,55 @@
1
+package com.oqpo.api.entity.stinfo;
2
+
3
+import com.oqpo.api.entity.CodeEntity;
4
+import lombok.Getter;
5
+import lombok.Setter;
6
+import lombok.ToString;
7
+
8
+import java.io.Serializable;
9
+import java.util.List;
10
+
11
+@Getter
12
+@Setter
13
+@ToString
14
+public class AfflShopBaseInfoEntity implements Serializable {
15
+    private static final long serialVersionUID = -3590936033715917450L;
16
+
17
+    private String afflShopId ;
18
+    private String afflShopNm ;
19
+    private String stCd ;
20
+    private String stNm ;
21
+    private String afflAbbr ;
22
+    private String bsnsRegNo ;
23
+    private String corpRegNo ;
24
+    private String authType ;
25
+    private String authTypeNm;
26
+    private String bsnsCndt ;
27
+    private String ctgrBsns ;
28
+    private String ownerNm ;
29
+    private String ownerTelNo ;
30
+    private String rprstFaxNo ;
31
+    private String rprstEmail ;
32
+    private String zipNo ;
33
+    private String addr1 ;
34
+    private String addr2 ;
35
+    private String rprstTelNo ;
36
+    private String latX ;
37
+    private String longY ;
38
+    private String regDt ;
39
+    private String regTm ;
40
+    private String regId ;
41
+    private String joinSttDt ;
42
+    private String joinEndDt ;
43
+    private String cmpnyLogoFileNo ;
44
+    private String delYn ;
45
+    private String corpType ;
46
+    private String corpTypeNm;
47
+    private String sysRregDttm ;
48
+    private String sysRegId ;
49
+    private String sysChgDttm ;
50
+    private String sysChgId ;
51
+    private String joinDt;
52
+
53
+    private List<AfflSaleInfoEntity> afflSaleInfo;
54
+
55
+}

+ 36 - 0
src/main/java/com/oqpo/api/entity/stinfo/SaleMgrMgntEntity.java

@@ -0,0 +1,36 @@
1
+package com.oqpo.api.entity.stinfo;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import java.io.Serializable;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+public class SaleMgrMgntEntity implements Serializable {
13
+    private static final long serialVersionUID = -3590936033715917450L;
14
+
15
+    private String saleMgrId  ;
16
+    private String saleMgrNm  ;
17
+    private String stCd  ;
18
+    private String stNm  ;
19
+    private String saleType  ;
20
+    private String saleTypeNm  ;
21
+    private String pswd  ;
22
+    private String rprstTelNo  ;
23
+    private String rprstFaxNo  ;
24
+    private String rprstEmal  ;
25
+    private String zipNo  ;
26
+    private String addr1  ;
27
+    private String addr2  ;
28
+    private String regDt  ;
29
+    private String regId  ;
30
+    private String reg_tm  ;
31
+    private String sysRegDttm  ;
32
+    private String sysRegId  ;
33
+    private String sysChgDttm  ;
34
+    private String sysChgId  ;
35
+
36
+}

+ 32 - 0
src/main/java/com/oqpo/api/mapper/stinfo/AfflShopBaseInfoMapper.java

@@ -0,0 +1,32 @@
1
+package com.oqpo.api.mapper.stinfo;
2
+
3
+import com.oqpo.api.entity.CodeEntity;
4
+import com.oqpo.api.entity.stinfo.AfflSaleInfoEntity;
5
+import com.oqpo.api.entity.stinfo.AfflShopBaseInfoEntity;
6
+import com.oqpo.api.web.dto.request.GridRequest;
7
+import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+import java.util.List;
11
+
12
+@Mapper
13
+public interface AfflShopBaseInfoMapper {
14
+
15
+    int selectAfflShopGridList(@Param("userId") String userId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sAfflShopNm") String sAfflShopNm )throws Exception;
16
+
17
+    List<AfflShopBaseInfoEntity> selectAfflShopGridList(@Param("userId") String userId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sAfflShopNm") String sAfflShopNm , GridRequest gridRequest)throws Exception;
18
+
19
+    String selectAfflShopBaseIdDupYn(@Param("afflShopId") String afflShopId)   throws Exception;
20
+
21
+    int insertAfflShopBaseInfo(@Param("userId") String userId, AfflShopBaseInfoEntity entity) throws Exception;
22
+    int updateAfflShopBaseInfo(@Param("userId") String userId, AfflShopBaseInfoEntity entity) throws Exception;
23
+
24
+    int insertAfflSaleInfo(@Param("userId") String userId, List<AfflSaleInfoEntity> gridInsertData) throws Exception;
25
+
26
+    int deleteUserAuth(@Param("userId") String userId, List<AfflSaleInfoEntity> gridUpdateData) throws Exception;
27
+
28
+    AfflShopBaseInfoEntity selectAfflShopBaseInfo(@Param("afflShopId") String afflShopId)   throws Exception;
29
+
30
+    List<AfflSaleInfoEntity> selectAfflSaleTargetList(@Param("afflShopId") String afflShopId , GridRequest gridRequest)throws Exception;
31
+    int selectAfflSaleTargetCnt(@Param("afflShopId") String afflShopId)throws Exception;
32
+}

+ 2 - 8
src/main/resources/mybatis/sqlmaps/oper/Ntice.xml

@@ -37,10 +37,7 @@
37 37
             and    A.brand_id = #{sBrandId}
38 38
         </if>
39 39
         <if test="fromDt != null and fromDt != '' and  toDt != null and toDt != ''  ">
40
-            <![CDATA[
41
-            and A.noti_st_day >= #{fromDt}
42
-            and A.noti_ed_day <= #{toDt}
43
-            ]]>
40
+            and A.noti_st_day between #{fromDt} and #{toDt}
44 41
         </if>
45 42
         <if test="sNticeTitl != null and sNticeTitl != '' ">
46 43
         and A.ntice_titl like concat('%', #{sNticeTitl}, '%')
@@ -93,10 +90,7 @@
93 90
             and    A.brand_id = #{sBrandId}
94 91
         </if>
95 92
         <if test="fromDt != null and fromDt != '' and  toDt != null and toDt != ''  ">
96
-            <![CDATA[
97
-            and A.noti_st_day >= #{fromDt}
98
-            and A.noti_ed_day <= #{toDt}
99
-            ]]>
93
+            and A.noti_st_day between #{fromDt} and #{toDt}
100 94
         </if>
101 95
         <if test="sNticeTitl != null and sNticeTitl != '' ">
102 96
             and A.ntice_titl like concat('%', #{sNticeTitl}, '%')

+ 168 - 0
src/main/resources/mybatis/sqlmaps/stinfo/AfflShopBaseInfo.xml

@@ -0,0 +1,168 @@
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
+
4
+<mapper namespace="com.oqpo.api.mapper.stinfo.AfflShopBaseInfoMapper">
5
+    <select id="selectAfflShopGridList" resultType="com.oqpo.api.entity.stinfo.AfflShopBaseInfoEntity">
6
+        select  /* selectAfflShopGridList */
7
+              affl_shop_id, affl_shop_nm, corp_type, st_cd, fn_code_nm('ST_CD', st_cd) as st_nm,  owner_nm
8
+              , concat(date_format(reg_dt,'%Y-%m-%d'), ' ~ ', date_format(reg_dt,'%Y-%m-%d')) as join_dt
9
+        from affl_shop_base_info
10
+        where 1=1
11
+        and   st_cd = 'S000'
12
+        <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
13
+        and   join_stt_dt between  #{fromDt} and #{toDt}
14
+        </if>
15
+        <if test="sAfflShopNm != null and sAfflShopNm != ''">
16
+        and   affl_shop_nm like concat('%',#{sAfflShopNm},'%')
17
+        </if>
18
+        <choose>
19
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
20
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
21
+                    <if test="gridRequest.sord == 'asc'.toString()">
22
+                        order by affl_shop_nm asc
23
+                    </if>
24
+                    <if test="gridRequest.sord == 'desc'.toString()">
25
+                        order by affl_shop_nm desc
26
+                    </if>
27
+                </if>
28
+            </when>
29
+            <otherwise>
30
+                order by affl_shop_nm asc
31
+            </otherwise>
32
+        </choose>
33
+        <if test="gridRequest.pagingYn == true">
34
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
35
+        </if>
36
+    </select>
37
+
38
+
39
+    <select id="selectAfflShopGridCnt" resultType="int">
40
+        select  /* selectAfflShopGridCnt */
41
+                count(*) as cnt
42
+        from affl_shop_base_info
43
+        where 1=1
44
+        and   st_cd = 'S000'
45
+        <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
46
+            and   join_stt_dt between  #{fromDt} and #{toDt}
47
+        </if>
48
+        <if test="sAfflShopNm != null and sAfflShopNm != ''">
49
+            and   affl_shop_nm like concat('%',#{sAfflShopNm},'%')
50
+        </if>
51
+    </select>
52
+
53
+
54
+    <select id="selectAfflShopBaseIdDupYn" resultType="String">
55
+        select  /* selectAfflShopBaseIdDupYn */
56
+                case when count(*) <![CDATA[ > ]]> 0 then 'Y' else 'N' end as dup_yn
57
+        from affl_shop_base_info
58
+        where affl_shop_id = #{afflShopId}
59
+    </select>
60
+
61
+    <insert id="insertAfflShopBaseInfo" >
62
+        insert into affl_shop_base_info  /* insertAfflShopBaseInfo */
63
+            ( affl_shop_id , affl_shop_nm, st_cd, affl_abbr, bsns_reg_no, corp_reg_no, auth_type, bsns_cndt, ctgr_bsns, owner_nm,
64
+             owner_tel_no, rprst_fax_no, rprst_email, zip_no, addr1, addr2, rprst_tel_no, lat_x, long_y, reg_dt, reg_tm, reg_id, join_stt_dt, join_end_dt,
65
+             cmpny_logo_file_no, del_yn, corp_type, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id )
66
+        values
67
+           (#{entity.afflShopId}, #{entity.afflShopNm}, #{entity.stCd}, #{entity.afflAbbr},  #{entity.bsnsRegNo}, #{entity.corpRegNo}, #{entity.authType}, #{entity.bsnsCndt}, #{entity.ctgrBsns}, #{entity.ownerNm},
68
+            #{entity.ownerTelNo}, #{entity.rprstFaxNo}, #{entity.rprstEmail}, #{entity.zipNo}, #{entity.addr1}, #{entity.addr2}, #{entity.rprstTelNo}, #{entity.latX}, #{entity.longY}, #{entity.regDt}, '000000', #{userId}, #{entity.joinSttDt}, #{entity.joinEndDt},
69
+            #{entity.cmpnyLogoFileNo}, 'N', #{entity.corpType}, now(), #{userId}, now(), #{userId} )
70
+    </insert>
71
+
72
+    <update id="updateAfflShopBaseInfo">
73
+        update affl_shop_base_info  /* updateAfflShopBaseInfo */
74
+        set
75
+           affl_shop_nm = #{entity.afflShopNm  }
76
+           ,st_cd = #{entity.stCd }
77
+           ,bsns_reg_no = #{entity.bsnsRegNo }
78
+           ,corp_reg_no = #{entity.corpRegNo }
79
+           ,auth_type = #{entity.authType }
80
+           ,bsns_cndt = #{entity.bsnsCndt }
81
+           ,ctgr_bsns = #{entity.ctgrBsns }
82
+           ,owner_nm = #{entity.ownerNm }
83
+           ,owner_tel_no = #{entity.ownerTelNo }
84
+           ,rprst_fax_no = #{entity.rprstFaxNo }
85
+           ,rprst_email = #{entity.rprstEmail }
86
+           ,zip_no = #{entity.zipNo }
87
+           ,addr1 = #{entity.addr1 }
88
+           ,addr2 = #{entity.addr2 }
89
+           ,rprst_tel_no = #{entity.rprstTelNo }
90
+           ,lat_x = #{entity.latX }
91
+           ,long_y = #{entity.longY }
92
+           ,join_stt_dt = #{entity.joinSttDt }
93
+           ,join_end_dt = #{entity.joinEndDt }
94
+           ,cmpny_logo_file_no = #{entity.cmpnyLogoFileNo }
95
+           ,corp_type = #{entity.corpType }
96
+           ,sys_chg_dttm = now()
97
+           ,sys_chg_id = #{userId }
98
+        where affl_shop_id  = #{entity.afflShopId }
99
+    </update>
100
+
101
+    <insert id="insertAfflSaleInfo" >
102
+        insert into /** insertAfflSaleInfo */ affl_sale_info
103
+        (affl_shop_id, sale_mgr_id, sys_reg_dtm, sys_reg_id, sys_chg_dtm, sys_chg_id)
104
+        values
105
+        <foreach collection="gridInsertData" item="item" separator=",">
106
+            ( #{item.afflShopId},#{item.saleMgrId}, now(), #{userId}, now(), #{userId})
107
+        </foreach>
108
+    </insert>
109
+
110
+    <update id="deleteUserAuth">
111
+        update affl_sale_info
112
+        set    del_yn = 'Y'
113
+        where  affl_shop_id = #{afflShopId}
114
+        and    saleMgrId   in
115
+        <foreach collection="gridDeleteData" item="item" separator="," open="(" close=")">
116
+            #{item.saleMgrId}
117
+        </foreach>
118
+    </update>
119
+
120
+    <select id="selectAfflShopBaseInfo" resultType="com.oqpo.api.entity.stinfo.AfflShopBaseInfoEntity">
121
+        select
122
+               affl_shop_id , affl_shop_nm, fn_code_nm('ST_CD',st_cd) as st_cd_nm
123
+                 , affl_abbr, bsns_reg_no, corp_reg_no
124
+               , auth_type, fn_code_nm('AUTH_TYPE',auth_type) as auth_type_nm, bsns_cndt, ctgr_bsns, owner_nm
125
+               , fn_get_telno(owner_tel_no) as owner_tel_no, fn_get_telno(rprst_fax_no) as rprst_fax_no, rprst_email, zip_no, addr1, addr2, rprst_tel_no, lat_x, long_y
126
+                , date_format(reg_dt,'%Y-%m-%d') as reg_dt, reg_id, concat(date_format(reg_dt,'%Y-%m-%d'), ' ~ ', date_format(reg_dt,'%Y-%m-%d')) as join_dt
127
+               , cmpny_logo_file_no, del_yn, fn_code_nm('CORP_TYPE',corp_type) as corp_type, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id
128
+         from affl_shop_base_info
129
+         where affl_shop_id  = #{afflShopId}
130
+    </select>
131
+
132
+    <select id="selectAfflSaleTargetList" resultType="com.oqpo.api.entity.stinfo.AfflSaleInfoEntity">
133
+        select sinfo.affl_shop_id , sinfo.sale_mgr_id, mgrm.sale_mgr_nm  as 'saleMgrInfo.sale_mget_nm', mgrm.rprst_emal as 'saleMgrInfo.rprst_emal'
134
+                ,fn_get_telno(mgrm.rprst_tel_no)   as 'saleMgrInfo.rprst_tel_no'
135
+                , mgrm.st_cd as 'saleMgrInfo.st_cd', fn_code_nm('ST_CD',mgrm.st_cd) as 'saleMgrInfo.st_nm'
136
+        from affl_sale_info  sinfo
137
+        join sale_mgr_mgnt mgrm on sinfo.sale_mgr_id = mgrm.sale_mgr_id and mgrm.st_cd <![CDATA[ <> ]]> 'S001'
138
+        where sinfo.del_yn = 'N'
139
+        and   sinfo.affl_shop_id = #{affl_shop_id}
140
+        <choose>
141
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
142
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
143
+                    <if test="gridRequest.sord == 'asc'.toString()">
144
+                        order by mgrm.sale_mgr_nm asc
145
+                    </if>
146
+                    <if test="gridRequest.sord == 'desc'.toString()">
147
+                        order by mgrm.sale_mgr_nm desc
148
+                    </if>
149
+                </if>
150
+            </when>
151
+            <otherwise>
152
+                order by mgrm.sale_mgr_nm asc
153
+            </otherwise>
154
+        </choose>
155
+        <if test="gridRequest.pagingYn == true">
156
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
157
+        </if>
158
+    </select>
159
+
160
+    <select id="selectAfflSaleTargetCnt" resultType="int">
161
+        select count(*)
162
+        from affl_sale_info
163
+        where affl_shop_id = #{affl_shop_id}
164
+        and   del_yn = 'N'
165
+    </select>
166
+
167
+
168
+</mapper>