dengyj пре 3 година
родитељ
комит
93e10c5f5d

+ 77 - 39
src/main/java/com/jisco/dynamicweight/dynamicworkdata/controller/DynamicWorkDataController.java

@@ -1,6 +1,7 @@
 package com.jisco.dynamicweight.dynamicworkdata.controller;
 
 import com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData;
+import com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -10,14 +11,21 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * DynamicWorkData RESTful接口:
+ *
  * @author generator
  * @version 1.0-SNAPSHORT 2022-10-26 09:59
  * 类描述
@@ -26,8 +34,8 @@ import java.util.List;
  * 作者:generator
  * 参考:
  * 描述:DynamicWorkData RESTful接口
- * @see null
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ * @see null
  */
 @RestController
 @RequestMapping("/${api.version}/dynamicworkdatas")
@@ -36,71 +44,101 @@ public class DynamicWorkDataController extends BaseRESTfulController {
     @Autowired
     IDynamicWorkDataService dynamicWorkDataService;
 
-    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiOperation(value = "获取列表", notes = "分页查询")
     @ApiImplicitParams({
-        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
     })
     //@RequiresPermissions("dynamicworkdata:view")
     @GetMapping(value = "/")
-    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+    public RESTfulResult list(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
         PageList<DynamicWorkData> list = dynamicWorkDataService.queryForPage(parmas, pageNum, pageSize);
         return success(list);
     }
 
-    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiOperation(value = "获取列表", notes = "分页模糊查询")
     @ApiImplicitParams({
-        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
     })
     //@RequiresPermissions("dynamicworkdata:view")
     @GetMapping(value = "/like/")
-    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+    public RESTfulResult listLike(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
         PageList<DynamicWorkData> list = dynamicWorkDataService.queryLikeForPage(parmas, pageNum, pageSize);
         return success(list);
     }
-    
-    @ApiOperation(value="创建", notes="根据DynamicWorkData对象创建")
-    @ApiImplicitParam(name = "dynamicWorkData", value = "详细实体dynamicWorkData", required = true, dataType = "DynamicWorkData")
-    //@RequiresPermissions("dynamicworkdata:create")
-    @PostMapping(value = "/")
-    public RESTfulResult add(@ModelAttribute DynamicWorkData model){
-        DynamicWorkData dynamicWorkData = dynamicWorkDataService.add(model);
-        return success(dynamicWorkData);
-    }
 
-    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
-    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
-    //@RequiresPermissions("dynamicworkdata:view")
-    @GetMapping(value = "/{id}")
-    public RESTfulResult get(@PathVariable String id){
-        DynamicWorkData dynamicWorkData = dynamicWorkDataService.getById(id);
-        return success(dynamicWorkData);
-    }
+//    @ApiOperation(value = "创建", notes = "根据DynamicWorkData对象创建")
+//    @ApiImplicitParam(name = "dynamicWorkData", value = "详细实体dynamicWorkData", required = true, dataType = "DynamicWorkData")
+//    //@RequiresPermissions("dynamicworkdata:create")
+//    @PostMapping(value = "/")
+//    public RESTfulResult add(@ModelAttribute DynamicWorkData model) {
+//        DynamicWorkData dynamicWorkData = dynamicWorkDataService.add(model);
+//        return success(dynamicWorkData);
+//    }
 
-    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的dynamicWorkData信息来更新详细信息")
+//    @ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
+//    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+//    //@RequiresPermissions("dynamicworkdata:view")
+//    @GetMapping(value = "/{id}")
+//    public RESTfulResult get(@PathVariable String id) {
+//        DynamicWorkData dynamicWorkData = dynamicWorkDataService.getById(id);
+//        return success(dynamicWorkData);
+//    }
+
+    @ApiOperation(value = "更新详细信息", notes = "根据url的id来指定更新对象,并根据传过来的dynamicWorkData信息来更新详细信息")
     @ApiImplicitParams({
-        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
-        @ApiImplicitParam(name = "dynamicWorkData", value = "详细实体dynamicWorkData", required = true, dataType = "DynamicWorkData")
+            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "dynamicWorkData", value = "详细实体dynamicWorkData", required = true, dataType = "DynamicWorkData")
     })
     //@RequiresPermissions("dynamicworkdata:update")
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody DynamicWorkData model){
+    @PutMapping(value = "/{id}", produces = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody DynamicWorkData model) {
         model.setId(id);
         DynamicWorkData dynamicWorkData = dynamicWorkDataService.modify(model);
         return success(dynamicWorkData);
     }
 
-    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("dynamicworkdata:delete")
     @DeleteMapping(value = "/{id}")//String
-    public RESTfulResult delete(@PathVariable String id){
-    	List<String> list = Arrays.asList(id.split(","));
-    	if(ListUtils.isNotEmpty(list)) {
-	    	List<String> ids = ListUtils.convertList(list);
-			  dynamicWorkDataService.delete(ids);
-    	}
-      return success();
+    public RESTfulResult delete(@PathVariable String id) {
+        List<String> list = Arrays.asList(id.split(","));
+        if (ListUtils.isNotEmpty(list)) {
+            List<String> ids = ListUtils.convertList(list);
+            dynamicWorkDataService.delete(ids);
+        }
+        return success();
+    }
+
+    @ApiOperation(value = "3#煤塔秤分批", notes = "3#煤塔秤分批")
+    @PostMapping(value = "/split3mt/{date1}/{date2}")
+    public RESTfulResult split3mt(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime date1, @PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime date2) {
+        Assert.notNull(date1, "开始时间不能为空!");
+        Assert.notNull(date2, "结束时间不能为空!");
+        Date startTime = Date.from(date1.atZone(ZoneId.systemDefault()).toInstant());
+        Date endTime = Date.from(date2.atZone(ZoneId.systemDefault()).toInstant());
+        dynamicWorkDataService.split3mt(startTime, endTime);
+        return success();
+    }
+
+    @ApiOperation(value = "重新获取动态秤称重数据", notes = "重新获取动态秤称重数据")
+    @PostMapping(value = "/recalc")
+    public RESTfulResult recalc() {
+        dynamicWorkDataService.recalc();
+        return success();
+    }
+
+    @ApiOperation(value = "批量删除", notes = "批量删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("dynamicworkupdata:delete")
+    @PutMapping(value = "/deleteBatch")//String
+    public RESTfulResult deleteBatch(@RequestBody List<DynamicWorkUpdata> list) {
+        if (ListUtils.isNotEmpty(list)) {
+            List<String> ids = list.stream().map(item -> item.getId()).collect(Collectors.toList());
+            dynamicWorkDataService.delete(ids);
+        }
+        return success();
     }
 }

+ 38 - 0
src/main/java/com/jisco/dynamicweight/dynamicworkdata/mapper/DynamicWorkDataMapper.java

@@ -4,6 +4,44 @@ import com.steerinfo.framework.mapper.IBaseMapper;
 import com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
 @Mapper
 public interface DynamicWorkDataMapper extends IBaseMapper<DynamicWorkData, String> {
+    /**
+     * 计算(M1M1B)去1#-4#焦炉总量
+     *
+     * @param receiver
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    BigDecimal getTotalWeightOfM1AndM1BTo1_4(String receiver, Date startTime, Date endTime);
+
+    /**
+     * 计算3煤塔总量
+     *
+     * @param material
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    BigDecimal getTotalWeightOf3MT(String material, Date startTime, Date endTime);
+
+    /**
+     * 查询(M1M1B)去1#-4#焦炉按物料分组后的重量
+     *
+     * @param memo
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    List<DynamicWorkData> getTotalWeightOfM1AndM1BTo1_4GroupByMaterial(String memo, Date startTime, Date endTime);
+
+    /**
+     * 重新获取动态秤称重数据
+     */
+    void recalc();
 }

+ 714 - 663
src/main/java/com/jisco/dynamicweight/dynamicworkdata/mapper/DynamicWorkDataMapper.xml

@@ -1,674 +1,725 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jisco.dynamicweight.dynamicworkdata.mapper.DynamicWorkDataMapper">
-  <resultMap id="BaseResultMap" type="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
-    <id column="DATA_NO" jdbcType="VARCHAR" property="dataNo" />
-    <result column="STATION_CODE" jdbcType="VARCHAR" property="stationCode" />
-    <result column="STATION_NAME" jdbcType="VARCHAR" property="stationName" />
-    <result column="MATERIAL_CODE" jdbcType="VARCHAR" property="materialCode" />
-    <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName" />
-    <result column="WEIGHT" jdbcType="DECIMAL" property="weight" />
-    <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
-    <result column="RECEIVER" jdbcType="VARCHAR" property="receiver" />
-    <result column="RECEIVER_CODE" jdbcType="VARCHAR" property="receiverCode" />
-    <result column="RECEIVER_TYPE" jdbcType="VARCHAR" property="receiverType" />
-    <result column="SENDER" jdbcType="VARCHAR" property="sender" />
-    <result column="SENDER_CODE" jdbcType="VARCHAR" property="senderCode" />
-    <result column="SENDER_TYPE" jdbcType="VARCHAR" property="senderType" />
-    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
-    <result column="EXPIRE_FLAG" jdbcType="VARCHAR" property="expireFlag" />
-    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
-    <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
-    <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
-    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
-    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
-    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
-  </resultMap>
-  <sql id="columns">
-    DATA_NO, STATION_CODE, STATION_NAME, MATERIAL_CODE, MATERIAL_NAME, WEIGHT, START_TIME, 
+    <resultMap id="BaseResultMap" type="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
+        <id column="DATA_NO" jdbcType="VARCHAR" property="dataNo"/>
+        <result column="STATION_CODE" jdbcType="VARCHAR" property="stationCode"/>
+        <result column="STATION_NAME" jdbcType="VARCHAR" property="stationName"/>
+        <result column="MATERIAL_CODE" jdbcType="VARCHAR" property="materialCode"/>
+        <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName"/>
+        <result column="WEIGHT" jdbcType="DECIMAL" property="weight"/>
+        <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime"/>
+        <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime"/>
+        <result column="RECEIVER" jdbcType="VARCHAR" property="receiver"/>
+        <result column="RECEIVER_CODE" jdbcType="VARCHAR" property="receiverCode"/>
+        <result column="RECEIVER_TYPE" jdbcType="VARCHAR" property="receiverType"/>
+        <result column="SENDER" jdbcType="VARCHAR" property="sender"/>
+        <result column="SENDER_CODE" jdbcType="VARCHAR" property="senderCode"/>
+        <result column="SENDER_TYPE" jdbcType="VARCHAR" property="senderType"/>
+        <result column="MEMO" jdbcType="VARCHAR" property="memo"/>
+        <result column="EXPIRE_FLAG" jdbcType="VARCHAR" property="expireFlag"/>
+        <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag"/>
+        <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo"/>
+        <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName"/>
+        <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo"/>
+        <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName"/>
+        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="columns">
+        DATA_NO
+        , STATION_CODE, STATION_NAME, MATERIAL_CODE, MATERIAL_NAME, WEIGHT, START_TIME,
     END_TIME, RECEIVER, RECEIVER_CODE, RECEIVER_TYPE, SENDER, SENDER_CODE, SENDER_TYPE, 
     MEMO, EXPIRE_FLAG, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
     UPDATE_MAN_NAME, UPDATE_TIME
-  </sql>
-  <sql id="columns_alias">
-    t.DATA_NO, t.STATION_CODE, t.STATION_NAME, t.MATERIAL_CODE, t.MATERIAL_NAME, t.WEIGHT, 
+    </sql>
+    <sql id="columns_alias">
+        t
+        .
+        DATA_NO
+        , t.STATION_CODE, t.STATION_NAME, t.MATERIAL_CODE, t.MATERIAL_NAME, t.WEIGHT,
     t.START_TIME, t.END_TIME, t.RECEIVER, t.RECEIVER_CODE, t.RECEIVER_TYPE, t.SENDER, 
     t.SENDER_CODE, t.SENDER_TYPE, t.MEMO, t.EXPIRE_FLAG, t.VALID_FLAG, t.CREATE_MAN_NO, 
     t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns" /> FROM DYNAMIC_WORK_DATA
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias" /> FROM DYNAMIC_WORK_DATA t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="dataNo != null and dataNo != ''">
-        and DATA_NO = #{dataNo}
-      </if>
-      <if test="stationCode != null and stationCode != ''">
-        and STATION_CODE = #{stationCode}
-      </if>
-      <if test="stationName != null and stationName != ''">
-        and STATION_NAME = #{stationName}
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        and MATERIAL_CODE = #{materialCode}
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME = #{materialName}
-      </if>
-      <if test="weight != null">
-        and WEIGHT = #{weight}
-      </if>
-      <if test="startTime != null">
-        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
-      </if>
-      <if test="endTime != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
-      </if>
-      <if test="receiver != null and receiver != ''">
-        and RECEIVER = #{receiver}
-      </if>
-      <if test="receiverCode != null and receiverCode != ''">
-        and RECEIVER_CODE = #{receiverCode}
-      </if>
-      <if test="receiverType != null and receiverType != ''">
-        and RECEIVER_TYPE = #{receiverType}
-      </if>
-      <if test="sender != null and sender != ''">
-        and SENDER = #{sender}
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        and SENDER_CODE = #{senderCode}
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE = #{senderType}
-      </if>
-      <if test="memo != null and memo != ''">
-        and MEMO = #{memo}
-      </if>
-      <if test="expireFlag != null and expireFlag != ''">
-        and EXPIRE_FLAG = #{expireFlag}
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        and VALID_FLAG = #{validFlag}
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        and CREATE_MAN_NO = #{createManNo}
-      </if>
-      <if test="createManName != null and createManName != ''">
-        and CREATE_MAN_NAME = #{createManName}
-      </if>
-      <if test="createTime != null">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
-      </if>
-      <if test="updateManNo != null and updateManNo != ''">
-        and UPDATE_MAN_NO = #{updateManNo}
-      </if>
-      <if test="updateManName != null and updateManName != ''">
-        and UPDATE_MAN_NAME = #{updateManName}
-      </if>
-      <if test="updateTime != null">
-        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
-      </if>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where> 
-      <if test="dataNo != null and dataNo != ''">
-        and DATA_NO LIKE '%${dataNo}%'
-      </if>
-      <if test="stationCode != null and stationCode != ''">
-        and STATION_CODE LIKE '%${stationCode}%'
-      </if>
-      <if test="stationName != null and stationName != ''">
-        and STATION_NAME LIKE '%${stationName}%'
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        and MATERIAL_CODE LIKE '%${materialCode}%'
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME LIKE '%${materialName}%'
-      </if>
-      <if test="weight != null">
-        and WEIGHT = #{weight}
-      </if>
-      <if test="startTime != null">
-        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
-      </if>
-      <if test="endTime != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
-      </if>
-      <if test="receiver != null and receiver != ''">
-        and RECEIVER LIKE '%${receiver}%'
-      </if>
-      <if test="receiverCode != null and receiverCode != ''">
-        and RECEIVER_CODE LIKE '%${receiverCode}%'
-      </if>
-      <if test="receiverType != null and receiverType != ''">
-        and RECEIVER_TYPE LIKE '%${receiverType}%'
-      </if>
-      <if test="sender != null and sender != ''">
-        and SENDER LIKE '%${sender}%'
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        and SENDER_CODE LIKE '%${senderCode}%'
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE LIKE '%${senderType}%'
-      </if>
-      <if test="memo != null and memo != ''">
-        and MEMO LIKE '%${memo}%'
-      </if>
-      <if test="expireFlag != null and expireFlag != ''">
-        and EXPIRE_FLAG LIKE '%${expireFlag}%'
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        and VALID_FLAG LIKE '%${validFlag}%'
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        and CREATE_MAN_NO LIKE '%${createManNo}%'
-      </if>
-      <if test="createManName != null and createManName != ''">
-        and CREATE_MAN_NAME LIKE '%${createManName}%'
-      </if>
-      <if test="createTime != null">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
-      </if>
-      <if test="updateManNo != null and updateManNo != ''">
-        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
-      </if>
-      <if test="updateManName != null and updateManName != ''">
-        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
-      </if>
-      <if test="updateTime != null">
-        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from DYNAMIC_WORK_DATA
-    where DATA_NO = #{dataNo,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from DYNAMIC_WORK_DATA
-    where 1!=1 
-      <if test="stationCode != null and stationCode != ''">
-        or STATION_CODE = #{stationCode}
-      </if>
-      <if test="stationName != null and stationName != ''">
-        or STATION_NAME = #{stationName}
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        or MATERIAL_CODE = #{materialCode}
-      </if>
-      <if test="materialName != null and materialName != ''">
-        or MATERIAL_NAME = #{materialName}
-      </if>
-      <if test="weight != null">
-        or WEIGHT = #{weight}
-      </if>
-      <if test="startTime != null">
-        or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
-      </if>
-      <if test="endTime != null">
-        or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
-      </if>
-      <if test="receiver != null and receiver != ''">
-        or RECEIVER = #{receiver}
-      </if>
-      <if test="receiverCode != null and receiverCode != ''">
-        or RECEIVER_CODE = #{receiverCode}
-      </if>
-      <if test="receiverType != null and receiverType != ''">
-        or RECEIVER_TYPE = #{receiverType}
-      </if>
-      <if test="sender != null and sender != ''">
-        or SENDER = #{sender}
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        or SENDER_CODE = #{senderCode}
-      </if>
-      <if test="senderType != null and senderType != ''">
-        or SENDER_TYPE = #{senderType}
-      </if>
-      <if test="memo != null and memo != ''">
-        or MEMO = #{memo}
-      </if>
-      <if test="expireFlag != null and expireFlag != ''">
-        or EXPIRE_FLAG = #{expireFlag}
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        or VALID_FLAG = #{validFlag}
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        or CREATE_MAN_NO = #{createManNo}
-      </if>
-      <if test="createManName != null and createManName != ''">
-        or CREATE_MAN_NAME = #{createManName}
-      </if>
-      <if test="createTime != null">
-        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
-      </if>
-      <if test="updateManNo != null and updateManNo != ''">
-        or UPDATE_MAN_NO = #{updateManNo}
-      </if>
-      <if test="updateManName != null and updateManName != ''">
-        or UPDATE_MAN_NAME = #{updateManName}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-  </delete>
-  <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
-    insert into DYNAMIC_WORK_DATA (DATA_NO, STATION_CODE, STATION_NAME, 
-      MATERIAL_CODE, MATERIAL_NAME, WEIGHT, 
-      START_TIME, END_TIME, RECEIVER, 
-      RECEIVER_CODE, RECEIVER_TYPE, SENDER, 
-      SENDER_CODE, SENDER_TYPE, MEMO, 
-      EXPIRE_FLAG, VALID_FLAG, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
-      UPDATE_MAN_NAME, UPDATE_TIME)
-    values (#{dataNo,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}, #{stationName,jdbcType=VARCHAR}, 
-      #{materialCode,jdbcType=VARCHAR}, #{materialName,jdbcType=VARCHAR}, #{weight,jdbcType=DECIMAL}, 
-      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{receiver,jdbcType=VARCHAR}, 
-      #{receiverCode,jdbcType=VARCHAR}, #{receiverType,jdbcType=VARCHAR}, #{sender,jdbcType=VARCHAR}, 
-      #{senderCode,jdbcType=VARCHAR}, #{senderType,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, 
-      #{expireFlag,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, 
-      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, 
-      #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
-    insert into DYNAMIC_WORK_DATA
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="dataNo != null">
-        DATA_NO,
-      </if>
-      <if test="stationCode != null">
-        STATION_CODE,
-      </if>
-      <if test="stationName != null">
-        STATION_NAME,
-      </if>
-      <if test="materialCode != null">
-        MATERIAL_CODE,
-      </if>
-      <if test="materialName != null">
-        MATERIAL_NAME,
-      </if>
-      <if test="weight != null">
-        WEIGHT,
-      </if>
-      <if test="startTime != null">
-        START_TIME,
-      </if>
-      <if test="endTime != null">
-        END_TIME,
-      </if>
-      <if test="receiver != null">
-        RECEIVER,
-      </if>
-      <if test="receiverCode != null">
-        RECEIVER_CODE,
-      </if>
-      <if test="receiverType != null">
-        RECEIVER_TYPE,
-      </if>
-      <if test="sender != null">
-        SENDER,
-      </if>
-      <if test="senderCode != null">
-        SENDER_CODE,
-      </if>
-      <if test="senderType != null">
-        SENDER_TYPE,
-      </if>
-      <if test="memo != null">
-        MEMO,
-      </if>
-      <if test="expireFlag != null">
-        EXPIRE_FLAG,
-      </if>
-      <if test="validFlag != null">
-        VALID_FLAG,
-      </if>
-      <if test="createManNo != null">
-        CREATE_MAN_NO,
-      </if>
-      <if test="createManName != null">
-        CREATE_MAN_NAME,
-      </if>
-      <if test="createTime != null">
-        CREATE_TIME,
-      </if>
-      <if test="updateManNo != null">
-        UPDATE_MAN_NO,
-      </if>
-      <if test="updateManName != null">
-        UPDATE_MAN_NAME,
-      </if>
-      <if test="updateTime != null">
-        UPDATE_TIME,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="dataNo != null">
-        #{dataNo,jdbcType=VARCHAR},
-      </if>
-      <if test="stationCode != null">
-        #{stationCode,jdbcType=VARCHAR},
-      </if>
-      <if test="stationName != null">
-        #{stationName,jdbcType=VARCHAR},
-      </if>
-      <if test="materialCode != null">
-        #{materialCode,jdbcType=VARCHAR},
-      </if>
-      <if test="materialName != null">
-        #{materialName,jdbcType=VARCHAR},
-      </if>
-      <if test="weight != null">
-        #{weight,jdbcType=DECIMAL},
-      </if>
-      <if test="startTime != null">
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="receiver != null">
-        #{receiver,jdbcType=VARCHAR},
-      </if>
-      <if test="receiverCode != null">
-        #{receiverCode,jdbcType=VARCHAR},
-      </if>
-      <if test="receiverType != null">
-        #{receiverType,jdbcType=VARCHAR},
-      </if>
-      <if test="sender != null">
-        #{sender,jdbcType=VARCHAR},
-      </if>
-      <if test="senderCode != null">
-        #{senderCode,jdbcType=VARCHAR},
-      </if>
-      <if test="senderType != null">
-        #{senderType,jdbcType=VARCHAR},
-      </if>
-      <if test="memo != null">
-        #{memo,jdbcType=VARCHAR},
-      </if>
-      <if test="expireFlag != null">
-        #{expireFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="validFlag != null">
-        #{validFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="createManNo != null">
-        #{createManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="createManName != null">
-        #{createManName,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateManNo != null">
-        #{updateManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="updateManName != null">
-        #{updateManName,jdbcType=VARCHAR},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
-    update DYNAMIC_WORK_DATA
-    set STATION_CODE = #{stationCode,jdbcType=VARCHAR},
-      STATION_NAME = #{stationName,jdbcType=VARCHAR},
-      MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
-      MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
-      WEIGHT = #{weight,jdbcType=DECIMAL},
-      START_TIME = #{startTime,jdbcType=TIMESTAMP},
-      END_TIME = #{endTime,jdbcType=TIMESTAMP},
-      RECEIVER = #{receiver,jdbcType=VARCHAR},
-      RECEIVER_CODE = #{receiverCode,jdbcType=VARCHAR},
-      RECEIVER_TYPE = #{receiverType,jdbcType=VARCHAR},
-      SENDER = #{sender,jdbcType=VARCHAR},
-      SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
-      SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
-      MEMO = #{memo,jdbcType=VARCHAR},
-      EXPIRE_FLAG = #{expireFlag,jdbcType=VARCHAR},
-      VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
-      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
-      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
-      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
-      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}
-    where DATA_NO = #{dataNo,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
-    update DYNAMIC_WORK_DATA
-    <set>
-      <if test="stationCode != null">
-        STATION_CODE = #{stationCode,jdbcType=VARCHAR},
-      </if>
-      <if test="stationName != null">
-        STATION_NAME = #{stationName,jdbcType=VARCHAR},
-      </if>
-      <if test="materialCode != null">
-        MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
-      </if>
-      <if test="materialName != null">
-        MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
-      </if>
-      <if test="weight != null">
-        WEIGHT = #{weight,jdbcType=DECIMAL},
-      </if>
-      <if test="startTime != null">
-        START_TIME = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        END_TIME = #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="receiver != null">
-        RECEIVER = #{receiver,jdbcType=VARCHAR},
-      </if>
-      <if test="receiverCode != null">
-        RECEIVER_CODE = #{receiverCode,jdbcType=VARCHAR},
-      </if>
-      <if test="receiverType != null">
-        RECEIVER_TYPE = #{receiverType,jdbcType=VARCHAR},
-      </if>
-      <if test="sender != null">
-        SENDER = #{sender,jdbcType=VARCHAR},
-      </if>
-      <if test="senderCode != null">
-        SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
-      </if>
-      <if test="senderType != null">
-        SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
-      </if>
-      <if test="memo != null">
-        MEMO = #{memo,jdbcType=VARCHAR},
-      </if>
-      <if test="expireFlag != null">
-        EXPIRE_FLAG = #{expireFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="validFlag != null">
-        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="createManNo != null">
-        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="createManName != null">
-        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateManNo != null">
-        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="updateManName != null">
-        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
-      </if>
-      <if test="updateTime != null">
-        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where DATA_NO = #{dataNo,jdbcType=VARCHAR}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select" />
-    where DATA_NO = #{dataNo,jdbcType=VARCHAR}
-  </select>
-  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select" />
-    <include refid="where" />
-  </select>
-  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select" />
-    <include refid="whereLike" />
-  </select>
-  <insert id="batchInsert" parameterType="java.util.List">
-    insert into DYNAMIC_WORK_DATA 
-      (DATA_NO, 
-      STATION_CODE, STATION_NAME, MATERIAL_CODE, 
-      MATERIAL_NAME, WEIGHT, START_TIME, 
-      END_TIME, RECEIVER, RECEIVER_CODE, 
-      RECEIVER_TYPE, SENDER, SENDER_CODE, 
-      SENDER_TYPE, MEMO, EXPIRE_FLAG, 
-      VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, 
-      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
-      UPDATE_TIME)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.dataNo,jdbcType=VARCHAR}, 
-      #{item.stationCode,jdbcType=VARCHAR}, #{item.stationName,jdbcType=VARCHAR}, #{item.materialCode,jdbcType=VARCHAR}, 
-      #{item.materialName,jdbcType=VARCHAR}, #{item.weight,jdbcType=DECIMAL}, #{item.startTime,jdbcType=TIMESTAMP}, 
-      #{item.endTime,jdbcType=TIMESTAMP}, #{item.receiver,jdbcType=VARCHAR}, #{item.receiverCode,jdbcType=VARCHAR}, 
-      #{item.receiverType,jdbcType=VARCHAR}, #{item.sender,jdbcType=VARCHAR}, #{item.senderCode,jdbcType=VARCHAR}, 
-      #{item.senderType,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, #{item.expireFlag,jdbcType=VARCHAR}, 
-      #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, 
-      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, 
-      #{item.updateTime,jdbcType=TIMESTAMP} from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update DYNAMIC_WORK_DATA
-     set
-       DATA_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.dataNo,jdbcType=VARCHAR}
-       </foreach>
-       ,STATION_CODE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.stationCode,jdbcType=VARCHAR}
-       </foreach>
-       ,STATION_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.stationName,jdbcType=VARCHAR}
-       </foreach>
-       ,MATERIAL_CODE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.materialCode,jdbcType=VARCHAR}
-       </foreach>
-       ,MATERIAL_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.materialName,jdbcType=VARCHAR}
-       </foreach>
-       ,WEIGHT=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.weight,jdbcType=DECIMAL}
-       </foreach>
-       ,START_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,END_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,RECEIVER=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiver,jdbcType=VARCHAR}
-       </foreach>
-       ,RECEIVER_CODE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiverCode,jdbcType=VARCHAR}
-       </foreach>
-       ,RECEIVER_TYPE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiverType,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.sender,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER_CODE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.senderCode,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER_TYPE=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.senderType,jdbcType=VARCHAR}
-       </foreach>
-       ,MEMO=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
-       </foreach>
-       ,EXPIRE_FLAG=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.expireFlag,jdbcType=VARCHAR}
-       </foreach>
-       ,VALID_FLAG=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_MAN_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_MAN_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_MAN_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_MAN_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
-          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-     where DATA_NO in 
-     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-    #{item.dataNo,jdbcType=VARCHAR}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from DYNAMIC_WORK_DATA
-    where DATA_NO in 
-    <foreach close=")" collection="list" item="id" open="(" separator=",">
-      #{id}
-    </foreach>
-  </delete>
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM DYNAMIC_WORK_DATA
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM DYNAMIC_WORK_DATA t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="dataNo != null and dataNo != ''">
+                and DATA_NO = #{dataNo}
+            </if>
+            <if test="stationCode != null and stationCode != ''">
+                and STATION_CODE = #{stationCode}
+            </if>
+            <if test="stationName != null and stationName != ''">
+                and STATION_NAME = #{stationName}
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE = #{materialCode}
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME = #{materialName}
+            </if>
+            <if test="weight != null">
+                and WEIGHT = #{weight}
+            </if>
+            <if test="startTime != null">
+                and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+            </if>
+            <if test="endTime != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+            </if>
+            <if test="receiver != null and receiver != ''">
+                and RECEIVER = #{receiver}
+            </if>
+            <if test="receiverCode != null and receiverCode != ''">
+                and RECEIVER_CODE = #{receiverCode}
+            </if>
+            <if test="receiverType != null and receiverType != ''">
+                and RECEIVER_TYPE = #{receiverType}
+            </if>
+            <if test="sender != null and sender != ''">
+                and SENDER = #{sender}
+            </if>
+            <if test="senderCode != null and senderCode != ''">
+                and SENDER_CODE = #{senderCode}
+            </if>
+            <if test="senderType != null and senderType != ''">
+                and SENDER_TYPE = #{senderType}
+            </if>
+            <if test="memo != null and memo != ''">
+                and MEMO = #{memo}
+            </if>
+            <if test="expireFlag != null and expireFlag != ''">
+                and EXPIRE_FLAG = #{expireFlag}
+            </if>
+            <if test="validFlag != null and validFlag != ''">
+                and VALID_FLAG = #{validFlag}
+            </if>
+            <if test="createManNo != null and createManNo != ''">
+                and CREATE_MAN_NO = #{createManNo}
+            </if>
+            <if test="createManName != null and createManName != ''">
+                and CREATE_MAN_NAME = #{createManName}
+            </if>
+            <if test="createTime != null">
+                and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+            </if>
+            <if test="updateManNo != null and updateManNo != ''">
+                and UPDATE_MAN_NO = #{updateManNo}
+            </if>
+            <if test="updateManName != null and updateManName != ''">
+                and UPDATE_MAN_NAME = #{updateManName}
+            </if>
+            <if test="updateTime != null">
+                and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+            </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="dataNo != null and dataNo != ''">
+                and DATA_NO LIKE '%${dataNo}%'
+            </if>
+            <if test="stationCode != null and stationCode != ''">
+                and STATION_CODE LIKE '%${stationCode}%'
+            </if>
+            <if test="stationName != null and stationName != ''">
+                and STATION_NAME LIKE '%${stationName}%'
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE LIKE '%${materialCode}%'
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME LIKE '%${materialName}%'
+            </if>
+            <if test="weight != null">
+                and WEIGHT = #{weight}
+            </if>
+            <if test="startTime != null">
+                and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+            </if>
+            <if test="endTime != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+            </if>
+            <if test="endTime1 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &gt;= #{endTime1}
+            </if>
+            <if test="endTime2 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{endTime2}
+            </if>
+            <if test="receiver != null and receiver != ''">
+                and RECEIVER LIKE '%${receiver}%'
+            </if>
+            <if test="receiverCode != null and receiverCode != ''">
+                and RECEIVER_CODE LIKE '%${receiverCode}%'
+            </if>
+            <if test="receiverType != null and receiverType != ''">
+                and RECEIVER_TYPE LIKE '%${receiverType}%'
+            </if>
+            <if test="sender != null and sender != ''">
+                and SENDER LIKE '%${sender}%'
+            </if>
+            <if test="senderCode != null and senderCode != ''">
+                and SENDER_CODE LIKE '%${senderCode}%'
+            </if>
+            <if test="senderType != null and senderType != ''">
+                and SENDER_TYPE LIKE '%${senderType}%'
+            </if>
+            <if test="memo != null and memo != ''">
+                and MEMO LIKE '%${memo}%'
+            </if>
+            <if test="expireFlag != null and expireFlag != ''">
+                and EXPIRE_FLAG LIKE '%${expireFlag}%'
+            </if>
+            <if test="validFlag != null and validFlag != ''">
+                and VALID_FLAG LIKE '%${validFlag}%'
+            </if>
+            <if test="createManNo != null and createManNo != ''">
+                and CREATE_MAN_NO LIKE '%${createManNo}%'
+            </if>
+            <if test="createManName != null and createManName != ''">
+                and CREATE_MAN_NAME LIKE '%${createManName}%'
+            </if>
+            <if test="createTime != null">
+                and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+            </if>
+            <if test="updateManNo != null and updateManNo != ''">
+                and UPDATE_MAN_NO LIKE '%${updateManNo}%'
+            </if>
+            <if test="updateManName != null and updateManName != ''">
+                and UPDATE_MAN_NAME LIKE '%${updateManName}%'
+            </if>
+            <if test="updateTime != null">
+                and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+        delete
+        from DYNAMIC_WORK_DATA
+        where DATA_NO = #{dataNo,jdbcType=VARCHAR}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from DYNAMIC_WORK_DATA
+        where 1!=1
+        <if test="stationCode != null and stationCode != ''">
+            or STATION_CODE = #{stationCode}
+        </if>
+        <if test="stationName != null and stationName != ''">
+            or STATION_NAME = #{stationName}
+        </if>
+        <if test="materialCode != null and materialCode != ''">
+            or MATERIAL_CODE = #{materialCode}
+        </if>
+        <if test="materialName != null and materialName != ''">
+            or MATERIAL_NAME = #{materialName}
+        </if>
+        <if test="weight != null">
+            or WEIGHT = #{weight}
+        </if>
+        <if test="startTime != null">
+            or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
+        </if>
+        <if test="endTime != null">
+            or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
+        </if>
+        <if test="receiver != null and receiver != ''">
+            or RECEIVER = #{receiver}
+        </if>
+        <if test="receiverCode != null and receiverCode != ''">
+            or RECEIVER_CODE = #{receiverCode}
+        </if>
+        <if test="receiverType != null and receiverType != ''">
+            or RECEIVER_TYPE = #{receiverType}
+        </if>
+        <if test="sender != null and sender != ''">
+            or SENDER = #{sender}
+        </if>
+        <if test="senderCode != null and senderCode != ''">
+            or SENDER_CODE = #{senderCode}
+        </if>
+        <if test="senderType != null and senderType != ''">
+            or SENDER_TYPE = #{senderType}
+        </if>
+        <if test="memo != null and memo != ''">
+            or MEMO = #{memo}
+        </if>
+        <if test="expireFlag != null and expireFlag != ''">
+            or EXPIRE_FLAG = #{expireFlag}
+        </if>
+        <if test="validFlag != null and validFlag != ''">
+            or VALID_FLAG = #{validFlag}
+        </if>
+        <if test="createManNo != null and createManNo != ''">
+            or CREATE_MAN_NO = #{createManNo}
+        </if>
+        <if test="createManName != null and createManName != ''">
+            or CREATE_MAN_NAME = #{createManName}
+        </if>
+        <if test="createTime != null">
+            or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
+        </if>
+        <if test="updateManNo != null and updateManNo != ''">
+            or UPDATE_MAN_NO = #{updateManNo}
+        </if>
+        <if test="updateManName != null and updateManName != ''">
+            or UPDATE_MAN_NAME = #{updateManName}
+        </if>
+        <if test="updateTime != null">
+            or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
+        insert into DYNAMIC_WORK_DATA (DATA_NO, STATION_CODE, STATION_NAME,
+                                       MATERIAL_CODE, MATERIAL_NAME, WEIGHT,
+                                       START_TIME, END_TIME, RECEIVER,
+                                       RECEIVER_CODE, RECEIVER_TYPE, SENDER,
+                                       SENDER_CODE, SENDER_TYPE, MEMO,
+                                       EXPIRE_FLAG, VALID_FLAG, CREATE_MAN_NO,
+                                       CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO,
+                                       UPDATE_MAN_NAME, UPDATE_TIME)
+        values (#{dataNo,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}, #{stationName,jdbcType=VARCHAR},
+                #{materialCode,jdbcType=VARCHAR}, #{materialName,jdbcType=VARCHAR}, #{weight,jdbcType=DECIMAL},
+                #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{receiver,jdbcType=VARCHAR},
+                #{receiverCode,jdbcType=VARCHAR}, #{receiverType,jdbcType=VARCHAR}, #{sender,jdbcType=VARCHAR},
+                #{senderCode,jdbcType=VARCHAR}, #{senderType,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},
+                #{expireFlag,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR},
+                #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR},
+                #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
+    </insert>
+    <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
+        insert into DYNAMIC_WORK_DATA
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dataNo != null">
+                DATA_NO,
+            </if>
+            <if test="stationCode != null">
+                STATION_CODE,
+            </if>
+            <if test="stationName != null">
+                STATION_NAME,
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE,
+            </if>
+            <if test="materialName != null">
+                MATERIAL_NAME,
+            </if>
+            <if test="weight != null">
+                WEIGHT,
+            </if>
+            <if test="startTime != null">
+                START_TIME,
+            </if>
+            <if test="endTime != null">
+                END_TIME,
+            </if>
+            <if test="receiver != null">
+                RECEIVER,
+            </if>
+            <if test="receiverCode != null">
+                RECEIVER_CODE,
+            </if>
+            <if test="receiverType != null">
+                RECEIVER_TYPE,
+            </if>
+            <if test="sender != null">
+                SENDER,
+            </if>
+            <if test="senderCode != null">
+                SENDER_CODE,
+            </if>
+            <if test="senderType != null">
+                SENDER_TYPE,
+            </if>
+            <if test="memo != null">
+                MEMO,
+            </if>
+            <if test="expireFlag != null">
+                EXPIRE_FLAG,
+            </if>
+            <if test="validFlag != null">
+                VALID_FLAG,
+            </if>
+            <if test="createManNo != null">
+                CREATE_MAN_NO,
+            </if>
+            <if test="createManName != null">
+                CREATE_MAN_NAME,
+            </if>
+            <if test="createTime != null">
+                CREATE_TIME,
+            </if>
+            <if test="updateManNo != null">
+                UPDATE_MAN_NO,
+            </if>
+            <if test="updateManName != null">
+                UPDATE_MAN_NAME,
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dataNo != null">
+                #{dataNo,jdbcType=VARCHAR},
+            </if>
+            <if test="stationCode != null">
+                #{stationCode,jdbcType=VARCHAR},
+            </if>
+            <if test="stationName != null">
+                #{stationName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialCode != null">
+                #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="weight != null">
+                #{weight,jdbcType=DECIMAL},
+            </if>
+            <if test="startTime != null">
+                #{startTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="endTime != null">
+                #{endTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="receiver != null">
+                #{receiver,jdbcType=VARCHAR},
+            </if>
+            <if test="receiverCode != null">
+                #{receiverCode,jdbcType=VARCHAR},
+            </if>
+            <if test="receiverType != null">
+                #{receiverType,jdbcType=VARCHAR},
+            </if>
+            <if test="sender != null">
+                #{sender,jdbcType=VARCHAR},
+            </if>
+            <if test="senderCode != null">
+                #{senderCode,jdbcType=VARCHAR},
+            </if>
+            <if test="senderType != null">
+                #{senderType,jdbcType=VARCHAR},
+            </if>
+            <if test="memo != null">
+                #{memo,jdbcType=VARCHAR},
+            </if>
+            <if test="expireFlag != null">
+                #{expireFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="validFlag != null">
+                #{validFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="createManNo != null">
+                #{createManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="createManName != null">
+                #{createManName,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateManNo != null">
+                #{updateManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="updateManName != null">
+                #{updateManName,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
+        update DYNAMIC_WORK_DATA
+        set STATION_CODE    = #{stationCode,jdbcType=VARCHAR},
+            STATION_NAME    = #{stationName,jdbcType=VARCHAR},
+            MATERIAL_CODE   = #{materialCode,jdbcType=VARCHAR},
+            MATERIAL_NAME   = #{materialName,jdbcType=VARCHAR},
+            WEIGHT          = #{weight,jdbcType=DECIMAL},
+            START_TIME      = #{startTime,jdbcType=TIMESTAMP},
+            END_TIME        = #{endTime,jdbcType=TIMESTAMP},
+            RECEIVER        = #{receiver,jdbcType=VARCHAR},
+            RECEIVER_CODE   = #{receiverCode,jdbcType=VARCHAR},
+            RECEIVER_TYPE   = #{receiverType,jdbcType=VARCHAR},
+            SENDER          = #{sender,jdbcType=VARCHAR},
+            SENDER_CODE     = #{senderCode,jdbcType=VARCHAR},
+            SENDER_TYPE     = #{senderType,jdbcType=VARCHAR},
+            MEMO            = #{memo,jdbcType=VARCHAR},
+            EXPIRE_FLAG     = #{expireFlag,jdbcType=VARCHAR},
+            VALID_FLAG      = #{validFlag,jdbcType=VARCHAR},
+            CREATE_MAN_NO   = #{createManNo,jdbcType=VARCHAR},
+            CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
+            CREATE_TIME     = #{createTime,jdbcType=TIMESTAMP},
+            UPDATE_MAN_NO   = #{updateManNo,jdbcType=VARCHAR},
+            UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+            UPDATE_TIME     = #{updateTime,jdbcType=TIMESTAMP}
+        where DATA_NO = #{dataNo,jdbcType=VARCHAR}
+    </update>
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData">
+        update DYNAMIC_WORK_DATA
+        <set>
+            <if test="stationCode != null">
+                STATION_CODE = #{stationCode,jdbcType=VARCHAR},
+            </if>
+            <if test="stationName != null">
+                STATION_NAME = #{stationName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="weight != null">
+                WEIGHT = #{weight,jdbcType=DECIMAL},
+            </if>
+            <if test="startTime != null">
+                START_TIME = #{startTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="endTime != null">
+                END_TIME = #{endTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="receiver != null">
+                RECEIVER = #{receiver,jdbcType=VARCHAR},
+            </if>
+            <if test="receiverCode != null">
+                RECEIVER_CODE = #{receiverCode,jdbcType=VARCHAR},
+            </if>
+            <if test="receiverType != null">
+                RECEIVER_TYPE = #{receiverType,jdbcType=VARCHAR},
+            </if>
+            <if test="sender != null">
+                SENDER = #{sender,jdbcType=VARCHAR},
+            </if>
+            <if test="senderCode != null">
+                SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
+            </if>
+            <if test="senderType != null">
+                SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
+            </if>
+            <if test="memo != null">
+                MEMO = #{memo,jdbcType=VARCHAR},
+            </if>
+            <if test="expireFlag != null">
+                EXPIRE_FLAG = #{expireFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="validFlag != null">
+                VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="createManNo != null">
+                CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="createManName != null">
+                CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateManNo != null">
+                UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="updateManName != null">
+                UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        where DATA_NO = #{dataNo,jdbcType=VARCHAR}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where DATA_NO = #{dataNo,jdbcType=VARCHAR}
+    </select>
+    <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select"/>
+        <include refid="where"/>
+    </select>
+    <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select"/>
+        <include refid="whereLike"/>
+    </select>
+    <insert id="batchInsert" parameterType="java.util.List">
+        insert into DYNAMIC_WORK_DATA
+        (DATA_NO,
+        STATION_CODE, STATION_NAME, MATERIAL_CODE,
+        MATERIAL_NAME, WEIGHT, START_TIME,
+        END_TIME, RECEIVER, RECEIVER_CODE,
+        RECEIVER_TYPE, SENDER, SENDER_CODE,
+        SENDER_TYPE, MEMO, EXPIRE_FLAG,
+        VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
+        CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
+        UPDATE_TIME)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.dataNo,jdbcType=VARCHAR},
+        #{item.stationCode,jdbcType=VARCHAR}, #{item.stationName,jdbcType=VARCHAR},
+        #{item.materialCode,jdbcType=VARCHAR},
+        #{item.materialName,jdbcType=VARCHAR}, #{item.weight,jdbcType=DECIMAL}, #{item.startTime,jdbcType=TIMESTAMP},
+        #{item.endTime,jdbcType=TIMESTAMP}, #{item.receiver,jdbcType=VARCHAR}, #{item.receiverCode,jdbcType=VARCHAR},
+        #{item.receiverType,jdbcType=VARCHAR}, #{item.sender,jdbcType=VARCHAR}, #{item.senderCode,jdbcType=VARCHAR},
+        #{item.senderType,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, #{item.expireFlag,jdbcType=VARCHAR},
+        #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR},
+        #{item.createManName,jdbcType=VARCHAR},
+        #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR},
+        #{item.updateManName,jdbcType=VARCHAR},
+        #{item.updateTime,jdbcType=TIMESTAMP} from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update DYNAMIC_WORK_DATA
+        set
+        DATA_NO=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.dataNo,jdbcType=VARCHAR}
+        </foreach>
+        ,STATION_CODE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.stationCode,jdbcType=VARCHAR}
+        </foreach>
+        ,STATION_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.stationName,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_CODE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.materialCode,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.materialName,jdbcType=VARCHAR}
+        </foreach>
+        ,WEIGHT=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.weight,jdbcType=DECIMAL}
+        </foreach>
+        ,START_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,END_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,RECEIVER=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiver,jdbcType=VARCHAR}
+        </foreach>
+        ,RECEIVER_CODE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiverCode,jdbcType=VARCHAR}
+        </foreach>
+        ,RECEIVER_TYPE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.receiverType,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.sender,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER_CODE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.senderCode,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER_TYPE=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.senderType,jdbcType=VARCHAR}
+        </foreach>
+        ,MEMO=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+        </foreach>
+        ,EXPIRE_FLAG=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.expireFlag,jdbcType=VARCHAR}
+        </foreach>
+        ,VALID_FLAG=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_MAN_NO=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_MAN_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_MAN_NO=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_MAN_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+            when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        where DATA_NO in
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+            #{item.dataNo,jdbcType=VARCHAR}
+        </foreach>
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from DYNAMIC_WORK_DATA
+        where DATA_NO in
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
+            #{id}
+        </foreach>
+    </delete>
     <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <!--  计算(M1+M1B)去1#-4#焦炉总量-->
+    <select id="getTotalWeightOfM1AndM1BTo1_4" resultType="java.math.BigDecimal">
+        SELECT sum(WEIGHT)
+        FROM "DYNAMIC_WORK_DATA"
+        where STATION_NAME in ('M1', 'M1B')
+          and RECEIVER = #{receiver}
+          and END_TIME BETWEEN #{startTime} and #{endTime}
+    </select>
+    <!--    计算3煤塔总量-->
+    <select id="getTotalWeightOf3MT" resultType="java.math.BigDecimal">
+        SELECT sum(WEIGHT)
+        FROM "DYNAMIC_WORK_DATA"
+        where MATERIAL_NAME = #{material}
+          and END_TIME BETWEEN #{startTime} and #{endTime}
+    </select>
+    <!--    查询(M1M1B)去1#-4#焦炉按物料分组后的重量-->
+    <select id="getTotalWeightOfM1AndM1BTo1_4GroupByMaterial"
+            resultMap="BaseResultMap">
+        SELECT MATERIAL_NAME,
+               sum(WEIGHT)   as WEIGHT,
+               max(RECEIVER) as RECEIVER,
+               max(SENDER)   as SENDER
+        FROM "DYNAMIC_WORK_DATA"
+        WHERE STATION_NAME IN ('M1', 'M1B')
+          AND RECEIVER = '1-4#焦炉'
+          AND END_TIME BETWEEN #{startTime}
+            and #{endTime}
+        GROUP BY MATERIAL_NAME
+    </select>
+    <!--    重新获取动态秤称重数据-->
+    <select id="recalc" statementType="CALLABLE">
+        {call GENERATEUPDATA()}
+    </select>
 </mapper>

+ 13 - 2
src/main/java/com/jisco/dynamicweight/dynamicworkdata/service/IDynamicWorkDataService.java

@@ -3,8 +3,11 @@ package com.jisco.dynamicweight.dynamicworkdata.service;
 import com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData;
 import com.steerinfo.framework.service.IBaseService;
 
+import java.util.Date;
+
 /**
  * DynamicWorkData服务接口:
+ *
  * @author generator
  * @version 1.0-SNAPSHORT 2022-10-26 09:59
  * 类描述
@@ -13,9 +16,17 @@ import com.steerinfo.framework.service.IBaseService;
  * 作者:generator
  * 参考:
  * 描述:DynamicWorkData服务接口
- * @see null
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ * @see null
  */
-public interface IDynamicWorkDataService extends IBaseService<DynamicWorkData, String>{
+public interface IDynamicWorkDataService extends IBaseService<DynamicWorkData, String> {
+    /**
+     * 3#煤塔秤分批
+     *
+     * @param startTime
+     * @param endTime
+     */
+    void split3mt(Date startTime, Date endTime);
 
+    void recalc();
 }

+ 69 - 1
src/main/java/com/jisco/dynamicweight/dynamicworkdata/service/impl/DynamicWorkDataServiceImpl.java

@@ -2,14 +2,26 @@ package com.jisco.dynamicweight.dynamicworkdata.service.impl;
 
 import com.jisco.dynamicweight.dynamicworkdata.mapper.DynamicWorkDataMapper;
 import com.jisco.dynamicweight.dynamicworkdata.model.DynamicWorkData;
+import com.jisco.dynamicweight.util.UserUtil;
+import com.steerinfo.baseinfo.combaseinfo.model.ComBaseInfo;
+import com.steerinfo.baseinfo.combaseinfo.service.IComBaseInfoService;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.jisco.dynamicweight.dynamicworkdata.service.IDynamicWorkDataService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.Assert;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 /**
  * DynamicWorkData服务实现:
+ *
  * @author generator
  * @version 1.0-SNAPSHORT 2022-10-26 09:59
  * 类描述
@@ -18,8 +30,8 @@ import org.springframework.stereotype.Service;
  * 作者:generator
  * 参考:
  * 描述:DynamicWorkData服务实现
- * @see null
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ * @see null
  */
 @Service(value = "dynamicWorkDataService")
 public class DynamicWorkDataServiceImpl extends BaseServiceImpl<DynamicWorkData, String> implements IDynamicWorkDataService {
@@ -27,8 +39,64 @@ public class DynamicWorkDataServiceImpl extends BaseServiceImpl<DynamicWorkData,
     @Autowired
     private DynamicWorkDataMapper dynamicWorkDataMapper;
 
+    @Autowired
+    private IComBaseInfoService comBaseInfoService;
+
     @Override
     protected IBaseMapper<DynamicWorkData, String> getMapper() {
         return dynamicWorkDataMapper;
     }
+
+    /**
+     * 3#煤塔秤分批
+     *
+     * @param startTime
+     * @param endTime
+     */
+    @Transactional
+    public void split3mt(Date startTime, Date endTime) {
+        ComBaseInfo receiver = comBaseInfoService.getById("001050004001");
+        Assert.isTrue(receiver != null && StringUtils.isNotBlank(receiver.getMemo()), "3#煤塔分批收货库房配置错误,请检查!");
+        ComBaseInfo station = comBaseInfoService.getById("001050004002");
+        Assert.isTrue(station != null && StringUtils.isNotBlank(station.getMemo()), "3#煤塔分批后站点名称配置错误,请检查!");
+        ComBaseInfo material = comBaseInfoService.getById("001050004003");
+        Assert.isTrue(material != null && StringUtils.isNotBlank(material.getMemo()), "3#煤塔总量物料名称配置错误,请检查!");
+        // 1.计算(M1M1B)去1#-4#焦炉总量
+        BigDecimal total = dynamicWorkDataMapper.getTotalWeightOfM1AndM1BTo1_4(receiver.getMemo(), startTime, endTime);
+        Assert.isTrue(total != null && total.compareTo(BigDecimal.ZERO) > 0, "M1、M1B去1#-4#焦炉总量为0,无法计算!");
+        // 2.计算3煤塔总量
+        BigDecimal total3MT = dynamicWorkDataMapper.getTotalWeightOf3MT(material.getMemo(), startTime, endTime);
+        Assert.isTrue(total3MT != null && total3MT.compareTo(BigDecimal.ZERO) > 0, "3煤塔总量为0,无法计算!");
+        // 3.查询(M1M1B)去1#-4#焦炉按物料分组后的重量
+        List<DynamicWorkData> list = dynamicWorkDataMapper.getTotalWeightOfM1AndM1BTo1_4GroupByMaterial(receiver.getMemo(), startTime, endTime);
+        // 4.M1M1B)去1#-4#焦炉按物料分组后的重量 / (M1M1B)去1#-4#焦炉总量 * 3#煤塔秤总量 , 发、收货单位保留原发、收货单位
+        List<DynamicWorkData> dataToAdd = new ArrayList<>();
+        list.forEach(item -> {
+            DynamicWorkData data = new DynamicWorkData();
+            data.setStationName(station.getMemo());
+            data.setMaterialName(item.getMaterialName());
+            data.setStartTime(startTime);
+            data.setEndTime(endTime);
+            data.setReceiver(item.getReceiver());
+            data.setSender(item.getSender());
+            data.setExpireFlag("0");
+            data.setValidFlag("1");
+            data.setWeight(item.getWeight().multiply(total3MT).divide(total, 2, BigDecimal.ROUND_HALF_UP));
+            data.setCreateManNo(UserUtil.getCurrentUserId());
+            data.setCreateManName(UserUtil.getCurrentUserName());
+            data.setCreateTime(new Date());
+            dataToAdd.add(data);
+        });
+        int i = this.batchAdd(dataToAdd);
+        Assert.isTrue(i == dataToAdd.size(), "保存批分数据失败");
+        dynamicWorkDataMapper.recalc();
+    }
+
+    /**
+     * 重新获取动态秤称重数据
+     */
+    @Override
+    public void recalc() {
+        dynamicWorkDataMapper.recalc();
+    }
 }

+ 1 - 0
src/main/java/com/steerinfo/baseinfo/combaseinfo/service/impl/ComBaseInfoServiceImpl.java

@@ -12,6 +12,7 @@ import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualF
 import com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration;
 import com.steerinfo.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;

+ 1 - 0
src/main/java/com/steerinfo/meterwork/meterworkshiftreport/mapper/MeterWorkShiftReportMapper.xml

@@ -410,5 +410,6 @@
     <if test="shiftManName != null and shiftManName != ''">
       and SHIFT_MAN_NAME LIKE '%${shiftManName}%'
     </if>
+    order by create_time desc
   </select>
 </mapper>