Bladeren bron

问题修改

changhaoning 1 jaar geleden
bovenliggende
commit
5ff2ff1f72

+ 17 - 11
src/main/java/com/dk/mdm/mapper/mst/IntegralItemMapper.xml

@@ -56,7 +56,7 @@
 
     <!-- 通用查询列 -->
     <sql id="Base_Column_List_list">
-        item_id, integral_type, integral, cp_id, cp_id_from, acc_date, flg_valid, user_id, remarks
+        tmii.item_id, tmii.integral_type, tmii.integral, tmii.cp_id, tmii.cp_id_from, tmii.acc_date, tmii.flg_valid, tmii.user_id, tmii.remarks
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -76,28 +76,28 @@
     <sql id="Condition_list">
         <where>
             <if test="integralType != null and integralType != ''">
-                AND integral_type = #{integralType}
+                AND tmii.integral_type = #{integralType}
             </if>
             <if test="integral != null">
-                AND integral = #{integral}
+                AND tmii.integral = #{integral}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
+                AND tmii.cp_id = #{cpId}
             </if>
             <if test="cpIdFrom != null">
-                AND cp_id_from = #{cpIdFrom}
+                AND tmii.cp_id_from = #{cpIdFrom}
             </if>
             <if test="accDate != null">
-                AND acc_date = #{accDate}
+                AND tmii.acc_date = #{accDate}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND tmii.flg_valid = #{flgValid}
             </if>
             <if test="userId != null and userId != ''">
-                AND user_id = #{userId}
+                AND tmii.user_id = #{userId}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND tmii.remarks = #{remarks}
             </if>
         </where>
     </sql>
@@ -114,7 +114,13 @@
     <select id="selectByCond" resultMap="BaseResultMap_list">
         SELECT
         <include refid="Base_Column_List_list"/>
-        FROM dkic_a.t_mst_integral_item
+        , sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) as "integralTypeName"
+        , twu.user_name as "userName"
+        FROM dkic_a.t_mst_integral_item tmii
+        left JOIN sys.t_data_kind tdk
+        on tmii.integral_type = tdk.kind_code
+        left JOIN dkic_a.t_wx_user twu
+        on tmii.user_id = twu.user_id
         <include refid="Condition_list"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -125,7 +131,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_a.t_mst_integral_item
+        FROM dkic_a.t_mst_integral_item as tmii
         <include refid="Condition_list"/>
     </select>
 

+ 12 - 5
src/main/java/com/dk/mdm/mapper/mst/IntegralMapper.xml

@@ -32,7 +32,7 @@
 
     <!-- 通用查询列 -->
     <sql id="Base_Column_List_list">
-        cp_id, integral, flg_valid
+        tmi.cp_id, tmi.integral, tmi.flg_valid
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -45,11 +45,14 @@
     <!-- 通用条件列 -->
     <sql id="Condition_list">
         <where>
+            <if test="cpId != null">
+                AND tmi.cp_id = #{cpId}
+            </if>
             <if test="integral != null">
-                AND integral = #{integral}
+                AND tmi.integral = #{integral}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND tmi.flg_valid = #{flgValid}
             </if>
         </where>
     </sql>
@@ -66,7 +69,11 @@
     <select id="selectByCond" resultMap="BaseResultMap_list">
         SELECT
         <include refid="Base_Column_List_list"/>
-        FROM dkic_a.t_mst_integral
+        ,tac.cp_code as "cpCode"
+        ,tac.cp_name as "cpName"
+        FROM dkic_a.t_mst_integral tmi
+        left JOIN dkic_a.t_a_company tac
+        on tmi.cp_id = tac.cp_id
         <include refid="Condition_list"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -77,7 +84,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_a.t_mst_integral
+        FROM dkic_a.t_mst_integral as tmi
         <include refid="Condition_list"/>
     </select>
 

+ 3 - 0
src/main/java/com/dk/mdm/mapper/mst/IntegralShareMapper.xml

@@ -59,6 +59,9 @@
     <!-- 通用条件列 -->
     <sql id="Condition_list">
         <where>
+            <if test="cpId != null and cpId != ''">
+                AND cp_id = #{cpId}
+            </if>
             <if test="tacticId != null and tacticId != ''">
                 AND tactic_id = #{tacticId}
             </if>

+ 12 - 9
src/main/java/com/dk/mdm/mapper/mst/SignRecordMapper.xml

@@ -47,7 +47,7 @@
 
     <!-- 通用查询列 -->
     <sql id="Base_Column_List_list">
-        record_id, user_id, cp_id, sign_days, last_date, flg_valid, remarks
+        tmsr.record_id, tmsr.user_id, tmsr.cp_id, tmsr.sign_days, tmsr.last_date, tmsr.flg_valid, tmsr.remarks
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -65,22 +65,22 @@
     <sql id="Condition_list">
         <where>
             <if test="userId != null and userId != ''">
-                AND user_id = #{userId}
+                AND tmsr.user_id = #{userId}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
+                AND tmsr.cp_id = #{cpId}
             </if>
             <if test="signDays != null">
-                AND sign_days = #{signDays}
+                AND tmsr.sign_days = #{signDays}
             </if>
             <if test="lastDate != null">
-                AND last_date = #{lastDate}
+                AND tmsr.last_date = #{lastDate}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND tmsr.flg_valid = #{flgValid}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND tmsr.remarks = #{remarks}
             </if>
         </where>
     </sql>
@@ -97,7 +97,10 @@
     <select id="selectByCond" resultMap="BaseResultMap_list">
         SELECT
         <include refid="Base_Column_List_list"/>
-        FROM dkic_a.t_mst_sign_record
+        , twu.user_name as "userName"
+        FROM dkic_a.t_mst_sign_record tmsr
+        left JOIN dkic_a.t_wx_user twu
+        on tmsr.user_id = twu.user_id
         <include refid="Condition_list"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -108,7 +111,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_a.t_mst_sign_record
+        FROM dkic_a.t_mst_sign_record tmsr
         <include refid="Condition_list"/>
     </select>
 

+ 7 - 2
src/main/java/com/dk/mdm/model/response/mst/IntegralItemResponse.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.time.LocalDate;
 import java.util.List;
 import java.time.LocalDateTime;
 
@@ -84,9 +85,9 @@ public class IntegralItemResponse extends PageInfo<IntegralItemResponse> impleme
      */
     @Excel(name = "日期")
     @ApiModelProperty(value = "日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime accDate;
+    private LocalDate accDate;
 
 
     /**
@@ -113,6 +114,10 @@ public class IntegralItemResponse extends PageInfo<IntegralItemResponse> impleme
     @ApiModelProperty(value = "备注")
     private String remarks;
 
+    private String integralTypeName;
+
+    private String userName;
+
 
     /*
      * 相关属性

+ 15 - 0
src/main/java/com/dk/mdm/model/response/mst/IntegralResponse.java

@@ -60,6 +60,21 @@ public class IntegralResponse extends PageInfo<IntegralResponse> implements Seri
     @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
     private Boolean flgValid;
 
+    /**
+     * 公司代码 (系统登录用)
+     */
+    @Excel(name = "公司代码 (系统登录用)")
+    @ApiModelProperty(value = "公司代码 (系统登录用)")
+    private String cpCode;
+
+
+    /**
+     * 公司名称
+     */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String cpName;
+
 
     /*
      * 相关属性

+ 1 - 1
src/main/java/com/dk/mdm/model/response/mst/IntegralShareResponse.java

@@ -87,7 +87,7 @@ public class IntegralShareResponse extends PageInfo<IntegralShareResponse> imple
      */
     @Excel(name = "用户ID")
     @ApiModelProperty(value = "用户ID")
-    private Long userId;
+    private String userId;
 
 
     /*

+ 5 - 2
src/main/java/com/dk/mdm/model/response/mst/SignRecordResponse.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.time.LocalDate;
 import java.util.List;
 import java.time.LocalDateTime;
 
@@ -77,9 +78,9 @@ public class SignRecordResponse extends PageInfo<SignRecordResponse> implements
      */
     @Excel(name = "最近签到日期")
     @ApiModelProperty(value = "最近签到日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime lastDate;
+    private LocalDate lastDate;
 
 
     /**
@@ -97,6 +98,8 @@ public class SignRecordResponse extends PageInfo<SignRecordResponse> implements
     @ApiModelProperty(value = "备注")
     private String remarks;
 
+    private String userName;
+
 
     /*
      * 相关属性