Browse Source

基础类mapper xml修改

zdsong 1 week ago
parent
commit
03b5c0d3fc

+ 26 - 16
farm-common-biz/src/main/java/jp/yamoto/farm/common/dev/ExcelToJavaGenerator.java

@@ -27,14 +27,14 @@ public class ExcelToJavaGenerator {
     public static void generateMapperL(String excelFilePath, String outputSqlPath) {
 
         List<String> fieldGenerateLst = new ArrayList<String>();
-        fieldGenerateLst.add(excelFilePath);
-        fieldGenerateLst.add("create_time");
-        fieldGenerateLst.add("create_by");
-        fieldGenerateLst.add("create_pg_id");
-        fieldGenerateLst.add("update_time");
-        fieldGenerateLst.add("update_by");
-        fieldGenerateLst.add("update_pg_id");
-        fieldGenerateLst.add("version");
+
+//        fieldGenerateLst.add("create_time");
+//        fieldGenerateLst.add("create_by");
+//        fieldGenerateLst.add("create_pg_id");
+//        fieldGenerateLst.add("update_time");
+//        fieldGenerateLst.add("update_by");
+//        fieldGenerateLst.add("update_pg_id");
+//        fieldGenerateLst.add("version");
 
         try (FileInputStream fis = new FileInputStream(excelFilePath);
              Workbook workbook = getWorkbook(fis, excelFilePath)) {
@@ -300,19 +300,29 @@ public class ExcelToJavaGenerator {
             // ResultMap构建
             resultMapColumnSb.append("        <result property=").append("\"").append(camelFieldName).append("\"").append(" column=").append("\"").append(fieldName).append("\"").append("/>\n");
 
+            List<String> fieldWhereLst = new ArrayList<String>();
+            fieldWhereLst.add("create_time");
+            fieldWhereLst.add("create_by");
+            fieldWhereLst.add("update_time");
+            fieldWhereLst.add("update_by");
+
             // Select Filed 构建
+
             if (!fieldGenerateLst.contains(fieldName)) {
 
                 selectFieldMapColumnSb.append("          ").append(fieldName).append(",\n");
-                if ("varchar".equalsIgnoreCase(fieldType) && !fieldLength.isEmpty()) {
-                    // Select List 构建
-                    selectListMapColumnSb.append("            <if test=").append("\"").append(camelFieldName).append(" != null  and ").append(camelFieldName).append(" != ").append("\'").append("\'").append("\"").append(">\n");
-                } else {
-                    selectListMapColumnSb.append("            <if test=").append("\"").append(camelFieldName).append(" != null ").append("\"").append(">\n");
-                }
 
-                selectListMapColumnSb.append("                and ").append(fieldName).append(" = #{").append(camelFieldName).append("}\n");
-                selectListMapColumnSb.append("            </if>\n");
+                if(!fieldWhereLst.contains(fieldName)) {
+                    if ("varchar".equalsIgnoreCase(fieldType) && !fieldLength.isEmpty()) {
+                        // Select List 构建
+                        selectListMapColumnSb.append("            <if test=").append("\"").append(camelFieldName).append(" != null  and ").append(camelFieldName).append(" != ").append("\'").append("\'").append("\"").append(">\n");
+                    } else {
+                        selectListMapColumnSb.append("            <if test=").append("\"").append(camelFieldName).append(" != null ").append("\"").append(">\n");
+                    }
+
+                    selectListMapColumnSb.append("                and ").append(fieldName).append(" = #{").append(camelFieldName).append("}\n");
+                    selectListMapColumnSb.append("            </if>\n");
+                }
             }
             if (primaryKeyColumn.equals(fieldName)) {
                 selectByIdMapColumnSb.append(fieldName).append(" = #{").append(camelFieldName).append("}\n");

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssAskBaseMapper.xml

@@ -54,7 +54,14 @@
           phone_number,
           farmer_id,
           order_id,
-          user_cd
+          user_cd,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_ask
     </sql>
     <select id="selectList" parameterType="BssAskEntity" resultMap="BssAskEntityResult">
@@ -120,6 +127,15 @@
             <if test="userCd != null  and userCd != ''">
                 and user_cd = #{userCd}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssAskHistoryBaseMapper.xml

@@ -32,7 +32,14 @@
           seq_no,
           ask_answer_remark,
           answer_user,
-          answer_time
+          answer_time,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_ask_history
     </sql>
     <select id="selectList" parameterType="BssAskHistoryEntity" resultMap="BssAskHistoryEntityResult">
@@ -65,6 +72,15 @@
             <if test="answerTime != null  and answerTime != ''">
                 and answer_time = #{answerTime}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssAskMessageBaseMapper.xml

@@ -38,7 +38,14 @@
           reception_time,
           message_type,
           order_id,
-          discontinued_flg
+          discontinued_flg,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_ask_message
     </sql>
     <select id="selectList" parameterType="BssAskMessageEntity" resultMap="BssAskMessageEntityResult">
@@ -80,6 +87,15 @@
             <if test="discontinuedFlg != null  and discontinuedFlg != ''">
                 and discontinued_flg = #{discontinuedFlg}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssBatchExecuteHistoryBaseMapper.xml

@@ -34,7 +34,14 @@
           email_send_flg,
           total_lines,
           success_lines,
-          fail_lines
+          fail_lines,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_batch_execute_history
     </sql>
     <select id="selectList" parameterType="BssBatchExecuteHistoryEntity" resultMap="BssBatchExecuteHistoryEntityResult">
@@ -70,6 +77,15 @@
             <if test="failLines != null ">
                 and fail_lines = #{failLines}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssOrderBaseMapper.xml

@@ -68,7 +68,14 @@
           item_total,
           totoal_carriage,
           shop_pay_method,
-          shop_pay_situation
+          shop_pay_situation,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_order
     </sql>
     <select id="selectList" parameterType="BssOrderEntity" resultMap="BssOrderEntityResult">
@@ -155,6 +162,15 @@
             <if test="shopPaySituation != null  and shopPaySituation != ''">
                 and shop_pay_situation = #{shopPaySituation}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssOrderDeliveryBaseMapper.xml

@@ -54,7 +54,14 @@
           iuggage_status,
           carriage,
           farmer_id,
-          remark
+          remark,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_order_delivery
     </sql>
     <select id="selectList" parameterType="BssOrderDeliveryEntity" resultMap="BssOrderDeliveryEntityResult">
@@ -120,6 +127,15 @@
             <if test="remark != null  and remark != ''">
                 and remark = #{remark}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssOrderDeliveryItemBaseMapper.xml

@@ -44,7 +44,14 @@
           item_sales_tax,
           qty,
           subtotal,
-          subtotal_tax
+          subtotal_tax,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_order_delivery_item
     </sql>
     <select id="selectList" parameterType="BssOrderDeliveryItemEntity" resultMap="BssOrderDeliveryItemEntityResult">
@@ -95,6 +102,15 @@
             <if test="subtotalTax != null ">
                 and subtotal_tax = #{subtotalTax}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/BssOrderStatusHistoryBaseMapper.xml

@@ -22,7 +22,14 @@
           id,
           order_id,
           status,
-          process_date
+          process_date,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_order_status_history
     </sql>
     <select id="selectList" parameterType="BssOrderStatusHistoryEntity" resultMap="BssOrderStatusHistoryEntityResult">
@@ -40,6 +47,15 @@
             <if test="processDate != null  and processDate != ''">
                 and process_date = #{processDate}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 18 - 31
farm-common-biz/src/main/resources/mapper/BssUserCertificationBaseMapper.xml

@@ -3,7 +3,6 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="jp.yamoto.farm.common.biz.mapper.BssUserCertificationBaseMapper">
-
    <resultMap type="BssUserCertificationEntity" id="BssUserCertificationEntityResult">
         <result property="id" column="id"/>
         <result property="certificationFlg" column="certification_flg"/>
@@ -22,8 +21,8 @@
         <result property="updateBy" column="update_by"/>
         <result property="updatePgId" column="update_pg_id"/>
         <result property="version" column="version"/>
-    </resultMap>
 
+    </resultMap>
     <sql id="selectBssUserCertification">
         select
           id,
@@ -35,10 +34,16 @@
           start_time,
           end_time,
           certification_code,
-          discontinued_flg
+          discontinued_flg,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from bss_user_certification
     </sql>
-
     <select id="selectList" parameterType="BssUserCertificationEntity" resultMap="BssUserCertificationEntityResult">
         <include refid="selectBssUserCertification"/>
         <where>
@@ -72,6 +77,15 @@
             <if test="discontinuedFlg != null  and discontinuedFlg != ''">
                 and discontinued_flg = #{discontinuedFlg}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>
@@ -265,31 +279,4 @@
 
     </delete>
 
-    <!--廃止-->
-    <update id="deleteLogicByIdAndVersion" parameterType="BssUserCertificationEntity">
-        update
-        bss_user_certification
-        set
-        discontinued_flg = 1,
-        version = version + 1,
-
-        <if test="updateBy != null">
-            update_by = #{updateBy},
-        </if>
-        <if test="updateTime != null">
-            update_time = #{updateTime}
-        </if>
-        <if test="updatePgId != null">
-            update_pg_id = #{updatePgId},
-        </if>
-
-        <where>
-            <if test="id != null  and id != ''">
-                and id = #{id}
-            </if>
-            and version = #{version}
-            and discontinued_flg = 0
-        </where>
-    </update>
-
  </mapper>

+ 15 - 0
farm-common-biz/src/main/resources/mapper/MastCustomerBaseMapper.xml

@@ -65,6 +65,12 @@
           system_source_flg,
           discontinued_flg,
           discontinued_date,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
           version
         from mast_customer
     </sql>
@@ -146,6 +152,15 @@
             <if test="discontinuedDate != null  and discontinuedDate != ''">
                 and discontinued_date = #{discontinuedDate}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/MastFarmerBaseMapper.xml

@@ -58,7 +58,14 @@
           rakuuru_cart_pwd,
           user_password,
           discontinued_flg,
-          discontinued_date
+          discontinued_date,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from mast_farmer
     </sql>
     <select id="selectList" parameterType="MastFarmerEntity" resultMap="MastFarmerEntityResult">
@@ -130,6 +137,15 @@
             <if test="discontinuedDate != null  and discontinuedDate != ''">
                 and discontinued_date = #{discontinuedDate}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/MastItemBaseMapper.xml

@@ -56,7 +56,14 @@
           item_page_public_flg,
           farmer_id,
           discontinued_flg,
-          discontinued_date
+          discontinued_date,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from mast_item
     </sql>
     <select id="selectList" parameterType="MastItemEntity" resultMap="MastItemEntityResult">
@@ -125,6 +132,15 @@
             <if test="discontinuedDate != null  and discontinuedDate != ''">
                 and discontinued_date = #{discontinuedDate}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>

+ 17 - 1
farm-common-biz/src/main/resources/mapper/MastItemImageBaseMapper.xml

@@ -26,7 +26,14 @@
           image_url,
           image_other_url,
           image_list_url,
-          discontinued_date
+          discontinued_date,
+          create_time,
+          create_by,
+          create_pg_id,
+          update_time,
+          update_by,
+          update_pg_id,
+          version
         from mast_item_image
     </sql>
     <select id="selectList" parameterType="MastItemImageEntity" resultMap="MastItemImageEntityResult">
@@ -50,6 +57,15 @@
             <if test="discontinuedDate != null  and discontinuedDate != ''">
                 and discontinued_date = #{discontinuedDate}
             </if>
+            <if test="createPgId != null  and createPgId != ''">
+                and create_pg_id = #{createPgId}
+            </if>
+            <if test="updatePgId != null  and updatePgId != ''">
+                and update_pg_id = #{updatePgId}
+            </if>
+            <if test="version != null ">
+                and version = #{version}
+            </if>
 
         </where>
     </select>