Commit 56f766fe authored by qinhu's avatar qinhu

1

parent 8d1caa3b
......@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -60,8 +61,7 @@ public class ChinastdController {
Page<Chinastd> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
QueryWrapper<Chinastd> qw = new QueryWrapper<>();
qw.lambda()
.or(arg -> arg.eq(Chinastd::getInuse, 1).eq(Chinastd::getStatus, "废止"));
qw.lambda().eq(Chinastd::getInuse, 1);
return BaseResponse.okData(iChinastdService.page(page, qw));
}
......@@ -82,28 +82,25 @@ public class ChinastdController {
return BaseResponse.okData(iChinastdService.page(page));
}
@PostMapping("/{id}")
@PostMapping("/activate")
@ApiOperation("更新记录(勾选)")
@Transactional(rollbackFor = Exception.class)
public BaseResponse<Boolean> update(@PathVariable("id") Long id) {
Chinastd chinastd = iChinastdService.getById(id);
if (chinastd == null) {
public BaseResponse<Boolean> update(String code) {
if (!StringUtils.hasText(code)) {
return BaseResponse.okData(false);
}
//获取前缀
String code = chinastd.getCode().split("-")[0];
String codeStr = code.split("-")[0];
QueryWrapper<Chinastd> qw = new QueryWrapper<>();
qw.lambda().like(Chinastd::getCode, code);
qw.lambda().like(Chinastd::getCode, codeStr);
List<Chinastd> list = iChinastdService.list(qw);
list.forEach(arg -> {
if (arg.getId().intValue() == id) {
if (arg.getCode().equals(code)) {
arg.setInuse(true);
} else {
arg.setInuse(false);
}
});
return BaseResponse.okData(iChinastdService.updateBatchById(list));
}
......
......@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.HashSet;
......@@ -102,11 +103,12 @@ public class ReportController {
@PostMapping("/{entrustId}")
@ApiOperation("导出报告封面和首页")
public void getReportDetail(@PathVariable("entrustId") Integer entrustId,
HttpServletResponse response) {
HttpServletResponse response) throws IOException {
//首页及封面导出
ReportDetailVo rts = iEntrustService.getReportDetail(entrustId);
if (rts == null) {
response.getWriter().write("需要的数据不全!");
return;
}
Map<String, Object> beanParams = new HashMap<>(10);
......
......@@ -40,9 +40,9 @@ public class WeiXinController {
log.debug("=============================================");
try {
//测试服务器
// return weiXinService.getTestToken(code);
return weiXinService.getTestToken(code);
//正式服务器
return weiXinService.getToken(code, "APP");
// return weiXinService.getToken(code, "APP");
} catch (Exception e) {
log.debug("获取登录token{}", e);
}
......
......@@ -3,6 +3,7 @@ package cn.wise.sc.cement.business.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -23,12 +24,11 @@ public class Chinastd implements Serializable {
private static final long serialVersionUID=1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* 国标号
*/
private String code;
@TableId(type = IdType.INPUT)
private String code;
/**
* 名字
......
......@@ -55,6 +55,10 @@ public class WordUtil {
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);
......
server:
port: 7012
spring:
application: tianjin-cement
profiles:
active: dev
datasource:
# 192.168.110.85 admin!@#123
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_bangye?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
# agentId: 1000151
# agentIdPC: 1000150
# agentSecret: h4K-GL1y7pCADFZQ7m1tO1GOSa3zU4kGEItFknvwOAg
# agentSecretPC: 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.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,
m.name as methodName, m.standard as standard, m.number as number,
(
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 method m on m.id = t.method_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 ) 所在检测组,
m.name as 检测依据,
t.charge as 收费标准,
t.pro_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
left join method m on m.id = t.method_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,
m.name as methodName, m.number as number
FROM team t
left join method m on m.id = t.method_id
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,
m.name as methodName, m.standard as standard, m.number as number,
(
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 method m on m.id = t.method_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=192.168.110.85:22122
#fastdfs.tracker_servers=192.168.110.85:22122
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=cement-business
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=common-swagger
cn\wise\sc\cement\common\swagger\SwaggerConfig.class
cn\wise\sc\cement\common\swagger\PackageInfo.class
D:\JavaProject\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\SwaggerConfig.java
D:\JavaProject\tianjin-cement\cement-common\common-swagger\src\main\java\cn\wise\sc\cement\common\swagger\PackageInfo.java
#Created by Apache Maven 3.6.1
version=1.0-SNAPSHOT
groupId=cn.wise.sc.tjcement
artifactId=mybatis-generator
D:\JavaProject\tianjin-cement\mybatis-generator\src\main\java\cn\wise\sc\cement\mg\GeneratorApplication.java
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