Commit 3df190d9 authored by shulidong's avatar shulidong

Merge remote-tracking branch 'origin/master'

parents aff86ca4 9b5cffe2
......@@ -122,9 +122,6 @@
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java -->
<dependency>
<groupId>net.oschina.zcx7878</groupId>
......@@ -146,7 +143,6 @@
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.aspose/aspose-slides -->
<dependency>
<groupId>com.aspose</groupId> <!--自定义-->
......@@ -155,6 +151,13 @@
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${basedir}/lib/aspose-cells-8.5.2.jar</systemPath> <!--项目根目录下的lib文件夹下-->
</dependency>
<dependency>
<groupId>com.aspose</groupId> <!--自定义-->
<artifactId>words</artifactId> <!--自定义-->
<version>1.0</version> <!--自定义-->
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${basedir}/lib/words.jar</systemPath> <!--项目根目录下的lib文件夹下-->
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
......
......@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.TimeZone;
......
package cn.wise.sc.cement.business.controller;
import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.*;
import cn.wise.sc.cement.business.model.vo.EntrustVo;
import cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo;
import cn.wise.sc.cement.business.model.vo.SampleVo;
import cn.wise.sc.cement.business.service.IEntrustService;
import cn.wise.sc.cement.business.util.WordUtil;
import cn.wise.sc.cement.business.model.query.CountItemDistributionQuery;
import cn.wise.sc.cement.business.model.vo.ItemDistributionVo;
import cn.wise.sc.cement.business.service.IDataStatisticsService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -19,10 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -39,8 +32,85 @@ public class DataStatisticsController {
private static final Logger log = LoggerFactory.getLogger("DataStatisticsController");
@Autowired
private IDataStatisticsService dataStatisticsService;
@ApiOperation(value = "统计概览-重要数值统计")
@GetMapping("/countOverview")
public BaseResponse countOverview() {
try {
return dataStatisticsService.countOverview();
} catch (Exception e) {
log.debug("统计概览-重要数值统计{}", e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "统计概览-检测项数量统计")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "type", value = "类型1:按时间 2:按地区", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "cycle", value = "统计周期1:本周 2:本月 3:本年", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "startDate", value = "开始日期", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "String")
})
@GetMapping("/countTeam")
public BaseResponse countTeam(Integer type, Integer cycle, String startDate, String endDate) {
try {
if(type == 1){
return dataStatisticsService.countTeamByTime(cycle, startDate,endDate);
}else if(type == 2){
return dataStatisticsService.countTeamByOrigin(cycle, startDate,endDate);
}else{
return BaseResponse.errorMsg("参数错误");
}
} catch (Exception e) {
log.debug("统计概览-检测项数量统计{}", e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "统计概览-项目进展统计")
@GetMapping("/countEntrustStatus")
public BaseResponse countEntrustStatus() {
try {
return dataStatisticsService.countEntrustStatus();
} catch (Exception e) {
log.debug("统计概览-项目进展统计{}", e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "统计概览-进行中任务数量统计")
@GetMapping("/countTaskIng")
public BaseResponse countTaskIng(PageQuery pageQuery) {
try {
return dataStatisticsService.countTaskIng(pageQuery);
} catch (Exception e) {
log.debug("统计概览-进行中任务数量统计{}", e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "统计概览-正在进行的检测项统计")
@GetMapping("/countTeamIng")
public BaseResponse countTeamIng() {
try {
return dataStatisticsService.countTeamIng();
} catch (Exception e) {
log.debug("统计概览-正在进行的检测项统计{}", e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation("导出检测项分布统计")
@PostMapping("/item/download")
public BaseResponse<Page<ItemDistributionVo>> downloadItemDistribution(@RequestBody CountItemDistributionQuery query, HttpServletResponse response) {
return dataStatisticsService.countItemDistribution(query, response);
}
}
......
......@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import sun.misc.BASE64Encoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -63,11 +62,15 @@ public class EntityEnclosureController {
return BaseResponse.errorMsg("登录信息失效");
}
if (extName.contains(FileExt.EXCL.getName()) || extName.contains(FileExt.EXCLX.getName())) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
String pdfPath = FastDFSUtils.conventAndUploadExcel(file.getInputStream(), fileName);
map.put("pdfPath", pdfPath);
} else if (extName.contains(FileExt.DOC.getName()) || extName.contains(FileExt.DOCX.getName())) {
String pdfPath = FastDFSUtils.conventAndUploadWord(file.getInputStream(), fileName);
map.put("pdfPath", pdfPath);
} else {
map.put("pdfPath", filePath);
}
String picUrl = filePath;
map.put("fileUrl", picUrl);
map.put("fileName", fileName);
......@@ -135,7 +138,10 @@ public class EntityEnclosureController {
mapSub.put("fileName", fileName);
mapSub.put("extName", extName);
if (extName.contains(FileExt.EXCL.getName()) || extName.contains(FileExt.EXCLX.getName())) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
String pdfPath = FastDFSUtils.conventAndUploadExcel(file.getInputStream(), fileName);
mapSub.put("pdfPath", pdfPath);
} else if (extName.contains(FileExt.DOC.getName()) || extName.contains(FileExt.DOCX.getName())) {
String pdfPath = FastDFSUtils.conventAndUploadWord(file.getInputStream(), fileName);
mapSub.put("pdfPath", pdfPath);
} else {
mapSub.put("pdfPath", filePath);
......
......@@ -149,7 +149,7 @@ public class EntrustController {
List<SampleVo> sampleList = new ArrayList<>(entrustVo.getSampleList().size());
entrustVo.getSampleList()
.stream()
.filter(arg -> arg.getIsParallel() == 0)
.filter(arg -> arg.getCementCode().equals(arg.getParallelCode()) )
.forEach(arg -> {
List<SampleDistributionTeamVo> teamVoList = arg.getSampleDistributionTeamVoList();
arg.setTeamName(getTeamName(teamVoList));
......@@ -157,7 +157,7 @@ public class EntrustController {
});
beanParams.put("list", sampleList);
WordUtil.writeWordReport(entrustVo.getProjectName() + "(委托单)", "entrust2.ftl",
WordUtil.writeWordReport(entrustVo.getEntrustCode() +"-"+ entrustVo.getProjectName() + "-委托单", "entrust2.ftl",
beanParams, response, FileExt.DOC);
}
......
......@@ -273,5 +273,6 @@ public class NormProductionController {
return BaseResponse.okData(iPrecipriceService.workloadStatistics(startTime, endTime, userId));
}
}
......@@ -122,16 +122,15 @@ public class ReportController {
beanParams.put("printDate", rts.getPrintDate());
beanParams.put("year", DateUtil.year(DateUtil.date()));
beanParams.put("month",DateUtil.month(DateUtil.date()));
beanParams.put("day",DateUtil.today());
beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo())?"":rts.getReportNo());
beanParams.put("month", DateUtil.month(DateUtil.date()));
beanParams.put("day", DateUtil.today());
beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo()) ? "" : rts.getReportNo());
beanParams.put("firstMethodName",getFirstSet(rts.getMethodNames()));
beanParams.put("firstEquipment",getFirstSet(rts.getEquipmentNames()));
beanParams.put("firstMethodName", getFirstSet(rts.getMethodNames()));
beanParams.put("firstEquipment", getFirstSet(rts.getEquipmentNames()));
beanParams.put("methodNames", moveFirst(rts.getMethodNames()));
beanParams.put("equipmentNames", moveFirst(rts.getEquipmentNames()));
//六元素导出
List<SixElementReport> list = iEntrustService.getSampleSixElementCheck(entrustId);
......@@ -166,7 +165,8 @@ public class ReportController {
qw.eq("entity_id", query.getId());
if (FileExt.EXCL.getName().equals(query.getExtName()) ||
FileExt.EXCLX.getName().equals(query.getExtName())) {
FileExt.EXCLX.getName().equals(query.getExtName()) ||
FileExt.PDF.getName().equals(query.getExtName())) {
EntityEnclosure one = iEntityEnclosureService.getOne(qw);
if (BeanUtil.isEmpty(one)) {
EntityEnclosure entityEnclosure = new EntityEnclosure();
......@@ -230,15 +230,15 @@ public class ReportController {
sixElement.setSo3(countResultMap.getOrDefault(SixElementKey.SO3.getKey(), "0"));
}
private String getFirstSet(Set<String> set){
private String getFirstSet(Set<String> set) {
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()){
if (iterator.hasNext()) {
return iterator.next();
}
return "";
}
private static Set<String> moveFirst(Set<String> set){
private static Set<String> moveFirst(Set<String> set) {
Set<String> newSet = new HashSet<>(set.size());
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) {
......
package cn.wise.sc.cement.business.controller;
import cn.wise.sc.cement.business.entity.SysGroup;
import cn.wise.sc.cement.business.entity.SysUser;
import cn.wise.sc.cement.business.entity.Team;
import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.TeamGroupQuery;
import cn.wise.sc.cement.business.service.ITeamGroupService;
import cn.wise.sc.cement.business.service.ITeamService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -34,6 +38,8 @@ public class TeamGroupController {
@Autowired
private ITeamGroupService teamGroupService;
@Autowired
private ITeamService teamService;
@ApiOperation(value = "检测组分页列表")
@ApiImplicitParams(value = {
......@@ -102,6 +108,19 @@ public class TeamGroupController {
@PostMapping("/delete/{id}")
public BaseResponse delete(@PathVariable Integer id) {
try {
if(id == null){
return BaseResponse.errorMsg("参数错误");
}
TeamGroup teamGroup = teamGroupService.getById(id);
if(teamGroup == null){
return BaseResponse.errorMsg("信息错误");
}
QueryWrapper<Team> teamQueryWrapper = new QueryWrapper<>();
teamQueryWrapper.eq("group_id", id);
Integer conunts = teamService.count(teamQueryWrapper);
if (conunts != 0 && conunts > 0) {
return BaseResponse.errorMsg(conunts + "个检测项正在使用!");
}
teamGroupService.removeById(id);
return BaseResponse.okData("删除成功");
} catch (Exception e) {
......
package cn.wise.sc.cement.business.entity;
import lombok.Data;
/**
* @description: 检测项目分布情况
* @author: qh
* @create: 2021-01-18 15:31
**/
@Data
public class ItemDistribution {
private Integer count;
private String key;
}
package cn.wise.sc.cement.business.entity;
import lombok.Data;
/**
* @description: 检测项目分布情况(按样品统计)
* @author: qh
* @create: 2021-01-19 10:28
**/
@Data
public class ItemDistributionSample {
private String name;
private Integer count;
}
......@@ -116,4 +116,7 @@ public class Sample implements Serializable {
@ApiModelProperty("产地")
private String origin;
@ApiModelProperty("样品是否来自国外 (0来自国内,1来自国外)")
private Integer isForeign;
}
package cn.wise.sc.cement.business.mapper;
import cn.wise.sc.cement.business.entity.Client;
import cn.wise.sc.cement.business.entity.ItemDistribution;
import cn.wise.sc.cement.business.entity.ItemDistributionSample;
import cn.wise.sc.cement.business.model.vo.ClientVo;
import cn.wise.sc.cement.business.model.vo.DataStatisticsVo;
import cn.wise.sc.cement.business.model.vo.EntrustVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-08-07
*/
public interface DataStatisticsMapper {
List<DataStatisticsVo> countTeamByTime(@Param("params") Map<String, Object> params);
List<DataStatisticsVo> countTeamByOrigin(@Param("params") Map<String, Object> params);
List<DataStatisticsVo> countEntrustStatus();
IPage<DataStatisticsVo> countHandlePage(@Param("page") Page page);
IPage<DataStatisticsVo> countDistributionPage(@Param("page") Page page);
List<DataStatisticsVo> countTeamIng();
IPage<ItemDistribution> countItemDistribution(@Param("page") Page<ItemDistribution> page,
@Param("start") Date startTime,
@Param("end") Date endTime,
@Param("origins") List<String> origins,
@Param("itemId") Long itemId);
ItemDistributionSample countItemDistributionSample(@Param("start") Date startTime, @Param("end") Date endTime,
@Param("origin") String origin, @Param("teamId") Long teamId);
}
......@@ -71,4 +71,7 @@ public interface SampleMapper extends BaseMapper<Sample> {
}
<?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="cn.wise.sc.cement.business.mapper.DataStatisticsMapper">
<select id="countTeamByTime" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT DATE_FORMAT(sd.create_time,'%Y-%m') as name, count(sd.id) as value
FROM sample_distribution sd
where sd.finish_time is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle = 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by name
</select>
<select id="countTeamByOrigin" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT s.origin as name, count(sd.id) as value
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
where sd.finish_time is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by s.origin
</select>
<select id="countEntrustStatus" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT (
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as name,
count(*) as value
FROM entrust e
group by e.status
</select>
<select id="countHandlePage" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT su.name as name, count(*) as value FROM sample_handle sh
left join sys_user su on su.id = sh.user_id
where sh.status != 2
group by sh.user_id
</select>
<select id="countDistributionPage" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT su.name as name, count(*) as value FROM sample_distribution sd
left join sys_user su on su.id = sd.user_id
where sd.status != 2
group by sd.user_id
</select>
<select id="countTeamIng" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where sd.status != 2
group by sd.team_id
</select>
<select id="countItemDistributionSample"
resultType="cn.wise.sc.cement.business.entity.ItemDistributionSample">
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE
sd.finish_time BETWEEN #{start} AND #{end}
<if test="origin != null and origin != '' ">
AND s.origin = #{origin}
</if>
<if test="teamId != '' and teamId != null ">
AND sd.team_id = #{teamId}
</if>
</select>
<select id="countItemDistribution" resultType="cn.wise.sc.cement.business.entity.ItemDistribution">
SELECT COUNT(a.sample_id) as `count`,`key` from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE (sd.finish_time between #{start} and #{end})
<if test="origins != null">
AND s.origin in
<foreach collection="origins" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="itemId != null">
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
</select>
</mapper>
package cn.wise.sc.cement.business.model.query;
import cn.wise.sc.cement.business.model.PageQuery;
import lombok.Data;
import java.time.Period;
import java.util.List;
/**
* @description:
* @author: qh
* @create: 2021-01-19 10:33
**/
@Data
public class CountItemDistributionQuery {
private Long itemId;
private List<String> origins;
private String startTime;
private String endTime;
private String type;
private PageQuery pageQuery;
}
package cn.wise.sc.cement.business.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: ztw
* @create: 2021-01-08
**/
@Data
@ApiModel("数据统计-展示类")
public class DataStatisticsVo {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("值")
private String value;
}
package cn.wise.sc.cement.business.model.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @description: 检测项分布情况Vo
* @author: qh
* @create: 2021-01-18 15:52
**/
@Data
public class ItemDistributionVo implements Serializable {
static final long serialVersionUID = 42L;
private String id;
private String itemName;
private String origin;
private Integer itemCount;
private String time;
private Integer sampleCount;
}
......@@ -51,4 +51,7 @@ public class SampleTmpVo {
@ApiModelProperty("产地")
private String origin;
@ApiModelProperty("平行样编号")
private String parallelCode;
}
package cn.wise.sc.cement.business.service;
import cn.wise.sc.cement.business.entity.Entrust;
import cn.wise.sc.cement.business.entity.SampleDistribution;
import cn.wise.sc.cement.business.entity.SampleHandleEnclosure;
import cn.wise.sc.cement.business.model.*;
import cn.wise.sc.cement.business.model.query.*;
import cn.wise.sc.cement.business.model.vo.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.models.auth.In;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2021-01-12
*/
public interface IDataStatisticsService {
BaseResponse<Map<String, String>> countOverview();
BaseResponse<List<DataStatisticsVo>> countTeamByTime(Integer cycle, String startDate, String endDate);
BaseResponse<List<DataStatisticsVo>> countTeamByOrigin(Integer cycle, String startDate, String endDate);
BaseResponse<Map<String, Object>> countEntrustStatus();
BaseResponse<Map<String, Object>> countTaskIng(PageQuery pageQuery);
BaseResponse<List<DataStatisticsVo>> countTeamIng();
/**
* 导出检查项分布统计
* @param query 请求参数
* @param response 响应
* @return 返回的统计
*/
BaseResponse<Page<ItemDistributionVo>> countItemDistribution(CountItemDistributionQuery query, HttpServletResponse response);
}
......@@ -77,6 +77,9 @@ public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> impleme
if (count > 0) {
return BaseResponse.errorMsg("单位名称已存在!");
}
if(query.getPrincipal().length() > 20 ){
return BaseResponse.errorMsg("联系人姓名过长!");
}
if(query.getPrincipalPhone().length() > 15 ){
return BaseResponse.errorMsg("联系人电话过长!");
}
......@@ -100,6 +103,12 @@ public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> impleme
if (count > 0) {
return BaseResponse.errorMsg("单位名称已存在!");
}
if(query.getPrincipal().length() > 20 ){
return BaseResponse.errorMsg("联系人姓名过长!");
}
if(query.getPrincipalPhone().length() > 15 ){
return BaseResponse.errorMsg("联系人电话过长!");
}
Client update = new Client();
BeanUtils.copyProperties(query, update);
update.setId(query.getId());
......
......@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
......@@ -438,10 +439,42 @@ public class CommonServiceImpl {
return countMap;
}
/**
* 根据开始日期和技术日期列出月份
* @param startDate
* @param endDate
* @return
* @throws Exception
*/
public List<String> getMonthBetween(String startDate, String endDate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");//格式化为年月
Date minDate = null;
Date maxDate = null;
try {
minDate = sdf.parse(startDate);
maxDate = sdf.parse(endDate);
} catch (ParseException e) {
e.printStackTrace();
}
ArrayList<String> result = new ArrayList<String>();
Calendar min = Calendar.getInstance();
Calendar max = Calendar.getInstance();
min.setTime(minDate);
min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
max.setTime(maxDate);
max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
Calendar curr = min;
while (curr.before(max)) {
result.add(sdf.format(curr.getTime()));
curr.add(Calendar.MONTH, 1);
}
return result;
}
......
......@@ -283,6 +283,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (query.getSampleTmpList() != null && query.getSampleTmpList().size() > 0) {
List<SampleTmp> sampleTmpList = new ArrayList<>();
for (SampleTmpQuery sampleTmpQuery : query.getSampleTmpList()) {
if(StringUtils.isEmpty(sampleTmpQuery.getOrigin())){
return BaseResponse.errorMsg("请选择样品产地");
}
SampleTmp sampleTmp = new SampleTmp();
BeanUtils.copyProperties(sampleTmpQuery, sampleTmp);
String teamIds = sampleTmpQuery.getTeamIds(); //选择的检测项id集合
......@@ -617,13 +620,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (loginUser == null) {
return BaseResponse.errorMsg("请登录账号");
}
List<Integer> approvalIdList = sysApprovalMapper.getApprovalId("委托评审");
/*List<Integer> approvalIdList = sysApprovalMapper.getApprovalId("委托评审");
if (approvalIdList == null) {
return BaseResponse.errorMsg("委托评审信息错误");
}
if (!approvalIdList.contains(loginUser.getId())) {
return BaseResponse.errorMsg("权限不足");
}
}*/
if (id == null) {
return BaseResponse.errorMsg("参数错误");
}
......@@ -719,15 +722,28 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return BaseResponse.errorMsg("参数错误");
}
EntrustVo entrustVo = entrustMapper.getDetail(id);
QueryWrapper<SampleTmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entrust_id", entrustVo.getId());
List<SampleTmp> sampleTmpList = sampleTmpService.list(queryWrapper);
List<SampleTmpVo> sampleTmpVoList = new ArrayList<>();
if (sampleTmpList != null && sampleTmpList.size() > 0) {
for (SampleTmp sampleTmp : sampleTmpList) {
SampleTmpVo sampleTmpVo = new SampleTmpVo();
BeanUtils.copyProperties(sampleTmp, sampleTmpVo);
String teamIds = sampleTmp.getTeamIds();
QueryWrapper<SampleTmp> sampleTmpQueryWrapper = new QueryWrapper<>();
sampleTmpQueryWrapper.eq("entrust_id", entrustVo.getId());
List<SampleTmp> sampleList = sampleTmpService.list(sampleTmpQueryWrapper);
// List<Sample> sampleList = sampleMapper.getSampleList(entrustVo.getId());
List<SampleTmpVo> sampleVoList = new ArrayList<>();
if (sampleList != null && sampleList.size() > 0) {
for (SampleTmp sample : sampleList) {
SampleTmpVo sampleVo = new SampleTmpVo();
BeanUtils.copyProperties(sample, sampleVo);
QueryWrapper<Sample> sampleQueryWrapper = new QueryWrapper<>();
sampleQueryWrapper.eq("entrust_id", entrustVo.getId());
sampleQueryWrapper.eq("sample_id", sample.getId());
List<Sample> sampleList1 = sampleService.list(sampleQueryWrapper);
if(sampleList1 != null && sampleList1.size()>0 ){
Sample sample1 = sampleList1.get(0);
sampleVo.setParallelCode(sample1.getCementCode());
}else{
sampleVo.setParallelCode(null);
}
String teamIds = sample.getTeamIds();
String teamName = "";
if (teamIds != null) {
String[] teamIdS = teamIds.split("、");
......@@ -739,11 +755,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
sampleTmpVo.setTeamName(teamName);
sampleTmpVoList.add(sampleTmpVo);
sampleVo.setTeamName(teamName);
sampleVoList.add(sampleVo);
}
}
entrustVo.setSampleTmpList(sampleTmpVoList);
entrustVo.setSampleTmpList(sampleVoList);
//查询报告,如果有上传的委托报告,用户可已进行下载
QueryWrapper<EntityEnclosure> wrapper = new QueryWrapper<>();
wrapper.eq("entity_type", EntityEnclosure.EntityType.ENTRUST_REPORT);
......@@ -996,11 +1012,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (StringUtils.isEmpty(query.getProjectType())) {
return BaseResponse.errorMsg("请选择项目类型");
}
//当前平行样编号最大值
String redisMaxCementCode = getMaxCementCode().getData();
if (query.getSampleList() != null && query.getSampleList().size() > 0) {
List<Sample> sampleList = new ArrayList<>();
String maxCementCode = ""; //最大本所编号对应的平行样编号
//当前平行样编号最大值
Integer integerMaxCode = commonService.getIntegerCode(getMaxCementCode().getData());
Integer integerMaxCode = commonService.getIntegerCode(redisMaxCementCode);
for (SampleQuery sampleQuery : query.getSampleList()) {
if (StringUtils.isEmpty(sampleQuery.getCementCode())) {
return BaseResponse.errorMsg("本所编号不能为空");
......@@ -1119,7 +1136,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
queryWrapper.eq("status", 1);
NormProduction normProduction = iNormProductionService.getOne(queryWrapper);
if(normProduction == null){
return BaseResponse.errorMsg("联系管理员.配置产值信息!");
//评审未通过,删除评审后的样品
sampleMapper.deleteBatchIds(sampleList);
//还原本所编号最大值
redisUtil.setString("maxCementCode", redisMaxCementCode);
return BaseResponse.errorMsg("请配置处理项名称为"+handle.getName()+"的产值信息!");
}
}
//消息推送
......
......@@ -79,6 +79,9 @@ public class HandleServiceImpl extends ServiceImpl<HandleMapper, Handle> impleme
if (StringUtils.isEmpty(query.getName())) {
return BaseResponse.errorMsg("处理项名称不能为空!");
}
if (query.getUserId() == null) {
return BaseResponse.errorMsg("请选择处理人");
}
QueryWrapper<Handle> qw = new QueryWrapper<>();
qw.eq("name", query.getName());
int count = handleMapper.selectCount(qw);
......@@ -102,6 +105,9 @@ public class HandleServiceImpl extends ServiceImpl<HandleMapper, Handle> impleme
if (StringUtils.isEmpty(query.getName())) {
return BaseResponse.errorMsg("处理项名称不能为空!");
}
if (query.getUserId() == null) {
return BaseResponse.errorMsg("请选择处理人");
}
Handle handle = handleMapper.selectById(query.getId());
if(handle == null){
return BaseResponse.errorMsg("信息错误!");
......
......@@ -12,6 +12,7 @@ import cn.wise.sc.cement.business.util.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
......@@ -64,6 +65,9 @@ public class MethodServiceImpl extends ServiceImpl<MethodMapper, Method> impleme
@Override
public BaseResponse<Method> create(MethodQuery query) {
if(StringUtils.isBlank(query.getName())){
return BaseResponse.errorMsg("检测依据名称不能为空!");
}
if(query.getName().contains("、") || query.getNumber().contains("、") ){
return BaseResponse.errorMsg("检测依据名称和编号不能出现特殊符号");
}
......@@ -73,6 +77,21 @@ public class MethodServiceImpl extends ServiceImpl<MethodMapper, Method> impleme
if (count > 0) {
return BaseResponse.errorMsg("检测依据名称已存在!");
}
QueryWrapper<Method> qw1 = new QueryWrapper<>();
qw1.eq("standard", query.getStandard());
int count1 = methodMapper.selectCount(qw1);
if (count1 > 0) {
return BaseResponse.errorMsg("检测依据标准号已存在!");
}
QueryWrapper<Method> qw2 = new QueryWrapper<>();
qw2.eq("number", query.getNumber());
int count2 = methodMapper.selectCount(qw2);
if (count2 > 0) {
return BaseResponse.errorMsg("检测依据编号已存在!");
}
Method crate = new Method();
BeanUtils.copyProperties(query, crate);
crate.setCreateTime(LocalDateTime.now())
......@@ -83,9 +102,39 @@ public class MethodServiceImpl extends ServiceImpl<MethodMapper, Method> impleme
@Override
public BaseResponse<Method> update(MethodQuery query) {
if(StringUtils.isBlank(query.getName())){
return BaseResponse.errorMsg("检测依据名称不能为空!");
}
if(query.getName().contains("、") || query.getNumber().contains("、") ){
return BaseResponse.errorMsg("检测依据名称和编号不能出现特殊符号");
}
Method oldMethod = methodMapper.selectById(query.getId());
if(oldMethod==null){
return BaseResponse.errorMsg("信息错误");
}
QueryWrapper<Method> qw = new QueryWrapper<>();
qw.eq("name", query.getName());
qw.ne("id", query.getId());
int count = methodMapper.selectCount(qw);
if (count > 0) {
return BaseResponse.errorMsg("检测依据名称已存在!");
}
QueryWrapper<Method> qw1 = new QueryWrapper<>();
qw1.eq("standard", query.getStandard());
qw1.ne("id", query.getId());
int count1 = methodMapper.selectCount(qw1);
if (count1 > 0) {
return BaseResponse.errorMsg("检测依据标准号已存在!");
}
QueryWrapper<Method> qw2 = new QueryWrapper<>();
qw2.eq("number", query.getNumber());
qw.ne("id", query.getId());
int count2 = methodMapper.selectCount(qw2);
if (count2 > 0) {
return BaseResponse.errorMsg("检测依据编号已存在!");
}
Method update = Method.crate(query);
update.setId(query.getId());
this.updateById(update);
......
......@@ -17,6 +17,7 @@ import cn.wise.sc.cement.business.wrapper.page.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
......@@ -75,6 +76,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
@Override
@Transactional
public BaseResponse<Project> create(ProjectQuery query) {
if(StringUtils.isBlank(query.getName())){
return BaseResponse.errorMsg("项目名称不可为空!");
}
QueryWrapper<Project> qw = new QueryWrapper<>();
qw.eq("name", query.getName());
int count = projectMapper.selectCount(qw);
......@@ -93,6 +97,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
@Override
@Transactional
public BaseResponse<Project> update(ProjectQuery query) {
if(StringUtils.isBlank(query.getName())){
return BaseResponse.errorMsg("项目名称不可为空!");
}
//判断名字是否重复
QueryWrapper<Project> qw = new QueryWrapper<>();
qw.eq("name", query.getName());
......
......@@ -18,6 +18,7 @@ import cn.wise.sc.cement.business.util.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.models.auth.In;
......@@ -84,6 +85,9 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
@Transactional
public BaseResponse<Team> create(TeamQuery query) {
Team create = new Team();
if (StringUtils.isBlank(query.getName())) {
return BaseResponse.errorMsg("检测项名称不能为空");
}
if (query.getGroupId() == null) {
return BaseResponse.errorMsg("请选择检测组");
}
......@@ -152,6 +156,9 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
@Override
@Transactional
public BaseResponse<Team> update(TeamQuery query) {
if (StringUtils.isBlank(query.getName())) {
return BaseResponse.errorMsg("检测项名称不能为空");
}
Team update = teamMapper.selectById(query.getId());
if (update == null) {
return BaseResponse.errorMsg("信息错误");
......
package cn.wise.sc.cement.business.util;
import cn.hutool.core.date.DateTime;
import java.time.LocalDateTime;
import java.time.temporal.WeekFields;
import java.util.Date;
/**
* @author neo.shu
......@@ -10,14 +14,35 @@ import java.time.temporal.WeekFields;
public class DateUtil {
/**
* 获取自然周数
*
* @param localDateTime
* @return
*/
public static int getWeek(LocalDateTime localDateTime) {
WeekFields weekFields = WeekFields.ISO;
return localDateTime.get(weekFields.weekOfWeekBasedYear());
}
/**
* 获取自然周数
*
* @param localDateTime
* @return
*/
public static int getWeek(LocalDateTime localDateTime) {
WeekFields weekFields = WeekFields.ISO;
return localDateTime.get(weekFields.weekOfWeekBasedYear());
}
/**
* 获取开始时间
*
* @param type 类型 1:本周 2:本月 3:本年
* @return 开始时间
*/
public static Date getStartTime(Integer type) {
Date rts = null;
if (type == 1) {
rts = cn.hutool.core.date.DateUtil.beginOfWeek(cn.hutool.core.date.DateUtil.date());
} else if (type == 2) {
rts = cn.hutool.core.date.DateUtil.beginOfMonth(cn.hutool.core.date.DateUtil.date());
} else {
rts = cn.hutool.core.date.DateUtil.beginOfYear(cn.hutool.core.date.DateUtil.date());
}
return rts;
}
}
......@@ -186,7 +186,7 @@ public class ExcelUtil {
if (datas != null && datas.size() > 0) {// 渲染数据
CellStyle style = workbook.createCellStyle();
XSSFFont xxsfFont = workbook.createFont();
xxsfFont.setTypeOffset(FontFormatting.SS_SUB);
for (int index = 0, size = datas.size(); index < size; index++) {
Object[] data = datas.get(index);
if (data != null && data.length > 0) {
......@@ -199,17 +199,26 @@ public class ExcelUtil {
}
for (int i = 0; i < length; i++) {
// style.setWrapText(true); //关键
String value = data[i] == null ? null : data[i].toString();
cell = row.createCell(i);
cell.setCellValue(data[i] == null ? null : data[i].toString());
//处理下标
if(cell.getStringCellValue().contains("<sub>") || cell.getStringCellValue().contains("</sub>") ){
if(value.contains("<sub>") || value.contains("</sub>") ){
xxsfFont.setTypeOffset(FontFormatting.SS_SUB);
cell.setCellStyle(style);
XSSFRichTextString richString = new XSSFRichTextString(value.replaceAll("</sub>","<sub>").replaceAll("<sub>",""));
//提取下标位置
applyRichStringFontsub(value, richString, xxsfFont);
cell.setCellValue(richString);
}else if(value.contains("<sup>") || value.contains("</sup>")){
xxsfFont.setTypeOffset(FontFormatting.SS_SUPER);
cell.setCellStyle(style);
XSSFRichTextString richString = new XSSFRichTextString(cell.getStringCellValue().replaceAll("</sub>","<sub>").replaceAll("<sub>",""));
XSSFRichTextString richString = new XSSFRichTextString(value.replaceAll("</sup>","<sup>").replaceAll("<sup>",""));
//提取下标位置
applyRichStringFont(cell.getStringCellValue(), richString, xxsfFont);
applyRichStringFontsup(value, richString, xxsfFont);
cell.setCellValue(richString);
}else{
cell.setCellValue(value);
cell.setCellStyle(style);
}
......@@ -225,14 +234,28 @@ public class ExcelUtil {
return workbook;
}
private static void applyRichStringFont(String sub, XSSFRichTextString richString,XSSFFont xxsfFont) {
private static void applyRichStringFontsub(String sub, XSSFRichTextString richString,XSSFFont xxsfFont) {
String[] split = sub.replaceAll("</sub>", "<sub>").split("<sub>");
String it_str = "";
for (int i = 1; i < split.length + 1; i++) {
if (i % 2 != 0) {
it_str = it_str + split[i - 1];
} else {
richString.applyFont(it_str.length(),(it_str+split[i-1]).length()-1,xxsfFont);
richString.applyFont(it_str.length(),(it_str+split[i-1]).length(),xxsfFont);
it_str = it_str + split[i - 1];
}
}
}
private static void applyRichStringFontsup(String sup, XSSFRichTextString richString,XSSFFont xxsfFont) {
String[] split = sup.replaceAll("</sup>", "<sup>").split("<sup>");
String it_str = "";
for (int i = 1; i < split.length + 1; i++) {
if (i % 2 != 0) {
it_str = it_str + split[i - 1];
} else {
richString.applyFont(it_str.length(),(it_str+split[i-1]).length(),xxsfFont);
it_str = it_str + split[i - 1];
}
......@@ -240,6 +263,7 @@ public class ExcelUtil {
}
public static Workbook getWorkbookNew(String[] headers, List<Object[]> datas) {
Workbook workbook = new HSSFWorkbook();
Sheet sheet = workbook.createSheet();
......
package cn.wise.sc.cement.business.util;
import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.vo.SampleVo;
import freemarker.template.Configuration;
import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
/**
......@@ -54,11 +51,9 @@ public class WordUtil {
try {
configuration.setClassForTemplateLoading(WordUtil.class, FTL_FP);
Template template = configuration.getTemplate(templateFileName, "UTF-8");
if (template ==null){
System.out.println("==========================\n 报错-================\n");
}
String filePath;
filePath = "";
file = new File(filePath + templeName);
......@@ -66,8 +61,38 @@ public class WordUtil {
FileOutputStream fos = new FileOutputStream(file);
out = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
//变量替换
List<SampleVo> list = (List<SampleVo>)beanParams.get("list");
if(list != null && list.size()>0){
for(SampleVo sampleVo : list){
String teamName = sampleVo.getTeamName();
if(sampleVo.getTeamName().contains("<sub>") || sampleVo.getTeamName().contains("</sub>")
){
String startStr = "</w:t></w:r><w:r><w:rPr><w:vertAlign w:val='subscript'/></w:rPr><w:t>";
String endStr = "</w:t></w:r><w:r><w:t>";
teamName = teamName
.replaceAll("<sub>",startStr)
.replaceAll("</sub>",endStr);
}
if(sampleVo.getTeamName().contains("<sup>") || sampleVo.getTeamName().contains("</sup>")
){
String startStr = "</w:t></w:r><w:r><w:rPr><w:vertAlign w:val='superscript'/></w:rPr><w:t>";
String endStr = "</w:t></w:r><w:r><w:t>";
teamName = teamName
.replaceAll("<sup>",startStr)
.replaceAll("</sup>",endStr);
}
sampleVo.setTeamName(teamName);
}
}
template.process(beanParams, out);
FileInputStream in = new FileInputStream(file);
/*HSSFWorkbook xssfWorkbook = new HSSFWorkbook(in);
ByteArrayOutputStream os = new ByteArrayOutputStream();
xssfWorkbook.write(os);
byte[] bytes = os.toByteArray();*/
byte[] buffer = new byte[in.available()];
int i = in.read(buffer);
......
......@@ -2,8 +2,10 @@ package cn.wise.sc.cement.business.util.dfs;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileReader;
import com.aspose.cells.License;
import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;
import com.aspose.words.Document;
import org.apache.commons.io.FilenameUtils;
import org.csource.common.MyException;
import org.csource.common.NameValuePair;
......@@ -180,8 +182,29 @@ public class FastDFSUtils {
}
}
public static String conventAndUploadWord(InputStream inputStream, String filename) {
public static String conventAndUpload(InputStream inputStream, String filename) {
File outputFile = new File(filename + ".pdf");
String filePath = "";
try {
Document document = new Document(inputStream);
document.save(outputFile.getAbsolutePath(), com.aspose.words.SaveFormat.PDF);
FileReader fileReader = new FileReader(outputFile.getAbsolutePath());
filePath = uploadPic(fileReader.readBytes(), outputFile.getName(), outputFile.length());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除创建的输出文件
FileUtil.del(outputFile);
return filePath;
}
}
public static String conventAndUploadExcel(InputStream inputStream, String filename) {
// 验证License
getLicense();
File outputFile = new File(filename + ".pdf");
String filePath = "";
try {
......@@ -202,4 +225,13 @@ public class FastDFSUtils {
}
}
public static void getLicense() {
try {
InputStream is = FastDFSUtils.class.getClassLoader().getResourceAsStream("\\license.xml");
License aposeLic = new License();
aposeLic.setLicense(is);
} catch (Exception e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port=8888
fastdfs.http.anti_steal_token=no
fastdfs.http.secret_key=FastDFS1234567890
fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122
fastdfs.tracker_servers=192.168.110.85:22122
#fastdfs.tracker_servers=192.168.110.85:22122
<License>
<Data>
<Products>
<Product>Aspose.Total for Java</Product>
<Product>Aspose.Words for Java</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SubscriptionExpiry>20991231</SubscriptionExpiry>
<LicenseExpiry>20991231</LicenseExpiry>
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
</Data>
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
</License>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<contextName>logback-spring</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
<property name="logging.path" value="./../wise-came/logs"/>
<!-- <property name="logging.path" value="./../wise-came/logs"/>-->
<!--0. 日志格式和颜色渲染 -->
<!-- 彩色日志依赖的渲染类 -->
......
server:
port: 7007
spring:
application: tianjin-cement
profiles:
active: dev
datasource:
# 192.168.110.85 admin!@#123
url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://192.168.110.85:3306/sinoma_bangye?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://47.93.148.213:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: admin!@#123
driverClassName: com.mysql.cj.jdbc.Driver
hikari:
minimum-idle: 3
maximum-pool-size: 10
max-lifetime: 30000 #不能小于30秒,否则默认回到1800秒
connection-test-query: SELECT 1
redis:
port: 6379
host: localhost
# password: Wise_@123456
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# 设置swagger用户名密码
swagger:
basic:
enable: false
username: admin
password: admin
mybatis-plus:
# 启动时是否检查MyBatis XML文件是否存在
check-config-location: true
type-aliases-package: cn.wise.sc.cement.business.entity.**
mapper-locations: classpath:/cn/wise/sc/cement/business/mapper/xml/*Mapper.xml
#正式服务器
#weixin:
# corpId: wwc7ae84e6af6ba921
# agentIdPC: 1000151
# agentSecretPC: h4K-GL1y7pCADFZQ7m1tO1GOSa3zU4kGEItFknvwOAg
# agentId: 1000150
# agentSecret: zWIO_kt36d1jta3R76s6WmKFdfs2TuJ1wTQu1IXO0Fc
# backUrl: https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system
# systemUrl: '<a href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwc7ae84e6af6ba921&redirect_uri=https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect">物化检测流程</a>,'
#测试服务器
weixin:
corpId: ww348f91b2573c1867
agentId: 1000002
agentIdPC: 1000003
agentSecret: gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o
agentSecretPC: itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A
backUrl: https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system
systemUrl: '<a href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww348f91b2573c1867&redirect_uri=https%3a%2f%2fccdcmtl.sinoma-tianjin.com%2flab-system%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect">物化检测流程</a>,'
<?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="cn.wise.sc.cement.business.mapper.AppraisalValueMapper">
<update id="update">
update appraisal_value set appraisal_values = #{params}
</update>
<select id="getAppraisalValue" resultType="java.lang.Double">
select av.appraisal_values as appraisalValues
from appraisal_value av
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.CabinetMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.CapabilityManagementMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.CapabilityManagementVo">
select cm.*,su.name as userName
from capability_management cm
left join sys_user su on cm.user_id = su.id
where cm.user_id = #{param.userId}
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.CapabilityManagementVo">
SELECT
cm.capability_item as 能力项,
cm.capability_range as 能力范围,
cm.obtain_time as 取得日期,
cm.create_time as 创建时间,
cm.update_time as 修改时间,
cm.remark as 备注,
(select count(*) from sys_user su where su.id = cm.user_id) as 用户id
FROM capability_management cm,sys_user su
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.ChinastdMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ChinastdcodeMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ClientMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.region != null and params.region != ''">
and t.region like concat('%', #{params.region}, '%')
</if>
<if test="params.principal != null and params.principal != ''">
and t.principal like concat('%', #{params.principal}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.ClientVo">
select t.*,
(select count(*) from project p where p.client_id = t.id) projectNums
from client t
<include refid="where"/>
order by t.id desc
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 单位名称,
t.principal as 联系人,
t.principal_phone as 联系电话,
t.region as 所在地区,
(select count(*) from project p where p.client_id = t.id) as 项目数,
(
CASE t.status
WHEN 0 THEN '已禁用'
WHEN 1 THEN '已启用'
ELSE NULL
END
) as 状态
FROM client t,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ConsumablesEnterMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ConsumablesMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.supplierName != null and params.supplierName != ''">
and t.supplier_name = #{params.supplierName}
</if>
</where>
</sql>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 易耗品名称,
t.code as '易耗品代号',
t.supplier_name as 供应商,
t.position as 位置,
t.purchase_date as 购买日期,
t.stock_num as 库存数量
FROM consumables t ,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ConsumablesOutMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.DataStatisticsMapper">
<select id="countTeamByTime" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT DATE_FORMAT(sd.create_time,'%Y-%m') as name, count(sd.id) as value
FROM sample_distribution sd
where sd.finish_time is not null
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by name
</select>
<select id="countTeamByOrigin" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT s.origin as name, count(sd.id) as value
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
where sd.finish_time is not null
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by s.origin
</select>
<select id="countItemDistributionSample"
resultType="cn.wise.sc.cement.business.entity.ItemDistributionSample">
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE
sd.finish_time BETWEEN #{start} AND #{end}
<if test="origin != null and origin != '' ">
AND s.origin = #{origin}
</if>
<if test="teamId != '' and teamId != null">
AND sd.team_id = #{teamId}
</if>
</select>
<select id="countItemDistribution" resultType="cn.wise.sc.cement.business.entity.ItemDistribution">
SELECT COUNT(a.sample_id) as `count`,`key` from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE (sd.finish_time between #{start} and #{end})
<if test="origins != null">
AND s.origin in
<foreach collection="origins" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="itemId != null">
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EntityEnclosureMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EntrustApprovalMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EquipmentMapper">
<sql id="where">
<where>
and t.status != 3
<if test="params.brand != null and params.brand != ''">
and t.brand = #{params.brand}
</if>
<if test="params.supplierId != null">
and t.supplier_id = #{params.supplierId}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.EquipmentVo">
SELECT t.*, s.name as supplierName
FROM equipment t
left join supplier s on s.id = t.supplier_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 设备名称,
t.code as 设备编号,
t.brand as 设备品牌,
t.model as '规格/型号',
s.name as 供应商,
t.position as 位置,
t.purchase_date as 购买日期
FROM equipment t
left join supplier s on s.id = t.supplier_id
,(select @i:=0)t
<include refid="where"/>
</select>
<select id="exportTestList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 设备名称,
t.code as 设备编号,
t.model as '规格/型号',
IF(ISNULL(t.test_cycle),'',t.test_cycle) as '检/校周期',
IF(ISNULL(t.test_date),'',t.test_date) as 检定日期,
IF(ISNULL(t.check_date),'',t.check_date) as 校检日期 ,
IF(ISNULL(t.period_date),'',t.period_date) as 期间核查日期,
IF(ISNULL(t.try_result),'',t.try_result) as 实施结果
FROM equipment t
,(select @i:=0)t
<include refid="where"/>
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.EquipmentVo">
SELECT t.*, s.name as supplierName
FROM equipment t
left join supplier s on s.id = t.supplier_id
where t.id = #{id}
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EquipmentScrapMapper">
<sql id="where">
<where>
e.id is not null
<if test="params.brand != null and params.brand != ''">
and e.brand = #{params.brand}
</if>
<if test="params.supplierId != null">
and e.supplier_id = #{params.supplierId}
</if>
<if test="params.name != null and params.name != ''">
and e.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.EquipmentScrapVo">
SELECT es.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model, e.purchase_date as purchaseDate,
e.assets_value as assetsValue
FROM equipment_scrap es
left join equipment e on e.id = es.equipment_id
<include refid="where"/>
ORDER BY es.create_time ASC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
e.name as 设备名称,
e.code as 设备编号,
e.model as '规格/型号',
IF(ISNULL(e.purchase_date),'',e.purchase_date) as 购置日期,
IF(ISNULL(e.assets_value),'',e.assets_value) as 设备原值,
IF(ISNULL(es.scrap_reason),'',es.scrap_reason) as 报废原因,
IF(ISNULL(su.name),'',su.name) as 申请人,
IF(ISNULL(es.scrap_date),'',es.scrap_date) as 报废申请日期,
(
CASE es.status
WHEN 0 THEN '待审批'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
ELSE NULL
END
) as 申请结果
FROM equipment_scrap es
left join equipment e on e.id = es.equipment_id
left join sys_user su on su.id = es.user_id
,(select @i:=0)et
<include refid="where"/>
ORDER BY es.create_time ASC
</select>
<select id="getScrapDetail" resultType="cn.wise.sc.cement.business.model.vo.EquipmentScrapVo">
SELECT es.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model, e.purchase_date as purchaseDate,
e.assets_value as assetsValue
FROM equipment_scrap es
left join equipment e on e.id = et.equipment_id
where es.id = #{id}
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EquipmentTestMapper">
<sql id="where">
<where>
and et.equipment_id = #{params.equipmentId}
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.EquipmentTestVo">
SELECT et.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model, e.test_cycle as testCycle
FROM equipment_test et
left join equipment e on e.id = et.equipment_id
<include refid="where"/>
ORDER BY et.create_time ASC
</select>
<select id="getTestDetail" resultType="cn.wise.sc.cement.business.model.vo.EquipmentTestVo">
SELECT et.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model, e.test_cycle as testCycle
FROM equipment_test et
left join equipment e on e.id = et.equipment_id
where et.id = #{id}
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EquipmentTroubleshootingMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and e.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.EquipmentTroubleshootingVo">
SELECT et.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model
FROM equipment_troubleshooting et
left join equipment e on e.id = et.equipment_id
<include refid="where"/>
ORDER BY et.create_time ASC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
e.name as 设备名称,
e.code as 设备编号,
e.model as '规格/型号',
IF(ISNULL(et.find_date),'',et.find_date) as 发现日期,
IF(ISNULL(et.find_user),'',et.find_user) as 发现人,
IF(ISNULL(et.fault_phenomenon),'',et.fault_phenomenon) as 故障描述,
IF(ISNULL(et.repair_conclusion),'',et.repair_conclusion) as 实施结果
FROM equipment_troubleshooting et
left join equipment e on e.id = et.equipment_id
,(select @i:=0)et
<include refid="where"/>
ORDER BY et.create_time ASC
</select>
<select id="getTroubleshootingDetail" resultType="cn.wise.sc.cement.business.model.vo.EquipmentTroubleshootingVo">
SELECT et.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model
FROM equipment_troubleshooting et
left join equipment e on e.id = et.equipment_id
where et.id = #{id}
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.EquipmentUseMapper">
<sql id="where">
<where>
<if test="params.brand != null and params.brand != ''">
and e.brand = #{params.brand}
</if>
<if test="params.supplierId != null">
and e.supplier_id = #{params.supplierId}
</if>
<if test="params.name != null and params.name != ''">
and e.name like concat('%', #{params.name}, '%')
</if>
<if test="params.code != null and params.code != ''">
and e.code = #{params.code}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.EquipmentUseVo">
SELECT eu.*,
e.name as equipmentName, e.code as code, e.brand as brand, e.model as model
FROM equipment_use eu
left join equipment e on e.id = eu.equipment_id
<include refid="where"/>
ORDER BY eu.create_time ASC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
e.name as 设备名称,
e.code as 设备编号,
e.model as '规格/型号',
IF(ISNULL(eu.use_date),'',eu.use_date) as 使用日期,
IF(ISNULL(eu.user_name),'',eu.user_name) as 使用人,
IF(ISNULL(eu.project_name),'',eu.project_name) as 参与项目,
IF(ISNULL(eu.project_code),'',eu.project_code) as 项目编号,
IF(ISNULL(eu.test_item),'',eu.test_item) as 检测项
FROM equipment_use eu
left join equipment e on e.id = eu.equipment_id
,(select @i:=0)eu
<include refid="where"/>
ORDER BY eu.create_time ASC
</select>
<select id="getEquipmentNamesByProjectId" resultType="java.lang.String">
SELECT CONCAT(e.`name`,' (',e.`code`,')') FROM equipment_use eu
RIGHT JOIN
(SELECT `name`,id,`code` FROM equipment) e
ON eu.equipment_id = e.id AND eu.project_id = #{param}
WHERE eu.id IS NOT NULL
</select>
<select id="getEquipmentNamesByEquipmentIds" resultType="java.lang.String">
SELECT CONCAT(`name`,' (',`code`,')') FROM equipment
where id in
<foreach collection="params" open="(" close=")" item="id" separator=",">
#{id}
</foreach>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.HandleMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.userName != null and params.userName != ''">
and su.name like concat('%', #{params.userName}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.HandleVo">
select t.*, su.name as userName
from handle t
left join sys_user su on su.id = t.user_id
<include refid="where"/>
order by t.create_time desc
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.HandleVo">
select t.*, su.name as userName
from handle t
left join sys_user su on su.id = t.user_id
where t.id = #{id}
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.HistoryArchivesMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.HistoryArchivesVo">
select ha.*,su.name as userName
from history_archives ha
left join sys_user su on ha.user_id = su.id
where ha.user_id = #{param.userId}
order by ha.create_time desc
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.HistoryArchivesVo">
SELECT
ha.time as 时间,
ha.type as 类型,
ha.content as 内容,
ha.create_time as 创建时间,
ha.update_time as 修改时间,
ha.remark as 备注,
(select count(*) from sys_user su where su.id = ha.user_id) as 用户id
FROM history_archives ha,sys_user su
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.MethodMapper">
<sql id="where">
<where>
<if test="params.standard != null and params.standard != ''">
and t.standard = #{params.standard}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 检测依据名,
t.standard as 标准号,
t.number as 检测依据编号,
t.do_date as 实施日期,
t.up_date as 更新日期
FROM method t ,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.NonStandardApplyMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and su.name like concat('%', #{params.name}, '%')
</if>
<if test="params.userId != null ">
and na.user_id = #{params.userId}
</if>
<if test="params.id != null ">
and na.id = #{params.id}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApplyVo">
SELECT na.*,su.name AS name,su.username AS account
FROM nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/>
order by na.start_time desc
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApplyVo">
select na.*,su.name as name,su.username as account
from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/>
order by na.start_time desc
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApplyVo">
SELECT na.*,su.name AS NAME,su.username AS account
FROM nonstandard_apply na
LEFT JOIN sys_user su ON na.user_id = su.id
<include refid="where"/>
order by na.start_time desc
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
na.id as 序号,
su.name as 姓名,
su.username as 账户,
na.statistical as 起止日期,
na.reported_hours as 上报工日,
(
CASE na.status
WHEN 0 THEN '未申请'
WHEN 1 THEN '待审批'
WHEN 2 THEN '已通过'
WHEN 3 THEN '未通过'
ELSE NULL
END
)as 状态,
na.work_type as 工作类别,
na.work_description as 工作描述
FROM nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/>
order by na.start_time desc
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.NonStandardApprovalMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and su.name like concat('%', #{params.name}, '%')
</if>
<if test="params.status != null ">
and na.status = #{params.status}
</if>
<if test="params.userId != null ">
and na.user_id = #{params.userId}
</if>
<if test="params.id != null ">
and na.id = #{params.id}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo">
select na.*,su.name as name,su.username as account
from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/>
<where> na.`status` != 0</where>
order by na.start_time desc
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo">
select na.*,su.name as name,su.username as account
from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
order by na.start_time desc
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo">
SELECT na.*,su.name AS NAME,su.username AS account
FROM nonstandard_apply na
LEFT JOIN sys_user su ON na.user_id = su.id
<include refid="where"/>
order by na.start_time desc
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
na.id as 序号,
su.name as 姓名,
su.username as 账户,
na.statistical as 起止日期,
na.reported_hours as 上报工日,
na.approval_hours as 审批工日,
(
CASE na.status
WHEN 0 THEN '未提交'
WHEN 1 THEN '待审批'
WHEN 3 THEN '未通过'
ELSE '已通过'
END
)as 状态,
na.final_value as 最终产值,
na.final_rejection as 驳回意见
FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
<include refid="where"/>
order by na.start_time desc
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.NonStandardValueMapper">
<sql id="where">
<where>
<if test="params.name != null and params.name != ''">
and su.name like concat('%', #{params.name}, '%')
</if>
<if test="params.status != null ">
and na.status = #{params.status}
</if>
<if test="params.userId != null ">
and na.user_id = #{params.userId}
</if>
<if test="params.start !=null">
and na.start_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and na.end_time <![CDATA[<=]]> #{params.end}
</if>
<if test="params.groups !=null">
and su.group_id = #{params.groups}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">
select na.*,su.name as name,su.username as account,su.group_id as groups,sg.name as groupname
from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where"/>
order by na.start_time desc
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">
select na.*,su.name as name,su.username as account,na.start_time as startTime,su.group_id as groups,sg.name as
groupname
from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where"/>
order by na.start_time desc
</select>
<!-- <select id="getByUserId" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">-->
<!-- select na.*,su.name as name,su.username as account,na.start_time as startTime,su.group_id as groups,sg.name as-->
<!-- groupname-->
<!-- from nonstandard_apply na-->
<!-- LEFT JOIN sys_user su ON su.id = na.user_id-->
<!-- LEFT JOIN sys_group sg ON sg.id = su.group_id-->
<!-- <include refid="where"/>-->
<!-- order by na.id asc-->
<!-- </select>-->
<select id="exportList" resultType="java.util.HashMap">
SELECT
na.id as 序号,
su.name as 姓名,
su.username as 账户,
na.statistical as 起止日期,
na.reported_hours as 上报工日,
na.approval_hours as 审批工日,
na.final_value as 最终产值,
na.work_type as 工作类别,
na.work_description as 工作描述,
su.group_id as 部门id,
sg.name as 部门名
FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where"/>
order by na.start_time desc
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.NormProductionMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanConsumablesPurchaseMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 产品名称,
t.model as '规格/型号',
t.technical_index as 技术指标,
t.unit_price as 单价(万元),
t.production_unit as 生产单位,
t.purchase_num as 采购数量,
t.purchase_date as 购买日期,
su.name as 采购人
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo">
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
<sql id="whereNew">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.start !=null">
and t.create_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and t.create_time <![CDATA[<=]]> #{params.end}
</if>
</where>
</sql>
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="whereNew"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanEquipmentMaintainMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo">
SELECT t.*, su.name as maintainerName
FROM plan_equipment_maintain t
left join sys_user su on su.id = t.maintainer_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 产品名称,
t.model as '规格/型号',
t.code as 编号,
t.maintain_date as 维护日期,
t.maintain_content as 维护内容,
su.name as 执行人,
t.maintain_result as 完成情况
FROM plan_equipment_maintain t
left join sys_user su on su.id = t.maintainer_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo">
SELECT t.*, su.name as maintainerName, su2.name as userName
FROM plan_equipment_maintain t
left join sys_user su on su.id = t.maintainer_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
<sql id="whereNew">
<where>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.start !=null">
and t.create_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and t.create_time <![CDATA[<=]]> #{params.end}
</if>
</where>
</sql>
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo">
SELECT t.*, su.name as maintainerName
FROM plan_equipment_maintain t
left join sys_user su on su.id = t.maintainer_id
<include refid="whereNew"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanEquipmentPurchaseMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 产品名称,
t.model as '规格/型号',
t.technical_index as 技术指标,
t.unit_price as 单价(万元),
t.production_unit as 生产单位,
t.purchase_num as 采购数量,
t.purchase_date as 购买日期,
su.name as 采购人
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.purchaser_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo">
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
<sql id="whereNew">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.start !=null">
and t.create_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and t.create_time <![CDATA[<=]]> #{params.end}
</if>
</where>
</sql>
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="whereNew"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanEquipmentRepairMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo">
SELECT t.*, su.name as repairerName
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 产品名称,
t.model as '规格/型号',
t.technical_index as 技术指标,
t.unit_price as 单价(万元),
t.production_unit as 生产单位,
t.repair_date as 维修日期,
su.name as 执行人
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo">
SELECT t.*, su.name as repairerName, su2.name as userName
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
<sql id="whereNew">
<where>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo">
SELECT t.*, su.name as repairerName
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
<include refid="whereNew"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanPeopleMapper">
<sql id="where">
<where>
<if test="params.planId != null ">
and pp.plan_id = #{params.planId}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanPeopleVo">
select pp.*
from plan_people pp
<include refid="where"/>
order by pp.id asc
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.PlanStandardPurchaseMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.code != null and params.code != ''">
and t.code like concat('%', #{params.code}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 标物名称,
t.distribution_unit as 经销单位,
t.purchase_num as 采购数量,
t.purchase_date as 采购时间,
su.name as 采购人
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo">
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
<sql id="whereNew">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.start !=null">
and t.create_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and t.create_time <![CDATA[<=]]> #{params.end}
</if>
</where>
</sql>
<select id="wordList" resultType="cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo">
SELECT t.*, su.name as purchaserName
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
<include refid="whereNew"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PlanTrainingMapper">
<sql id="where">
<where>
<if test="params.id != null ">
and pt.id = #{params.id}
</if>
<if test="params.start !=null">
and pt.start_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and pt.end_time <![CDATA[<=]]> #{params.end}
</if>
<if test="params.objective != null and params.objective != ''">
and pt.objective like concat('%', #{params.objective}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanTrainingVo">
select
pt.*
from plan_training pt
<include refid="where"/>
order by pt.id desc
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.PlanTrainingVo">
select
pt.*
from plan_training pt
<include refid="where"/>
order by pt.id asc
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.PlanTrainingVo">
select
pt.*
from plan_training pt
<include refid="where"/>
order by pt.id asc
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
pt.id as 序号,
pt.plan_object as 培训对象,
pt.objective as 培训目的,
pt.content as 培训内容,
pt.start_time as 培训时间,
pt.mode as 培训方式,
pt.people as 培训人,
pt.assessment as 考核人,
pt.implementation as 实施情况
from plan_training pt
<include refid="where"/>
ORDER BY pt.id ASC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.PrecipriceMapper">
<update id="updateStatusByEntrustId">
UPDATE preciprice SET `status` =1 WHERE entrust_id = #{param}
</update>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.ProjectMapper">
<sql id="where">
<where>
<if test="params.code != null and params.code != ''">
and t.code like concat('%', #{params.code}, '%')
</if>
<if test="params.clientId != null">
and t.client_id = #{params.clientId}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.ProjectVo">
select t.*,cl.name clientName
FROM project t
left join client cl on cl.id = t.client_id
<include refid="where"/>
order by t.id desc
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.ProjectVo">
select t.*,
cl.id as clientId, cl.name clientName
FROM project t
left join client cl on cl.id = t.client_id
where t.status = 1
order by t.id desc
</select>
<select id="getProjectList" resultType="cn.wise.sc.cement.business.model.vo.ProjectVo">
select t.*,
cl.id as clientId, cl.name clientName
FROM project t
left join client cl on cl.id = t.client_id
where t.status = 1
<if test="clientId != null">
and t.client_id = #{clientId}
</if>
order by t.id desc
</select>
<select id="getByName" resultType="cn.wise.sc.cement.business.model.vo.ProjectVo">
select t.*,
cl.id as clientId, cl.name clientName
FROM project t
left join client cl on cl.id = t.client_id
where t.status = 1 and t.name=#{name}
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 项目名称,
t.code as 项目编号,
cl.name as 所属单位
FROM project t
left join client cl on cl.id = t.client_id
,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.QualityApplyMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleCheckMapper">
<select id="getSampleSixElementCheck" resultType="cn.wise.sc.cement.business.model.SixElementReport">
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id,sc.id FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
WHERE sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,parallel_code,weight,id
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
WHERE count_results IS NOT NULL AND s.parallel_code = cement_code;
</select>
<select id="getSampleIndustrialCheck" resultType="cn.wise.sc.cement.business.model.IndustrialReport">
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
AND sc. is_parallel = 0
WHERE sct.sample_id IS NOT NULL AND sc.team_group_name = '工业分析' ) sscct
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,weight,id
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
WHERE count_results IS NOT NULL;
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleCheckTeamMapper">
<select id="getEntrustSample" resultType="cn.wise.sc.cement.business.entity.EntrustSample">
SELECT t.project_name,t.entrust_code,sscc.sample_id,sscc.entrust_id,sscc.`sample_name`,
sscc.user_id,sscc.team_group_id,sscc.distribution_id FROM entrust t
RIGHT JOIN
(SELECT s.entrust_id,s.sample_id,s.`name` as sample_name,scc.user_id,scc.team_group_id,scc.distribution_id FROM
sample s
RIGHT JOIN
(SELECT id,sct.check_id,sct.sample_id,sct.user_id,team_group_id,sct.distribution_id FROM sample_check sc
RIGHT JOIN
(SELECT sample_id,user_id,check_id, id as distribution_id FROM sample_check_team) sct
ON sc.id = sct.check_id) scc
ON s.id = scc.sample_id) sscc
ON sscc.entrust_id = t.id
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleDistributionMapper">
<sql id="where">
<where>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.clientId != null">
and e.client_id = #{params.clientId}
</if>
<if test="params.projectName != null and params.projectName != ''">
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if test="params.userId != null">
and t.user_id = #{params.userId}
</if>
</where>
</sql>
<sql id="sampleDisWhere">
<where>
`status` > 5 AND d.distribution_id IS NOT NULL
<if test="params.start_time != null and params.start_time != ''">
and d.finish_time <![CDATA[>=]]> #{params.start_time}
</if>
<if test="params.end_time != null and params.end_time != ''">
and d.finish_time <![CDATA[<=]]> #{params.end_time}
</if>
<if test="params.user_id != null and params.user_id != ''">
and d.user_id = #{params.user_id}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionVo">
select t.*, p.id as projectId, p.name as projectName, p.code as projectCode,
e.id as entrustId, e.entrust_date as entrustDate, e.sample_num sampleNum,
su.name as userName
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
<include refid="where"/>
order by t.create_time desc
</select>
<select id="getDistributionTeamList" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo">
select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
t.enclosure_url as enclosureUrl, t.alias as alias, t.ext_name as extName,
t.status as status,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if test="userId != null">
and t.user_id = #{userId}
</if>
order by t.id asc
</select>
<select id="getDistributionTeamGroupList" resultType="cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo">
select su.id as userId,
t.team_group_id as teamGroupId
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if test="userId != null">
and t.user_id = #{userId}
</if>
group by t.team_group_id
</select>
<select id="getSampleCheckGroupList" resultType="cn.wise.sc.cement.business.model.vo.SampleCheckGroupVo">
select sd.team_group_id as teamGroupId, tg.name as teamGroupName,
sd.user_id as userId, su.name as userName
from sample_distribution sd
left join team_group tg on tg.id = sd.team_group_id
left join sys_user su on su.id = sd.user_id
where tg.check_element is not null and sd.sample_id = #{sampleId}
group by sd.team_group_id,sd.user_id
order by sd.team_group_id
</select>
<select id="getEntrustSample"
resultType="cn.wise.sc.cement.business.entity.EntrustSample">
SELECT e.project_name,e.entrust_code,g.distribution_id,g.entrust_id,g.`sample_name`,g.user_id,g.sample_id,e.`status` FROM entrust e
RIGHT JOIN
(SELECT s.`name` as sample_name,d.distribution_id,s.entrust_id,d.user_id,s.id as sample_id FROM sample s
RIGHT JOIN
(SELECT user_id, id as distribution_id,sample_id FROM sample_distribution ) d on s.id = d.sample_id ) g
ON g.entrust_id = e.id
WHERE e.status > 5
</select>
<select id="getSampleDistribution" resultType="cn.wise.sc.cement.business.entity.EntrustSample">
SELECT
project_name,entrust_code,id,d.distribution_id,s.sample_name,d.user_id,s.sample_id,d.team_group_id,d.finish_time,`status`
FROM entrust e
LEFT JOIN
(SELECT `name` as sample_name,entrust_id,id as sample_id FROM sample) as s
ON e.id = s.entrust_id
LEFT JOIN
(SELECT user_id, id as distribution_id,sample_id as dis_sample_id,team_group_id,finish_time FROM
sample_distribution) as d
ON s.sample_id = d.dis_sample_id
<include refid="sampleDisWhere"/>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleHandleEnclosureMapper">
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.SampleHandleEnclosureVo">
select t.*,
su.name as userName,
(
CASE t.status
WHEN 0 THEN '未上传'
WHEN 1 THEN '成功'
WHEN 2 THEN '上传失败'
ELSE ''
END
) as statusValue
from sample_handle_enclosure t
left join sys_user su on su.id = t.user_id
where t.sample_handle_id = #{params.sampleHandleId}
<if test="params.userId != null">
and t.user_id = #{params.userId}
</if>
order by t.id ASC
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleHandleMapper">
<sql id="where">
<where>
and s.cement_code = s.parallel_code
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.clientId != null">
and e.client_id = #{params.clientId}
</if>
<if test="params.projectName != null and params.projectName != ''">
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if test="params.projectCode != null and params.projectCode != ''">
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if test="params.userId != null">
and t.user_id = #{params.userId}
</if>
</where>
</sql>
<sql id="sampleDisWhere">
<where>
e.status > 4 AND h.id IS NOT NULL
<if test="params.start_time != null and params.start_time != ''">
and h.finish_time <![CDATA[>=]]> #{params.start_time}
</if>
<if test="params.end_time != null and params.end_time != ''">
and h.finish_time <![CDATA[<=]]> #{params.end_time}
</if>
<if test="params.user_id != null and params.user_id != ''">
and h.user_id = #{params.user_id}
</if>
</where>
</sql>
<select id="getSampleHandleList" resultType="cn.wise.sc.cement.business.model.vo.SampleHandleVo">
select t.*, p.id as projectId, p.name as projectName, p.code as projectCode,
e.sample_num as sampleNum,
s.name as sampleName, s.sample_code as sampleCode,s.cement_code as cementCode,
su.name as userName,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_handle t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
where e.id = #{params.id} and s.cement_code = s.parallel_code
<if test="params.userId != null">
and t.user_id = #{params.userId}
</if>
order by t.id ASC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.SampleHandleVo">
select t.*, su.name as userName, s.name as sampleName, s.sample_code as sampleCode,
s.cement_code as cementCode, p.id as projectId, p.name as projectName, p.code as projectCode,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_handle t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
where t.id = #{id}
</select>
<select id="getEntrustSample" resultType="cn.wise.sc.cement.business.entity.EntrustSample">
SELECT project_name,entrust_code,h.id as distribution_id ,s.entrust_id,h.user_id,s.id as sample_id,e.status FROM entrust e
LEFT JOIN
(SELECT * FROM sample) s
ON e.id = s.entrust_id
LEFT JOIN
(SELECT * FROM sample_handle) h
ON h.sample_id = s.id
WHERE e.status > 4 AND h.id IS NOT NULL
</select>
<select id="getEntrustSampleOptimize" resultType="cn.wise.sc.cement.business.entity.EntrustSample">
SELECT project_name,entrust_code,h.id,s.entrust_id,h.user_id,s.id as sample_id,e.status,h.content,h.finish_time
FROM entrust e
LEFT JOIN
(SELECT * FROM sample) s
ON e.id = s.entrust_id
LEFT JOIN
(SELECT * FROM sample_handle) h
ON h.sample_id = s.id
<include refid="sampleDisWhere"/>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleMapper">
<sql id="where">
<where>
and s.parallel_code = s.cement_code
<if test="params.sampleName != null and params.sampleName != ''">
and s.name like concat('%', #{params.sampleName}, '%')
</if>
<if test="params.cementCode != null and params.cementCode != ''">
and s.cement_code = #{params.cementCode}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.SampleVo">
select s.*, e.project_id as projectId, e.project_name as projectName,e.project_code as projectCode
from sample s
left join entrust e on e.id = s.entrust_id
<include refid="where"/>
order by s.name
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
e.project_name as 项目名称,
e.project_code as 项目编号,
s.name as 样品名称,
s.sample_form as 样品状态,
s.sample_code as 来样编号,
s.cement_code as 本所编号,
IF(ISNULL(s.original_position),'',s.original_position) 小样保存位置,
IF(ISNULL(s.register_time),'',s.register_time) as 保存日期,
IF(ISNULL(s.destruction_time),'',s.destruction_time) as 销毁日期,
IF(ISNULL(su.name),'',su.name) as 批准人,
IF(ISNULL(s.remark),'',s.remark) as 备注
from sample s
left join entrust e on e.id = s.entrust_id
left join sys_user su on su.id = s.operator_id
<include refid="where"/>
order by s.create_time desc
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.SampleVo">
select s.*,s.name as sampleName, s.cement_code as cementCode, s.weight as weight
from sample s
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
where s.id = #{id}
</select>
<select id="getSampleSaveList" resultType="cn.wise.sc.cement.business.model.SampleSaveDto">
SELECT
s.id,
s.entrust_id,
s.`name`,
s.`sample_form`,
s.cement_code,
s.sample_code,
s.little_position,
DATE_FORMAT(s.register_time,'%Y/%m/%d') as register_time,
DATE_FORMAT(s.destruction_time,'%Y/%m/%d') as destruction_time,
s.operator_id,
s.remark,
e.project_name,
e.project_code,
su.`name` as user_name
FROM
`sample` s
LEFT JOIN entrust e
ON s.entrust_id = e.id
LEFT JOIN sys_user su
ON su.id = s.operator_id
</select>
<sql id="whereNew">
<where>
and s.parallel_code = s.cement_code
<if test="params.sampleName != null and params.sampleName != ''">
and s.name like concat('%', #{params.sampleName}, '%')
</if>
<if test="params.cementCode != null and params.cementCode != ''">
and s.cement_code = #{params.cementCode}
</if>
<if test="params.start !=null">
and s.create_time <![CDATA[>=]]> #{params.start}
</if>
<if test="params.end !=null">
and s.create_time <![CDATA[<=]]> #{params.end}
</if>
</where>
</sql>
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.SampleWord">
SELECT
e.project_name AS project_name,
e.entrust_code,
s.name,
s.cement_code,
s.weight,
s.original_position,
date_format(s.create_time, '%Y/%m/%d') as create_time,
s.remark,
date_format(s.destruction_time, '%Y/%m/%d') as destruction_time,
su.name AS user_name
FROM
sample s
LEFT JOIN entrust e ON s.entrust_id = e.id
LEFT JOIN sys_user su ON su.id = s.operator_id
<include refid="whereNew"/>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SampleTmpMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.StandardEnterMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.StandardMapper">
<select id="getStandardDetaulList" resultType="cn.wise.sc.cement.business.model.vo.StandardValueVo">
SELECT standard_id as id,element_value,element_name FROM `standard_value` sv
LEFT JOIN
(SELECT id FROM standard) s
ON sv.standard_id = s.id
</select>
<sql id="where">
<where>
<if test="params.supplierName != null and params.supplierName != ''">
and t.supplier_name = #{params.supplierName}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 标样名称,
t.code as 标物代号,
t.supplier_name as 经销单位,
t.position as 存放位置,
t.purchase_date as 进样日期,
t.valid_date as 有效日期,
t.stock_num as 剩余库存,
(
CASE t.status
WHEN 0 THEN '已作废'
WHEN 1 THEN '启用中'
ELSE NULL
END
) as 状态
FROM standard t ,(select @i:=0)t
<include refid="where"/>
ORDER BY t.id DESC
</select>
<select id="getStandardsByGroup" resultType="cn.wise.sc.cement.business.entity.StandardGroupDto">
select s.id as group_id,s.`name` as group_name,sv.element_name,sv.element_value FROM standard s
INNER JOIN
(SELECT * FROM standard_value) sv
ON s.id = sv.standard_id
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.StandardOutMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.StandardValueMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SupplierEnclosureMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.entity.SupplierEnclosure">
select se.*
from supplier_enclosure se
<if test="params.supplierId != null">
where se.supplier_id = #{params.supplierId}
</if>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SupplierMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysApprovalMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.ApprovalVo">
select sa.*, su.name as userName
from sys_approval sa
left join sys_user su on su.id = sa.user_id
order by sa.create_time desc
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysDictionaryMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysGroupMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.GroupVo">
select sg.*,
(select count(*) from sys_user su
where su.group_id = sg.id and su.is_delete=1
and su.status = 1
) as members
from sys_group sg
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysLogsMapper">
<sql id="where">
<where>
<if test="params.startDate != null and params.startDate != ''">
and DATE(t.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(t.create_time) &lt;= #{params.endDate}
</if>
<if test="params.objType != null">
and t.obj_type = #{params.objType}
</if>
<if test="params.objId != null">
and t.obj_id = #{params.objId}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.LogVo">
select t.*,su.name as userName
from sys_logs t
left join sys_user su on su.id = t.user_id
<include refid="where"/>
order by t.create_time desc
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysPermissionMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysPostMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysRoleMapper">
<insert id="saveRolePermission">
insert into sys_role_permission(role_id, permission_id) values
<foreach collection="permissionIds" item="permissionId"
separator=",">
(#{roleId}, #{permissionId})
</foreach>
</insert>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysUserEnclosureMapper">
<select id="getPage" resultType="cn.wise.sc.cement.business.entity.SysUserEnclosure">
select sue.*
from sys_user_enclosure sue
<if test="params.userId != null">
where sue.user_id = #{params.userId}
</if>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wise.sc.cement.business.mapper.SysUserMapper">
<sql id="where">
<where>
<if test="params.status != null ">
and su.status = #{params.status}
</if>
<if test="params.groupId != null">
and su.group_id = #{params.groupId}
</if>
<if test="params.name != null and params.name != ''">
and su.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.UserVo">
SELECT su.*, sg.name as groupName, sp.name as postName
FROM sys_user su
left join sys_group sg on sg.id = su.group_id
left join sys_post sp on sp.id = su.post_id
<include refid="where"/>
ORDER BY su.create_time DESC
</select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.UserVo">
SELECT su.*, sg.name as groupName, sp.name as postName,
sr.id as roleId, sr.name as roleName
FROM sys_user su
left join sys_group sg on sg.id = su.group_id
left join sys_post sp on sp.id = su.post_id
left join sys_role_user sru on sru.user_id = su.id
left join sys_role sr on sr.id = sru.role_id
where su.id = #{id}
</select>
<insert id="saveUserRoles">
insert into sys_role_user(role_id, user_id) values
(#{roleId}, #{userId})
</insert>
<!-- <select id="exportList" resultType="java.util.HashMap">-->
<!-- SELECT-->
<!-- su.id as 序号,-->
<!-- su.username as 用户账号,-->
<!-- su.name as 真实姓名,-->
<!-- (-->
<!-- CASE su.sex-->
<!-- WHEN 0 THEN '女'-->
<!-- ELSE '男'-->
<!-- END-->
<!-- )as 性别,-->
<!-- su.group_id as 组别id,-->
<!-- su.post_id as 职务id,-->
<!-- su.wx_id as 微信号,-->
<!-- su.qualifications as 职称,-->
<!-- (-->
<!-- CASE su.status-->
<!-- WHEN 0 THEN '禁用'-->
<!-- ELSE '启用'-->
<!-- END-->
<!-- )as 状态,-->
<!-- su.work_year as 工作年限,-->
<!-- su.phone as 手机号,-->
<!-- su.fax as 传真,-->
<!-- su.major as 专业,-->
<!-- su.email as 邮箱,-->
<!-- su.technology_date as 从事本技术领域日期,-->
<!-- su.technology_year as 从事本技术领域年限,-->
<!-- su.education as 文化程度,-->
<!-- su.create_time as 创建时间,-->
<!-- su.update_time as 修改时间,-->
<!-- su.remark as 备注-->
<!-- FROM sys_user su-->
<!-- <include refid="where" />-->
<!-- ORDER BY su.id ASC-->
<!-- </select>-->
</mapper>
<?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="cn.wise.sc.cement.business.mapper.SysUserMessageMapper">
<!-- 未查看消息 -->
<select id="getNoCheck" resultType="cn.wise.sc.cement.business.entity.SysUserMessage">
select *
FROM sys_user_message rum
where rum.is_check=0
<if test="userId != null and userId !=''">
and rum.user_id = #{userId}
</if>
<if test="appId != null and appId !=''">
and rum.app_id = #{appId}
</if>
<if test="messageType != null and messageType !=''">
and rum.message_type = #{messageType}
</if>
</select>
<!-- 未处理消息记录 -->
<select id="getNoDeal" resultType="cn.wise.sc.cement.business.entity.SysUserMessage">
select *
FROM sys_user_message rum
where rum.is_deal=0
<if test="userId != null and userId !=''">
and rum.user_id = #{userId}
</if>
<if test="appId != null and appId !=''">
and rum.app_id = #{appId}
</if>
<if test="messageType != null and messageType !=''">
and rum.message_type = #{messageType}
</if>
</select>
</mapper>
<?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="cn.wise.sc.cement.business.mapper.TeamGroupMapper">
</mapper>
<?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="cn.wise.sc.cement.business.mapper.TeamMapper">
<sql id="where">
<where>
<if test="params.status != null">
and t.status = #{params.status}
</if>
<if test="params.groupName != null and params.groupName != ''">
and tg.name = #{params.groupName}
</if>
<if test="params.name != null and params.name != ''">
and t.name like concat('%', #{params.name}, '%')
</if>
<if test="params.qualifications != null">
and t.qualifications = #{params.qualifications}
</if>
</where>
</sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.TeamVo">
SELECT t.*, tg.name as groupName,
(
CASE t.qualifications
WHEN 0 THEN '资质外'
WHEN 1 THEN '资质内'
ELSE ''
END
) as qualificationsValue,
h.name as handleName
FROM team t
left join team_group tg on tg.id = t.group_id
left join handle h on h.id = t.handle_id
<include refid="where"/>
ORDER BY t.create_time desc
</select>
<select id="exportList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
t.name as 检测项目,
IF(ISNULL(tg.name ),'',tg.name ) 所在检测组,
t.method_name as 检测依据,
t.charge as 收费标准,
(
CASE t.qualifications
WHEN 0 THEN '资质外'
WHEN 1 THEN '资质内'
ELSE ''
END
) as 资质范围
FROM team t
left join team_group tg on tg.id = t.group_id
,(select @i:=0)t
<include refid="where"/>
</select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.TeamListVo">
SELECT t.id as id, t.name as name, t.group_id as groupId, t.method_id as methodId,
t.method_name as methodName, t.number as number
FROM team t
where t.status=1 and t.is_display = 1
ORDER BY t.id ASC
</select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.TeamVo">
SELECT t.*, tg.name as groupName,
(
CASE t.qualifications
WHEN 0 THEN '资质范围外'
WHEN 1 THEN '资质范围内'
ELSE ''
END
) as qualificationsValue,
h.name as handleName
FROM team t
left join team_group tg on tg.id = t.group_id
left join handle h on h.id = t.handle_id
where t.id = #{id}
</select>
<!--根据检测组id 获取所有检测项信息-->
<select id="getByGroup" resultType="java.lang.String">
SELECT t.name
FROM team t
WHERE t.group_id = #{groupId} and t.status = 1
and t.remark is null
</select>
<!--根据检测组id 获取所有检测项信息-->
<select id="getListByGroup" resultType="java.util.Map">
SELECT t.name
FROM team t
WHERE t.group_id = #{groupId} and t.status = 1
</select>
</mapper>
fastdfs.connect_timeout=2000
fastdfs.network_timeout=1501
fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port=8888
fastdfs.http.anti_steal_token=no
fastdfs.http.secret_key=FastDFS1234567890
fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment