设备管理模块--设备维护、设备类型维护更新
parent
dae0eacf45
commit
76832ba1a8
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,14 +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.pms.mapper.EquipMapper">
|
||||
|
||||
<select id="selectBySiteType" resultType="com.foreverwin.mesnac.equip.model.Equip">
|
||||
SELECT R.*
|
||||
FROM RESRCE R
|
||||
INNER JOIN Z_PMS_EQUIP_TYPE_EQUIP ETE
|
||||
ON R.HANDLE = ETE.EQUIP_BO
|
||||
INNER JOIN Z_PMS_EQUIP_TYPE ET
|
||||
ON ET.HANDLE = ETE.EQUIP_TYPE_BO
|
||||
WHERE R.SITE = #{site} AND ET.SITE = #{site} AND ET.EQUIP_TYPE = #{type}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,120 @@
|
||||
package com.foreverwin.mesnac.meapi.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.meapi.service.CustomFieldsService;
|
||||
import com.foreverwin.mesnac.meapi.model.CustomFields;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LZP
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/CUSTOM-FIELDS")
|
||||
public class CustomFieldsController {
|
||||
|
||||
@Autowired
|
||||
public CustomFieldsService customFieldsService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getCustomFieldsById(@PathVariable String id) {
|
||||
return R.ok( customFieldsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getCustomFieldsList(CustomFields customFields){
|
||||
List<CustomFields> result;
|
||||
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(customFields);
|
||||
result = customFieldsService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<CustomFields> frontPage, CustomFields customFields){
|
||||
IPage result;
|
||||
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(customFields);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(CustomFields::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(CustomFields::getAttribute, frontPage.getGlobalQuery())
|
||||
.or().like(CustomFields::getValue, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = customFieldsService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param customFields 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody CustomFields customFields) {
|
||||
return R.ok(customFieldsService.save(customFields));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param customFields 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody CustomFields customFields) {
|
||||
return R.ok(customFieldsService.updateById(customFields));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(customFieldsService.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(customFieldsService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.foreverwin.mesnac.meapi.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.model.CustomFields;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author LZP
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Repository
|
||||
public interface CustomFieldsMapper extends BaseMapper<CustomFields> {
|
||||
|
||||
String selectCustomFieldsValue(@Param("handle") String handle,
|
||||
@Param("attribute") String attribute);
|
||||
|
||||
List<CustomFields> selectCustomFieldsByHandle(@Param("handle") String handle);
|
||||
|
||||
List<CustomFields> selectCustomFields(@Param("handle") String handle,
|
||||
@Param("attribute") String attribute);
|
||||
|
||||
List<Map<String,Object>> selectEquipType(@Param("site") String site,
|
||||
@Param("equipType") String equipType);
|
||||
Map<String,Object> getCustom(@Param("handle") String handle, @Param("attr") String attr);
|
||||
List<Map<String,Object>> getCustoms(@Param("handles") List<String> handles, @Param("attr") String attr);
|
||||
|
||||
Map<String, Object> selectItemGroupPrintTemplate(@Param("sfcBo") String sfcBo);
|
||||
Map<String, Object> selectItemGroupPrintTemplateByItemBo(@Param("itemBo") String itemBo);
|
||||
|
||||
void setCustom(@Param("handle") String handle, @Param("attribute") String attribute, @Param("value") String value);
|
||||
|
||||
void clearCustom(@Param("handle") String handle, @Param("attr") String attr);
|
||||
|
||||
String selectWidthValue(@Param("site") String site, @Param("itemBo") String itemBo);
|
||||
|
||||
String selectAttributeByItemBo(@Param("itemBo") String shopOrder);
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.foreverwin.mesnac.meapi.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author LZP
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
|
||||
@TableName("CUSTOM_FIELDS")
|
||||
|
||||
public class CustomFields extends Model<CustomFields> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("HANDLE")
|
||||
private String handle;
|
||||
@TableField("ATTRIBUTE")
|
||||
private String attribute;
|
||||
@TableField("VALUE")
|
||||
private String value;
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private Date createdDateTime;
|
||||
@TableField("MODIFIED_DATE_TIME")
|
||||
private Date modifiedDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
|
||||
public void setAttribute(String attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Date getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(Date createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public Date getModifiedDateTime() {
|
||||
return modifiedDateTime;
|
||||
}
|
||||
|
||||
public void setModifiedDateTime(Date modifiedDateTime) {
|
||||
this.modifiedDateTime = modifiedDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String ATTRIBUTE = "ATTRIBUTE";
|
||||
|
||||
public static final String VALUE = "VALUE";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustomFields{" +
|
||||
"handle = " + handle +
|
||||
", attribute = " + attribute +
|
||||
", value = " + value +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.foreverwin.mesnac.meapi.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.meapi.model.CustomFields;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author LZP
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface CustomFieldsService extends IService<CustomFields> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<CustomFields> selectPage(FrontPage<CustomFields> frontPage, CustomFields customFields);
|
||||
|
||||
List<CustomFields> selectList(CustomFields customFields);
|
||||
|
||||
|
||||
/**
|
||||
* 查找自定义数据
|
||||
* @param customFields
|
||||
* @return
|
||||
*/
|
||||
CustomFields selectOne(CustomFields customFields);
|
||||
|
||||
/**
|
||||
* @Author zero
|
||||
* 查询自定义数据
|
||||
* @return
|
||||
*/
|
||||
String getCustomFieldsValue(String handle, String attribute);
|
||||
|
||||
/**
|
||||
* 查询机型
|
||||
* @param site
|
||||
* @param resourceType
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getEquipType(String site, String resourceType);
|
||||
|
||||
/**
|
||||
* @Author zero
|
||||
* 查询自定义数据
|
||||
* @param handle 必需
|
||||
* @param attribute 非必需
|
||||
* @return
|
||||
*/
|
||||
List<CustomFields> getCustomFields(String handle, String attribute);
|
||||
|
||||
/**
|
||||
* 查找自定义数据
|
||||
* @param handle
|
||||
* @return
|
||||
*/
|
||||
List<CustomFields> getCustomFieldsByHandle(String handle);
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
void setCustomWithNewTransaction(String handle, String attribute, String value);
|
||||
|
||||
/**
|
||||
* 更改自定义数据
|
||||
* @param handle
|
||||
* @param attribute
|
||||
* @param value
|
||||
*/
|
||||
void setCustom(String handle, String attribute, String value);
|
||||
|
||||
/**
|
||||
* 查询物料组维护的打印模板
|
||||
* @param sfcBo
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getItemGroupPrintTemplate(String sfcBo);
|
||||
|
||||
/**
|
||||
* 查询物料组维护的打印模板
|
||||
* @param itemBo
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getItemGroupPrintTemplateByItemBo(String itemBo);
|
||||
|
||||
/**
|
||||
* 查询分条前物料的宽度
|
||||
* @param itemBo
|
||||
* @return
|
||||
*/
|
||||
String selectWidthValue(String site, String itemBo);
|
||||
|
||||
String selectAttributeByItemBo(String itemBo);
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.foreverwin.mesnac.meapi.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.meapi.model.CustomFields;
|
||||
import com.foreverwin.mesnac.meapi.mapper.CustomFieldsMapper;
|
||||
import com.foreverwin.mesnac.meapi.service.CustomFieldsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author LZP
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class CustomFieldsServiceImpl extends ServiceImpl<CustomFieldsMapper, CustomFields> implements CustomFieldsService {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(CustomFieldsServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private CustomFieldsMapper customFieldsMapper;
|
||||
|
||||
@Autowired
|
||||
private CustomFieldsService customFieldsService;
|
||||
|
||||
@Override
|
||||
public CustomFields selectOne(CustomFields customFields) {
|
||||
QueryWrapper<CustomFields> qw = new QueryWrapper();
|
||||
qw.setEntity( customFields );
|
||||
return customFieldsMapper.selectOne( qw );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCustomFieldsValue(String handle, String attribute) {
|
||||
return customFieldsMapper.selectCustomFieldsValue(handle, attribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getEquipType(String site, String equipType) {
|
||||
return customFieldsMapper.selectEquipType(site,equipType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomFields> getCustomFields(String handle,String attribute) {
|
||||
return customFieldsMapper.selectCustomFields(handle,attribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomFields> getCustomFieldsByHandle(String handle) {
|
||||
return customFieldsMapper.selectCustomFieldsByHandle(handle);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
public void setCustomWithNewTransaction(String handle, String attribute, String value) {
|
||||
setCustom(handle, attribute, value);
|
||||
}
|
||||
|
||||
public void setCustom(String handle, String attribute, String value) {
|
||||
Date nowDate = new Date();
|
||||
QueryWrapper<CustomFields> customFieldsWrapper = new QueryWrapper<>();
|
||||
customFieldsWrapper.eq("HANDLE",handle);
|
||||
customFieldsWrapper.eq("ATTRIBUTE",attribute);
|
||||
List<CustomFields> list= customFieldsMapper.selectList(customFieldsWrapper);
|
||||
|
||||
//实体赋值
|
||||
CustomFields customFields = new CustomFields();
|
||||
customFields.setHandle(handle);
|
||||
customFields.setAttribute(attribute);
|
||||
customFields.setValue(value);
|
||||
|
||||
if(list.isEmpty()){
|
||||
customFields.setCreatedDateTime(nowDate);
|
||||
customFields.setModifiedDateTime(nowDate);
|
||||
customFieldsMapper.insert(customFields);//insertAllColumn
|
||||
}else{
|
||||
customFields.setModifiedDateTime(nowDate);
|
||||
customFieldsMapper.update(customFields,customFieldsWrapper);
|
||||
}
|
||||
logger.info("custom fields created: {}, {}", handle, list.isEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getItemGroupPrintTemplate(String sfcBo) {
|
||||
return customFieldsMapper.selectItemGroupPrintTemplate(sfcBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getItemGroupPrintTemplateByItemBo(String itemBo) {
|
||||
return customFieldsMapper.selectItemGroupPrintTemplateByItemBo(itemBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectWidthValue(String site, String itemBo) {
|
||||
return customFieldsMapper.selectWidthValue(site, itemBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectAttributeByItemBo(String itemBo) {
|
||||
return customFieldsMapper.selectAttributeByItemBo(itemBo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<CustomFields> selectPage(FrontPage<CustomFields> frontPage, CustomFields customFields) {
|
||||
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(customFields);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomFields> selectList(CustomFields customFields) {
|
||||
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(customFields);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,290 @@
|
||||
<?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.meapi.mapper.CustomFieldsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.CustomFields">
|
||||
<result column="HANDLE" property="handle" />
|
||||
<result column="ATTRIBUTE" property="attribute" />
|
||||
<result column="VALUE" property="value" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, ATTRIBUTE, VALUE, CREATED_DATE_TIME, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM CUSTOM_FIELDS
|
||||
<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="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM CUSTOM_FIELDS
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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.meapi.model.CustomFields">
|
||||
INSERT INTO CUSTOM_FIELDS
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="attribute!=null">ATTRIBUTE,</if>
|
||||
<if test="value!=null">VALUE,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="attribute!=null">#{attribute},</if>
|
||||
<if test="value!=null">#{value},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.CustomFields">
|
||||
INSERT INTO CUSTOM_FIELDS
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{attribute},
|
||||
#{value},
|
||||
#{createdDateTime},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE CUSTOM_FIELDS <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
|
||||
<if test="et.attribute!=null">ATTRIBUTE=#{et.attribute},</if>
|
||||
<if test="et.value!=null">VALUE=#{et.value},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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="deleteByMap">
|
||||
DELETE FROM CUSTOM_FIELDS
|
||||
<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 CUSTOM_FIELDS
|
||||
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
|
||||
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue