WebService接口日志记录类
parent
5678977022
commit
d52fd91f67
@ -1,69 +0,0 @@
|
||||
package com.foreverwin.mesnac.common.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.foreverwin.mesnac.common.dto.WeChatDto;
|
||||
import com.foreverwin.modular.core.exception.BusinessException;
|
||||
import org.dom4j.Text;
|
||||
import org.jsoup.Connection.Response;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 发送微信消息工具类
|
||||
*
|
||||
* @author Leon
|
||||
* @since 2021-06-07
|
||||
*/
|
||||
@Component
|
||||
@ConditionalOnProperty(prefix = "wechat", name = {"agentId","postUrl"})
|
||||
public class SendWeChat {
|
||||
|
||||
@Value("${wechat.agentId}")
|
||||
private int agentId;
|
||||
@Value("${wechat.postUrl}")
|
||||
private String postUrl;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TokenSingleton tokenSingleton;
|
||||
|
||||
public void sendMessage(String toUser, String content) {
|
||||
try {
|
||||
Map<String, String> map = tokenSingleton.getMap();
|
||||
String accessToken = map.get("access_token");
|
||||
|
||||
//短信内容参数
|
||||
WeChatDto weChatDto = new WeChatDto();
|
||||
weChatDto.setTouser(toUser);
|
||||
weChatDto.setAgentid(agentId);
|
||||
Map<String, Object> text = new HashMap<>();
|
||||
text.put("content", content);
|
||||
weChatDto.setText(text);
|
||||
|
||||
postUrl = postUrl.replace("ACCESS_TOKEN", accessToken);
|
||||
Response response = HttpUtils.post(postUrl, JSONObject.toJSONString(weChatDto));
|
||||
if (null != response) {
|
||||
String body = response.body();
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.parse(body);
|
||||
int errCode = jsonObject.getInteger("errcode");
|
||||
if (errCode != 0) {
|
||||
throw BusinessException.build(jsonObject.getString("errmsg"));
|
||||
}
|
||||
if (errCode == 44004) {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.foreverwin.mesnac.dispatch.controller;
|
||||
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
|
||||
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-ITEM-BATCH")
|
||||
public class ItemBatchController {
|
||||
|
||||
@Autowired
|
||||
public ItemBatchService itemBatchService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getItemBatchById(@PathVariable String id) {
|
||||
return R.ok( itemBatchService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getItemBatchList(ItemBatch itemBatch){
|
||||
List<ItemBatch> result;
|
||||
QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(itemBatch);
|
||||
result = itemBatchService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<ItemBatch> frontPage, ItemBatch itemBatch){
|
||||
IPage result;
|
||||
QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(itemBatch);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(ItemBatch::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getFactory, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getItem, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getBatch, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getSupplier, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getLabel, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getIsPrint, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getCreateUser, frontPage.getGlobalQuery())
|
||||
.or().like(ItemBatch::getModifyUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = itemBatchService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param itemBatch 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody ItemBatch itemBatch) {
|
||||
return R.ok(itemBatchService.save(itemBatch));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param itemBatch 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody ItemBatch itemBatch) {
|
||||
return R.ok(itemBatchService.updateById(itemBatch));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(itemBatchService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(itemBatchService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.dispatch.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料批次表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
@Repository
|
||||
public interface ItemBatchMapper extends BaseMapper<ItemBatch> {
|
||||
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
package com.foreverwin.mesnac.dispatch.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料批次表
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
|
||||
@TableName("Z_ITEM_BATCH")
|
||||
public class ItemBatch extends Model<ItemBatch> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@TableField("FACTORY")
|
||||
private String factory;
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@TableField("ITEM")
|
||||
private String item;
|
||||
/**
|
||||
* 采购批次
|
||||
*/
|
||||
@TableField("BATCH")
|
||||
private String batch;
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@TableField("SUPPLIER")
|
||||
private String supplier;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@TableField("LABEL")
|
||||
private String label;
|
||||
@TableField("IS_PRINT")
|
||||
private String isPrint;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATE_USER")
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("MODIFIED_DATE_TIME")
|
||||
private LocalDateTime modifiedDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public void setFactory(String factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getBatch() {
|
||||
return batch;
|
||||
}
|
||||
|
||||
public void setBatch(String batch) {
|
||||
this.batch = batch;
|
||||
}
|
||||
|
||||
public String getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getIsPrint() {
|
||||
return isPrint;
|
||||
}
|
||||
|
||||
public void setIsPrint(String isPrint) {
|
||||
this.isPrint = isPrint;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public String getModifyUser() {
|
||||
return modifyUser;
|
||||
}
|
||||
|
||||
public void setModifyUser(String modifyUser) {
|
||||
this.modifyUser = modifyUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getModifiedDateTime() {
|
||||
return modifiedDateTime;
|
||||
}
|
||||
|
||||
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
|
||||
this.modifiedDateTime = modifiedDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String FACTORY = "FACTORY";
|
||||
|
||||
public static final String ITEM = "ITEM";
|
||||
|
||||
public static final String BATCH = "BATCH";
|
||||
|
||||
public static final String SUPPLIER = "SUPPLIER";
|
||||
|
||||
public static final String LABEL = "LABEL";
|
||||
|
||||
public static final String IS_PRINT = "IS_PRINT";
|
||||
|
||||
public static final String CREATE_USER = "CREATE_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFY_USER = "MODIFY_USER";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ItemBatch{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", factory = " + factory +
|
||||
", item = " + item +
|
||||
", batch = " + batch +
|
||||
", supplier = " + supplier +
|
||||
", label = " + label +
|
||||
", isPrint = " + isPrint +
|
||||
", createUser = " + createUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifyUser = " + modifyUser +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.foreverwin.mesnac.dispatch.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料批次表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
public interface ItemBatchService extends IService<ItemBatch> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<ItemBatch> selectPage(FrontPage<ItemBatch> frontPage, ItemBatch itemBatch);
|
||||
|
||||
List<ItemBatch> selectList(ItemBatch itemBatch);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.foreverwin.mesnac.dispatch.service.impl;
|
||||
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
|
||||
import com.foreverwin.mesnac.dispatch.mapper.ItemBatchMapper;
|
||||
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* <p>
|
||||
* 物料批次表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ItemBatchServiceImpl extends ServiceImpl<ItemBatchMapper, ItemBatch> implements ItemBatchService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ItemBatchMapper itemBatchMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ItemBatch> selectPage(FrontPage<ItemBatch> frontPage, ItemBatch itemBatch) {
|
||||
QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(itemBatch);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemBatch> selectList(ItemBatch itemBatch) {
|
||||
QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(itemBatch);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,434 @@
|
||||
<?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.foreverwin.mesnac.dispatch.mapper.ItemBatchMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.ItemBatch">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="FACTORY" property="factory" />
|
||||
<result column="ITEM" property="item" />
|
||||
<result column="BATCH" property="batch" />
|
||||
<result column="SUPPLIER" property="supplier" />
|
||||
<result column="LABEL" property="label" />
|
||||
<result column="IS_PRINT" property="isPrint" />
|
||||
<result column="CREATE_USER" property="createUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFY_USER" property="modifyUser" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, FACTORY, ITEM, BATCH, SUPPLIER, LABEL, IS_PRINT, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_ITEM_BATCH WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_ITEM_BATCH
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_ITEM_BATCH WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.ItemBatch">
|
||||
INSERT INTO Z_ITEM_BATCH
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="factory!=null">FACTORY,</if>
|
||||
<if test="item!=null">ITEM,</if>
|
||||
<if test="batch!=null">BATCH,</if>
|
||||
<if test="supplier!=null">SUPPLIER,</if>
|
||||
<if test="label!=null">LABEL,</if>
|
||||
<if test="isPrint!=null">IS_PRINT,</if>
|
||||
<if test="createUser!=null">CREATE_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifyUser!=null">MODIFY_USER,</if>
|
||||
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="factory!=null">#{factory},</if>
|
||||
<if test="item!=null">#{item},</if>
|
||||
<if test="batch!=null">#{batch},</if>
|
||||
<if test="supplier!=null">#{supplier},</if>
|
||||
<if test="label!=null">#{label},</if>
|
||||
<if test="isPrint!=null">#{isPrint},</if>
|
||||
<if test="createUser!=null">#{createUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifyUser!=null">#{modifyUser},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.ItemBatch">
|
||||
INSERT INTO Z_ITEM_BATCH
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{factory},
|
||||
#{item},
|
||||
#{batch},
|
||||
#{supplier},
|
||||
#{label},
|
||||
#{isPrint},
|
||||
#{createUser},
|
||||
#{createdDateTime},
|
||||
#{modifyUser},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_ITEM_BATCH <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.factory!=null">FACTORY=#{et.factory},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.batch!=null">BATCH=#{et.batch},</if>
|
||||
<if test="et.supplier!=null">SUPPLIER=#{et.supplier},</if>
|
||||
<if test="et.label!=null">LABEL=#{et.label},</if>
|
||||
<if test="et.isPrint!=null">IS_PRINT=#{et.isPrint},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_ITEM_BATCH <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
FACTORY=#{et.factory},
|
||||
ITEM=#{et.item},
|
||||
BATCH=#{et.batch},
|
||||
SUPPLIER=#{et.supplier},
|
||||
LABEL=#{et.label},
|
||||
IS_PRINT=#{et.isPrint},
|
||||
CREATE_USER=#{et.createUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
MODIFY_USER=#{et.modifyUser},
|
||||
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_ITEM_BATCH <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.factory!=null">FACTORY=#{et.factory},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.batch!=null">BATCH=#{et.batch},</if>
|
||||
<if test="et.supplier!=null">SUPPLIER=#{et.supplier},</if>
|
||||
<if test="et.label!=null">LABEL=#{et.label},</if>
|
||||
<if test="et.isPrint!=null">IS_PRINT=#{et.isPrint},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_ITEM_BATCH WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_ITEM_BATCH
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_ITEM_BATCH
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.factory!=null"> AND FACTORY=#{ew.entity.factory}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
|
||||
<if test="ew.entity.supplier!=null"> AND SUPPLIER=#{ew.entity.supplier}</if>
|
||||
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
|
||||
<if test="ew.entity.isPrint!=null"> AND IS_PRINT=#{ew.entity.isPrint}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_ITEM_BATCH WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
@ -1,40 +0,0 @@
|
||||
package com.foreverwin.mesnac.listener.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.foreverwin.mesnac.listener.model.UserSchedule;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xqy
|
||||
* @since 2020-11-09
|
||||
*/
|
||||
@Repository
|
||||
public interface UserScheduleMapper extends BaseMapper<UserSchedule> {
|
||||
/**
|
||||
* 排班人员修改-根据班课查看排班信息
|
||||
*
|
||||
* @param site
|
||||
* @param wcBo
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
List<UserSchedule> getInfoByUserOrWc(@Param("site") String site, @Param("wcBo") String wcBo, @Param("user") String user, @Param("scheduleStDt") String scheduleStDt, @Param("scheduleEdDt") String scheduleEdDt);
|
||||
|
||||
/**
|
||||
* 排班人员修改-查找MES-187作业规则RULE_01的值
|
||||
*
|
||||
* @param activityBo
|
||||
* @return
|
||||
*/
|
||||
UserSchedule getActivityRule(@Param("activityBo") String activityBo);
|
||||
|
||||
List<UserSchedule>getShiftMappingGyAndMe(@Param("site") String site);
|
||||
|
||||
}
|
@ -1,377 +0,0 @@
|
||||
package com.foreverwin.mesnac.listener.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.foreverwin.modular.core.util.I18nUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xqy
|
||||
* @since 2020-11-09
|
||||
*/
|
||||
|
||||
@TableName("Z_USER_SCHEDULE")
|
||||
|
||||
public class UserSchedule extends Model<UserSchedule> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
@TableField("USER_NAME")
|
||||
private String userName;
|
||||
@TableField("SCHEDULE_DATE")
|
||||
private String scheduleDate;
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
@TableField("SCHEDULE_START_TIME")
|
||||
private String scheduleStartTime;
|
||||
@TableField("SCHEDULE_END_TIME")
|
||||
private String scheduleEndTime;
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
@TableField("UPDATED_DATE_TIME")
|
||||
private LocalDateTime updatedDateTime;
|
||||
@TableField("CREATE_USER_BO")
|
||||
private String createUserBo;
|
||||
@TableField("UPDATE_USER_BO")
|
||||
private String updateUserBo;
|
||||
/**
|
||||
* 星期
|
||||
*/
|
||||
@TableField("WEEK")
|
||||
private String week;
|
||||
/**
|
||||
* 班次
|
||||
*/
|
||||
@TableField("SHIFT")
|
||||
private String shift;
|
||||
// 班课ID
|
||||
@TableField(exist = false)
|
||||
private String wc;
|
||||
// 班课描述
|
||||
@TableField(exist = false)
|
||||
private String wcName;
|
||||
// 用户名称
|
||||
@TableField(exist = false)
|
||||
private String userFullName;
|
||||
// 作业规则值
|
||||
@TableField(exist = false)
|
||||
private String activityValue;
|
||||
// 班次描述
|
||||
@TableField(exist = false)
|
||||
private String shiftDesc;
|
||||
//盖亚班次
|
||||
@TableField(exist = false)
|
||||
private String gyShift;
|
||||
|
||||
public String getGyShift() {
|
||||
return gyShift;
|
||||
}
|
||||
|
||||
public UserSchedule setGyShift(String gyShift) {
|
||||
this.gyShift = gyShift;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getScheduleDate() {
|
||||
return scheduleDate;
|
||||
}
|
||||
|
||||
public void setScheduleDate(String scheduleDate) {
|
||||
this.scheduleDate = scheduleDate;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
if (I18nUtil.getI18nText("userSchedule.typeA").equals(type)) {
|
||||
type = "A";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeB").equals(type)) {
|
||||
type = "B";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeC").equals(type)) {
|
||||
type = "C";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeD").equals(type)) {
|
||||
type = "D";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeE").equals(type)) {
|
||||
type = "E";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeF").equals(type)) {
|
||||
type = "F";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.typeG").equals(type)) {
|
||||
type = "G";
|
||||
} else {
|
||||
switch (type){
|
||||
case "A":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeA");
|
||||
break;
|
||||
case "B":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeB");
|
||||
break;
|
||||
case "C":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeC");
|
||||
break;
|
||||
case "D":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeD");
|
||||
break;
|
||||
case "E":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeE");
|
||||
break;
|
||||
case "F":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeF");
|
||||
break;
|
||||
case "G":
|
||||
type = I18nUtil.getI18nText("userSchedule.typeG");
|
||||
break;
|
||||
default :
|
||||
type = type;
|
||||
}
|
||||
}
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getScheduleStartTime() {
|
||||
return scheduleStartTime;
|
||||
}
|
||||
|
||||
public void setScheduleStartTime(String scheduleStartTime) {
|
||||
this.scheduleStartTime = scheduleStartTime;
|
||||
}
|
||||
|
||||
public String getScheduleEndTime() {
|
||||
return scheduleEndTime;
|
||||
}
|
||||
|
||||
public void setScheduleEndTime(String scheduleEndTime) {
|
||||
this.scheduleEndTime = scheduleEndTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedDateTime() {
|
||||
return updatedDateTime;
|
||||
}
|
||||
|
||||
public void setUpdatedDateTime(LocalDateTime updatedDateTime) {
|
||||
this.updatedDateTime = updatedDateTime;
|
||||
}
|
||||
|
||||
public String getCreateUserBo() {
|
||||
return createUserBo;
|
||||
}
|
||||
|
||||
public void setCreateUserBo(String createUserBo) {
|
||||
this.createUserBo = createUserBo;
|
||||
}
|
||||
|
||||
public String getUpdateUserBo() {
|
||||
return updateUserBo;
|
||||
}
|
||||
|
||||
public void setUpdateUserBo(String updateUserBo) {
|
||||
this.updateUserBo = updateUserBo;
|
||||
}
|
||||
|
||||
public String getWc() {
|
||||
return wc;
|
||||
}
|
||||
|
||||
public void setWc(String wc) {
|
||||
this.wc = wc;
|
||||
}
|
||||
|
||||
public String getWcName() {
|
||||
return wcName;
|
||||
}
|
||||
|
||||
public void setWcName(String wcName) {
|
||||
this.wcName = wcName;
|
||||
}
|
||||
|
||||
public String getUserFullName() {
|
||||
return userFullName;
|
||||
}
|
||||
|
||||
public void setUserFullName(String userFullName) {
|
||||
this.userFullName = userFullName;
|
||||
}
|
||||
|
||||
public String getActivityValue() {
|
||||
return activityValue;
|
||||
}
|
||||
|
||||
public void setActivityValue(String activityValue) {
|
||||
this.activityValue = activityValue;
|
||||
}
|
||||
|
||||
public String getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
public void setWeek(String week) {
|
||||
if (I18nUtil.getI18nText("userSchedule.week1").equals(week)) {
|
||||
week = "1";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week2").equals(week)) {
|
||||
week = "2";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week3").equals(week)) {
|
||||
week = "3";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week4").equals(week)) {
|
||||
week = "4";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week5").equals(week)) {
|
||||
week = "5";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week6").equals(week)) {
|
||||
week = "6";
|
||||
} else if (I18nUtil.getI18nText("userSchedule.week7").equals(week)) {
|
||||
week = "7";
|
||||
} else {
|
||||
switch (week){
|
||||
case "1":
|
||||
week = I18nUtil.getI18nText("userSchedule.week1");
|
||||
break;
|
||||
case "2":
|
||||
week = I18nUtil.getI18nText("userSchedule.week2");
|
||||
break;
|
||||
case "3":
|
||||
week = I18nUtil.getI18nText("userSchedule.week3");
|
||||
break;
|
||||
case "4":
|
||||
week = I18nUtil.getI18nText("userSchedule.week4");
|
||||
break;
|
||||
case "5":
|
||||
week = I18nUtil.getI18nText("userSchedule.week5");
|
||||
break;
|
||||
case "6":
|
||||
week = I18nUtil.getI18nText("userSchedule.week6");
|
||||
break;
|
||||
case "7":
|
||||
week = I18nUtil.getI18nText("userSchedule.week7");
|
||||
break;
|
||||
default :
|
||||
week = week;
|
||||
}
|
||||
}
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
public String getShift() {
|
||||
return shift;
|
||||
}
|
||||
|
||||
public void setShift(String shift) {
|
||||
this.shift = shift;
|
||||
}
|
||||
|
||||
public String getShiftDesc() {
|
||||
return shiftDesc;
|
||||
}
|
||||
|
||||
public void setShiftDesc(String shiftDesc) {
|
||||
this.shiftDesc = shiftDesc;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String USER_NAME = "USER_NAME";
|
||||
|
||||
public static final String SCHEDULE_DATE = "SCHEDULE_DATE";
|
||||
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
public static final String SCHEDULE_START_TIME = "SCHEDULE_START_TIME";
|
||||
|
||||
public static final String SCHEDULE_END_TIME = "SCHEDULE_END_TIME";
|
||||
|
||||
public static final String REMARK = "REMARK";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String UPDATED_DATE_TIME = "UPDATED_DATE_TIME";
|
||||
|
||||
public static final String CREATE_USER_BO = "CREATE_USER_BO";
|
||||
|
||||
public static final String UPDATE_USER_BO = "UPDATE_USER_BO";
|
||||
|
||||
public static final String WEEK = "WEEK";
|
||||
|
||||
public static final String SHIFT = "SHIFT";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserSchedule{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", userName = " + userName +
|
||||
", scheduleDate = " + scheduleDate +
|
||||
", type = " + type +
|
||||
", scheduleStartTime = " + scheduleStartTime +
|
||||
", scheduleEndTime = " + scheduleEndTime +
|
||||
", remark = " + remark +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", updatedDateTime = " + updatedDateTime +
|
||||
", createUserBo = " + createUserBo +
|
||||
", updateUserBo = " + updateUserBo +
|
||||
", week = " + week +
|
||||
", shift = " + shift +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package com.foreverwin.mesnac.listener.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mesnac.listener.model.UserSchedule;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xqy
|
||||
* @since 2020-11-09
|
||||
*/
|
||||
public interface UserScheduleService extends IService<UserSchedule> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<UserSchedule> selectPage(FrontPage<UserSchedule> frontPage, UserSchedule userSchedule);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param userSchedule
|
||||
* @return
|
||||
*/
|
||||
List<UserSchedule> selectList(UserSchedule userSchedule);
|
||||
|
||||
/**
|
||||
* 排班人员修改-根据班课查看排班信息
|
||||
*
|
||||
* @param workCenter
|
||||
* @param user
|
||||
* @param scheduleStDt
|
||||
* @param scheduleEdDt
|
||||
* @return
|
||||
*/
|
||||
List<UserSchedule> getUserScheduleByUserOrWc(String site,String workCenter, String user, String scheduleStDt, String scheduleEdDt);
|
||||
|
||||
/**
|
||||
* 排班人员修改-查找MES-187作业规则RULE_01的值
|
||||
*
|
||||
* @param activityBo
|
||||
* @return
|
||||
*/
|
||||
String getActivityRule(String activityBo);
|
||||
|
||||
void delAndSave(StringBuffer stringBuffer, List<UserSchedule> addList, Set<String> delList);
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
package com.foreverwin.mesnac.listener.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.mesnac.listener.mapper.UserScheduleMapper;
|
||||
import com.foreverwin.mesnac.listener.model.UserSchedule;
|
||||
import com.foreverwin.mesnac.listener.service.UserScheduleService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.sap.me.plant.WorkCenterBOHandle;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xqy
|
||||
* @since 2020-11-09
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class UserScheduleServiceImpl extends ServiceImpl<UserScheduleMapper, UserSchedule> implements UserScheduleService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private UserScheduleMapper userScheduleMapper;
|
||||
|
||||
@Override
|
||||
public IPage<UserSchedule> selectPage(FrontPage<UserSchedule> frontPage, UserSchedule userSchedule) {
|
||||
QueryWrapper<UserSchedule> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(userSchedule);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserSchedule> selectList(UserSchedule userSchedule) {
|
||||
QueryWrapper<UserSchedule> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(userSchedule);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserSchedule> getUserScheduleByUserOrWc(String site, String workCenter, String user, String scheduleStDt, String scheduleEdDt) {
|
||||
String wcBo = "";
|
||||
if (!StringUtil.isEmpty(workCenter)) {
|
||||
WorkCenterBOHandle boHandle = new WorkCenterBOHandle(site, workCenter);
|
||||
wcBo = boHandle.getValue();
|
||||
}
|
||||
return userScheduleMapper.getInfoByUserOrWc(site, workCenter, user, scheduleStDt, scheduleEdDt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActivityRule(String activityBo) {
|
||||
String value = "";
|
||||
UserSchedule userSchedule = userScheduleMapper.getActivityRule(activityBo);
|
||||
if (userSchedule != null ) {
|
||||
value = userSchedule.getActivityValue();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAndSave(StringBuffer buffer, List<UserSchedule> addList, Set<String> delSetList) {
|
||||
if (buffer.length() == 0 && delSetList.size() > 0) {
|
||||
for(String del: delSetList) {
|
||||
String[] t = del.split("==");
|
||||
if (t != null && t.length == 2) {
|
||||
QueryWrapper<UserSchedule> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(UserSchedule.USER_NAME, t[0]);
|
||||
queryWrapper.eq(UserSchedule.SCHEDULE_DATE, t[1]);
|
||||
remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (buffer.length() == 0 && addList.size() > 0) {
|
||||
saveOrUpdateBatch(addList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,517 +0,0 @@
|
||||
<?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.foreverwin.mesnac.listener.mapper.UserScheduleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.listener.model.UserSchedule">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="USER_NAME" property="userName" />
|
||||
<result column="SCHEDULE_DATE" property="scheduleDate" />
|
||||
<result column="TYPE" property="type" />
|
||||
<result column="SCHEDULE_START_TIME" property="scheduleStartTime" />
|
||||
<result column="SCHEDULE_END_TIME" property="scheduleEndTime" />
|
||||
<result column="REMARK" property="remark" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="UPDATED_DATE_TIME" property="updatedDateTime" />
|
||||
<result column="CREATE_USER_BO" property="createUserBo" />
|
||||
<result column="UPDATE_USER_BO" property="updateUserBo" />
|
||||
<result column="WEEK" property="week" />
|
||||
<result column="SHIFT" property="shift" />
|
||||
<result column="PARENT_BO" property="wc" />
|
||||
<result column="PARENT_NAME" property="wcName" />
|
||||
<result column="FULL_NAME" property="userFullName" />
|
||||
<result column="SETTING" property="activityValue" />
|
||||
<result column="SHIFT_DESC" property="shiftDesc" />
|
||||
<result column="GY_SHIFT" property="gyShift" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, USER_NAME, SCHEDULE_DATE, TYPE, SCHEDULE_START_TIME, SCHEDULE_END_TIME, REMARK, CREATED_DATE_TIME, UPDATED_DATE_TIME, CREATE_USER_BO, UPDATE_USER_BO, WEEK, SHIFT
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_USER_SCHEDULE WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_USER_SCHEDULE
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_USER_SCHEDULE WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.listener.model.UserSchedule">
|
||||
INSERT INTO Z_USER_SCHEDULE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="userName!=null">USER_NAME,</if>
|
||||
<if test="scheduleDate!=null">SCHEDULE_DATE,</if>
|
||||
<if test="type!=null">TYPE,</if>
|
||||
<if test="scheduleStartTime!=null">SCHEDULE_START_TIME,</if>
|
||||
<if test="scheduleEndTime!=null">SCHEDULE_END_TIME,</if>
|
||||
<if test="remark!=null">REMARK,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="updatedDateTime!=null">UPDATED_DATE_TIME,</if>
|
||||
<if test="createUserBo!=null">CREATE_USER_BO,</if>
|
||||
<if test="updateUserBo!=null">UPDATE_USER_BO,</if>
|
||||
<if test="week!=null">WEEK,</if>
|
||||
<if test="shift!=null">SHIFT,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="userName!=null">#{userName},</if>
|
||||
<if test="scheduleDate!=null">#{scheduleDate},</if>
|
||||
<if test="type!=null">#{type},</if>
|
||||
<if test="scheduleStartTime!=null">#{scheduleStartTime},</if>
|
||||
<if test="scheduleEndTime!=null">#{scheduleEndTime},</if>
|
||||
<if test="remark!=null">#{remark},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="updatedDateTime!=null">#{updatedDateTime},</if>
|
||||
<if test="createUserBo!=null">#{createUserBo},</if>
|
||||
<if test="updateUserBo!=null">#{updateUserBo},</if>
|
||||
<if test="week!=null">#{week},</if>
|
||||
<if test="shift!=null">#{shift},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.listener.model.UserSchedule">
|
||||
INSERT INTO Z_USER_SCHEDULE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{userName},
|
||||
#{scheduleDate},
|
||||
#{type},
|
||||
#{scheduleStartTime},
|
||||
#{scheduleEndTime},
|
||||
#{remark},
|
||||
#{createdDateTime},
|
||||
#{updatedDateTime},
|
||||
#{createUserBo},
|
||||
#{updateUserBo},
|
||||
#{week},
|
||||
#{shift},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_USER_SCHEDULE <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
|
||||
<if test="et.scheduleDate!=null">SCHEDULE_DATE=#{et.scheduleDate},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.scheduleStartTime!=null">SCHEDULE_START_TIME=#{et.scheduleStartTime},</if>
|
||||
<if test="et.scheduleEndTime!=null">SCHEDULE_END_TIME=#{et.scheduleEndTime},</if>
|
||||
<if test="et.remark!=null">REMARK=#{et.remark},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</if>
|
||||
<if test="et.createUserBo!=null">CREATE_USER_BO=#{et.createUserBo},</if>
|
||||
<if test="et.updateUserBo!=null">UPDATE_USER_BO=#{et.updateUserBo},</if>
|
||||
<if test="et.week!=null">WEEK=#{et.week},</if>
|
||||
<if test="et.shift!=null">SHIFT=#{et.shift},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_USER_SCHEDULE <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
USER_NAME=#{et.userName},
|
||||
SCHEDULE_DATE=#{et.scheduleDate},
|
||||
TYPE=#{et.type},
|
||||
SCHEDULE_START_TIME=#{et.scheduleStartTime},
|
||||
SCHEDULE_END_TIME=#{et.scheduleEndTime},
|
||||
REMARK=#{et.remark},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
UPDATED_DATE_TIME=#{et.updatedDateTime},
|
||||
CREATE_USER_BO=#{et.createUserBo},
|
||||
UPDATE_USER_BO=#{et.updateUserBo},
|
||||
WEEK=#{et.week},
|
||||
SHIFT=#{et.shift},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_USER_SCHEDULE <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
|
||||
<if test="et.scheduleDate!=null">SCHEDULE_DATE=#{et.scheduleDate},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.scheduleStartTime!=null">SCHEDULE_START_TIME=#{et.scheduleStartTime},</if>
|
||||
<if test="et.scheduleEndTime!=null">SCHEDULE_END_TIME=#{et.scheduleEndTime},</if>
|
||||
<if test="et.remark!=null">REMARK=#{et.remark},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</if>
|
||||
<if test="et.createUserBo!=null">CREATE_USER_BO=#{et.createUserBo},</if>
|
||||
<if test="et.updateUserBo!=null">UPDATE_USER_BO=#{et.updateUserBo},</if>
|
||||
<if test="et.week!=null">WEEK=#{et.week},</if>
|
||||
<if test="et.shift!=null">SHIFT=#{et.shift},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_USER_SCHEDULE WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_USER_SCHEDULE
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_USER_SCHEDULE
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
|
||||
<if test="ew.entity.scheduleDate!=null"> AND SCHEDULE_DATE=#{ew.entity.scheduleDate}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.scheduleStartTime!=null"> AND SCHEDULE_START_TIME=#{ew.entity.scheduleStartTime}</if>
|
||||
<if test="ew.entity.scheduleEndTime!=null"> AND SCHEDULE_END_TIME=#{ew.entity.scheduleEndTime}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||
<if test="ew.entity.week!=null"> AND WEEK=#{ew.entity.week}</if>
|
||||
<if test="ew.entity.shift!=null"> AND SHIFT=#{ew.entity.shift}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_USER_SCHEDULE WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<!-- 根据班课查询排班人员信息 -->
|
||||
<select id="getInfoByUserOrWc" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
DISTINCT
|
||||
ZWO.PARENT_BO,
|
||||
ZWO.PARENT_NAME,
|
||||
NU.FULL_NAME,
|
||||
ZUS.*,
|
||||
US.DESCRIPTION SHIFT_DESC
|
||||
FROM
|
||||
Z_USER_SCHEDULE ZUS
|
||||
INNER JOIN Z_NWA_USER NU ON UPPER(NU.USER_NAME) = UPPER(ZUS.USER_NAME) AND NU.SITE = ZUS.SITE
|
||||
LEFT JOIN USER_SHIFT US ON US.NAME = ZUS.SHIFT AND US.SITE = ZUS.SITE
|
||||
LEFT JOIN Z_WORK_CENTER_USER ZWCU ON ZWCU.USER_BO = ZUS.USER_NAME AND ZWCU.SITE = ZUS.SITE
|
||||
LEFT JOIN WORK_CENTER_MEMBER WCM ON 'WorkCenterBO:' || ZWCU.SITE || ',' || ZWCU.WORK_CENTER_BO = WCM.WORK_CENTER_OR_RESOURCE_GBO
|
||||
LEFT JOIN Z_WORKSHOP_ORGANIZATION ZWO1 ON WCM.WORK_CENTER_BO = 'WorkCenterBO:' || ZWO1.SITE || ',' || ZWO1.NAME AND ZWO1.LEVEL = '3'
|
||||
LEFT JOIN Z_WORKSHOP_ORGANIZATION ZWO ON ZWO.NAME = ZWO1.PARENT_BO AND ZWO.LEVEL = '2' AND ZWO1.SITE = #{site}
|
||||
WHERE
|
||||
ZUS.SITE = #{site}
|
||||
<if test="scheduleStDt!=null and scheduleStDt!=''">
|
||||
AND ZUS.SCHEDULE_DATE <![CDATA[ >= ]]> #{scheduleStDt}
|
||||
</if>
|
||||
<if test="scheduleEdDt!=null and scheduleEdDt!=''">
|
||||
AND ZUS.SCHEDULE_DATE <![CDATA[ <= ]]> #{scheduleEdDt}
|
||||
</if>
|
||||
<if test="wcBo!=null and wcBo!=''">
|
||||
AND ZWO.PARENT_BO = #{wcBo}
|
||||
</if>
|
||||
<if test="user!=null and user!=''">
|
||||
AND UPPER(ZUS.USER_NAME) = UPPER(#{user})
|
||||
</if>
|
||||
</select>
|
||||
<!-- 查找作业规则 -->
|
||||
<select id="getActivityRule" resultMap="BaseResultMap" >
|
||||
SELECT SETTING FROM ACTIVITY_OPTION WHERE ACTIVITY_BO = #{activityBo}
|
||||
AND EXEC_UNIT_OPTION = 'RULE_01'
|
||||
</select>
|
||||
<!--与盖亚班次映射关系-->
|
||||
<select id="getShiftMappingGyAndMe" resultMap="BaseResultMap">
|
||||
SELECT dfl.DATA_VALUE AS GY_SHIFT,dflt.DATA_TAG AS SHIFT
|
||||
FROM DATA_FIELD df
|
||||
INNER JOIN DATA_FIELD_LIST dfl ON df.HANDLE = dfl.DATA_FIELD_BO
|
||||
INNER JOIN DATA_FIELD_LIST_T dflt ON dfl.HANDLE = dflt.DATA_FIELD_LIST_BO
|
||||
WHERE df.SITE = #{site} AND df.DATA_FIELD = 'SHIFT_MAPPING' AND dflt.LOCALE = 'zh'
|
||||
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue