forked from integrated_whb/integrated_whb
罐检项配置
parent
63dc4bb253
commit
d2932af28d
|
@ -62,7 +62,7 @@ public class ImgFilesController extends BaseController {
|
|||
// 保存文件
|
||||
File tempFile = new File(file.getOriginalFilename());
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
|
||||
if(!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("3") && !TYPE.equals("129")) {//四色图改为json文件,不用判断类型
|
||||
if(!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("3") && !TYPE.equals("129") && !TYPE.equals("130")) {//四色图改为json文件,不用判断类型
|
||||
map.put("result", "failed");
|
||||
map.put("exception", "上传图片格式不正确,请重新上传");
|
||||
return map;
|
||||
|
|
|
@ -0,0 +1,175 @@
|
|||
package com.zcloud.controller.tankTruckInspection;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.tankTruckInspection.TankTruckInspectionService;
|
||||
import com.zcloud.util.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 罐检项配置
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tankTruckInspection")
|
||||
public class TankTruckInspectionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TankTruckInspectionService tankTruckInspectionService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
// @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "新增")
|
||||
public Object add() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("TANKTRUCKINSPECTION_ID", this.get32UUID()); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
|
||||
pd.put("CREATORNAME", Jurisdiction.getName()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
tankTruckInspectionService.save(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
// @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "删除")
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id
|
||||
pd.put("DELETEORNAME", Jurisdiction.getName()); //删除人
|
||||
pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间
|
||||
tankTruckInspectionService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
// @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "修改")
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
|
||||
pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
tankTruckInspectionService.edit(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表分页
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
// @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = tankTruckInspectionService.list(page); //列出Question列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
// @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd = tankTruckInspectionService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表无分页
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/tankTruckInspectionListAll")
|
||||
// @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项配置", instructionsOperate = "罐检项配置", instructionsType = "列表")
|
||||
public Object tankTruckInspectionListAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> list = tankTruckInspectionService.tankTruckInspectionListAll(pd); //列出Question列表
|
||||
map.put("list", list);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,216 @@
|
|||
package com.zcloud.controller.tankTruckInspection;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.logs.LogAnno;
|
||||
import com.zcloud.service.system.ImgFilesService;
|
||||
import com.zcloud.service.tankTruckInspection.TankTruckInspectionRecordService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 罐检项检查
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tankTruckInspectionRecord")
|
||||
public class TankTruckInspectionRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TankTruckInspectionRecordService tankTruckInspectionRecordService;
|
||||
@Autowired
|
||||
private ImgFilesService imgfilesService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
// @RequiresPermissions( value = {"question:add" , "courseware:add"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "新增")
|
||||
public Object add() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String TANKTRUCKINSPECTIONRECORD_ID = this.get32UUID();
|
||||
pd.put("TANKTRUCKINSPECTIONRECORD_ID", TANKTRUCKINSPECTIONRECORD_ID); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
|
||||
pd.put("CREATORNAME", Jurisdiction.getName()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
tankTruckInspectionRecordService.save(pd);
|
||||
if (pd.get("DETAILS") != null && !pd.get("DETAILS").equals("")) {
|
||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("DETAILS").toString());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject json = list.get(i);
|
||||
PageData itme = new PageData();
|
||||
itme.put("RECORDDETAIL_ID", this.get32UUID()); //主键
|
||||
itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
itme.put("MAIN_ID", TANKTRUCKINSPECTIONRECORD_ID);
|
||||
itme.put("INSPECTION_SITE", json.get("INSPECTION_SITE"));
|
||||
itme.put("REGULATORY_STATUS", json.get("REGULATORY_STATUS"));
|
||||
itme.put("INSPECTION_STATUS", json.get("INSPECTION_STATUS"));
|
||||
itme.put("DATA_SORT", i);
|
||||
itme.put("ISDELETE", 0);
|
||||
itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id
|
||||
itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人
|
||||
itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
tankTruckInspectionRecordService.saveDetail(itme);
|
||||
}
|
||||
}
|
||||
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
// @RequiresPermissions( value = {"question:del" , "courseware:del"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "删除")
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id
|
||||
pd.put("DELETEORNAME", Jurisdiction.getName()); //删除人
|
||||
pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间
|
||||
tankTruckInspectionRecordService.delete(pd);
|
||||
tankTruckInspectionRecordService.deleteDetail(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
// @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "修改")
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
|
||||
pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
tankTruckInspectionRecordService.edit(pd);
|
||||
if (pd.get("DETAILS") != null && !pd.get("DETAILS").equals("")) {
|
||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("DETAILS").toString());
|
||||
tankTruckInspectionRecordService.deleteDetail(pd);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject json = list.get(i);
|
||||
PageData itme = new PageData();
|
||||
itme.put("RECORDDETAIL_ID", this.get32UUID()); //主键
|
||||
itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
itme.put("MAIN_ID", pd.get("TANKTRUCKINSPECTIONRECORD_ID"));
|
||||
itme.put("INSPECTION_SITE", json.get("INSPECTION_SITE"));
|
||||
itme.put("REGULATORY_STATUS", json.get("REGULATORY_STATUS"));
|
||||
itme.put("INSPECTION_STATUS", json.get("INSPECTION_STATUS"));
|
||||
itme.put("DATA_SORT", i);
|
||||
itme.put("ISDELETE", 0);
|
||||
itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id
|
||||
itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人
|
||||
itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间
|
||||
tankTruckInspectionRecordService.saveDetail(itme);
|
||||
}
|
||||
}
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表分页
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
// @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "列表")
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = tankTruckInspectionRecordService.list(page); //列出Question列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
// @RequiresPermissions( value = {"question:edit" , "courseware:edit"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
@LogAnno(menuType = "基础信息管理", menuServer = "罐检项检查", instructionsOperate = "罐检项检查", instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd = tankTruckInspectionRecordService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
List<PageData> pd2 = tankTruckInspectionRecordService.findById2(pd);
|
||||
map.put("detail", pd2);
|
||||
|
||||
pd.put("FOREIGN_KEY", pd.getString("TANKTRUCKINSPECTIONRECORD_ID"));
|
||||
pd.put("TYPE", 130);
|
||||
List<PageData> inspectionAttachmentImgs = imgfilesService.listAll(pd);//检查附件
|
||||
pd.put("TYPE", 131);
|
||||
List<PageData> inspectionImgs = imgfilesService.listAll(pd);//检查图片
|
||||
|
||||
map.put("inspectionAttachmentImgs", inspectionAttachmentImgs);
|
||||
map.put("inspectionImgs", inspectionImgs);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.mapper.datasource.tankTruckInspection;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项配置
|
||||
*/
|
||||
public interface TankTruckInspectionMapper {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
void saveAll(PageData pd);
|
||||
|
||||
void saveAllDel(PageData pd);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
void edit2(PageData pd);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
List<PageData> datalistPage2(Page page);
|
||||
|
||||
PageData findById(PageData pd);
|
||||
|
||||
PageData findById2(PageData pd);
|
||||
|
||||
List<PageData> tankTruckInspectionListAll(PageData pd);
|
||||
|
||||
List<PageData> tankTruckInspectionListAll2(PageData pd);
|
||||
|
||||
int dataCount(String corpId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.zcloud.mapper.datasource.tankTruckInspection;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项检查
|
||||
*/
|
||||
public interface TankTruckInspectionRecordMapper {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
void saveDetail(PageData pd);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
void deleteDetail(PageData pd);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
List<PageData> datalistPage2(Page page);
|
||||
|
||||
PageData findById(PageData pd);
|
||||
|
||||
List<PageData> findById2(PageData pd);
|
||||
|
||||
int dataCount(String corpId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.zcloud.service.tankTruckInspection;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项检查
|
||||
*/
|
||||
public interface TankTruckInspectionRecordService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception;
|
||||
|
||||
public void saveDetail(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception;
|
||||
|
||||
public void deleteDetail(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception;
|
||||
|
||||
public List<PageData> findById2(PageData pd) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.zcloud.service.tankTruckInspection;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项配置
|
||||
*/
|
||||
public interface TankTruckInspectionService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> tankTruckInspectionListAll(PageData pd) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.zcloud.service.tankTruckInspection.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionRecordMapper;
|
||||
import com.zcloud.service.tankTruckInspection.TankTruckInspectionRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项检查
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class TankTruckInspectionRecordServiceImpl implements TankTruckInspectionRecordService {
|
||||
|
||||
@Autowired
|
||||
private TankTruckInspectionRecordMapper tankTruckInspectionRecordMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
tankTruckInspectionRecordMapper.save(pd);
|
||||
}
|
||||
|
||||
public void saveDetail(PageData pd) throws Exception {
|
||||
tankTruckInspectionRecordMapper.saveDetail(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* e
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
tankTruckInspectionRecordMapper.delete(pd);
|
||||
}
|
||||
|
||||
public void deleteDetail(PageData pd) throws Exception {
|
||||
tankTruckInspectionRecordMapper.deleteDetail(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
tankTruckInspectionRecordMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
return tankTruckInspectionRecordMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception {
|
||||
return tankTruckInspectionRecordMapper.findById(pd);
|
||||
}
|
||||
|
||||
public List<PageData> findById2(PageData pd) throws Exception {
|
||||
return tankTruckInspectionRecordMapper.findById2(pd);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.zcloud.service.tankTruckInspection.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionMapper;
|
||||
import com.zcloud.service.tankTruckInspection.TankTruckInspectionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 罐检项配置
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class TankTruckInspectionServiceImpl implements TankTruckInspectionService {
|
||||
|
||||
@Autowired
|
||||
private TankTruckInspectionMapper tankTruckInspectionMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
tankTruckInspectionMapper.save(pd);
|
||||
} else {
|
||||
tankTruckInspectionMapper.saveAll(pd);
|
||||
tankTruckInspectionMapper.save(pd);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* e
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
tankTruckInspectionMapper.delete(pd);
|
||||
} else {
|
||||
tankTruckInspectionMapper.saveAllDel(pd);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
tankTruckInspectionMapper.edit(pd);
|
||||
} else {
|
||||
tankTruckInspectionMapper.edit2(pd);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(page.getPd().get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
return tankTruckInspectionMapper.datalistPage(page);
|
||||
} else {
|
||||
return tankTruckInspectionMapper.datalistPage2(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
return tankTruckInspectionMapper.findById(pd);
|
||||
} else {
|
||||
return tankTruckInspectionMapper.findById2(pd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> tankTruckInspectionListAll(PageData pd) throws Exception {
|
||||
int dataCount = tankTruckInspectionMapper.dataCount(pd.get("CORPINFO_ID").toString());
|
||||
if (dataCount > 0) {
|
||||
return tankTruckInspectionMapper.tankTruckInspectionListAll(pd);
|
||||
} else {
|
||||
return tankTruckInspectionMapper.tankTruckInspectionListAll2(pd);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
bus_traffic_tank_truck_inspection_corp
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.FREIGHTTRAILER_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.NUM,
|
||||
f.PLATE_NUMBER,
|
||||
f.VIN,
|
||||
f.VEHICLE_BODY_NUMBER,
|
||||
f.TRAILER_TYPE,
|
||||
f.OPER_CERTIFICATE_NUM,
|
||||
f.BELONGING_DEPT,
|
||||
f.CAR_OWNERS,
|
||||
f.CAR_OWNERS_TEL,
|
||||
f.CONTACTS,
|
||||
f.CONTACT_PHONE,
|
||||
f.INITIAL_REGISTRATION_DATE,
|
||||
f.CERTIFICATE_DATE,
|
||||
f.DUE_DATE,
|
||||
f.TRAILER_BRAND,
|
||||
f.TRAILER_MODEL,
|
||||
f.APPROVED_TOTAL_MASS,
|
||||
f.APPROVED_LOAD_CAPACITY,
|
||||
f.VOLUME,
|
||||
f.NOTES,
|
||||
f.TRAILER_IMG,
|
||||
f.DRIVING_LICENSE_IMG,
|
||||
f.OPER_CERTIFICATE_IMG,
|
||||
f.TRAILER_INFO,
|
||||
f.CREATOR,
|
||||
f.CREATORNAME,
|
||||
f.CREATTIME,
|
||||
f.ISDELETE,
|
||||
f.ISSCRAP,
|
||||
f.ISASSIGNED
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field2">
|
||||
TANKTRUCKINSPECTION_ID,
|
||||
CORPINFO_ID,
|
||||
INSPECTION_SITE,
|
||||
REGULATORY_STATUS,
|
||||
CREATOR,
|
||||
CREATORNAME,
|
||||
CREATTIME,
|
||||
ISDELETE
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{TANKTRUCKINSPECTION_ID},
|
||||
#{CORPINFO_ID},
|
||||
#{INSPECTION_SITE},
|
||||
#{REGULATORY_STATUS},
|
||||
#{CREATOR},
|
||||
#{CREATORNAME},
|
||||
#{CREATTIME},
|
||||
#{ISDELETE}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
<insert id="saveAll" parameterType="pd">
|
||||
INSERT INTO
|
||||
bus_traffic_tank_truck_inspection_corp
|
||||
(TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME)
|
||||
SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0,
|
||||
#{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection
|
||||
</insert>
|
||||
<insert id="saveAllDel" parameterType="pd">
|
||||
INSERT INTO
|
||||
bus_traffic_tank_truck_inspection_corp
|
||||
(TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME)
|
||||
SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0,
|
||||
#{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID != #{TANKTRUCKINSPECTION_ID}
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1',
|
||||
DELETEOR = #{DELETEOR},
|
||||
DELETEORNAME = #{DELETEORNAME},
|
||||
DELETTIME = #{DELETTIME}
|
||||
where
|
||||
TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID}
|
||||
AND
|
||||
CORPINFO_ID = #{CORPINFO_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
INSPECTION_SITE = #{INSPECTION_SITE},
|
||||
REGULATORY_STATUS = #{REGULATORY_STATUS},
|
||||
OPERATOR = #{OPERATOR},
|
||||
OPERATORNAME = #{OPERATORNAME},
|
||||
OPERATTIME = #{OPERATTIME}
|
||||
where
|
||||
TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID}
|
||||
</update>
|
||||
<update id="edit2" parameterType="pd">
|
||||
INSERT INTO
|
||||
bus_traffic_tank_truck_inspection_corp
|
||||
(TANKTRUCKINSPECTION_ID,CORPINFO_ID,INSPECTION_SITE,REGULATORY_STATUS,ISDELETE,CREATOR,CREATORNAME,CREATTIME)
|
||||
SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},INSPECTION_SITE,REGULATORY_STATUS,0,
|
||||
#{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID != #{TANKTRUCKINSPECTION_ID}
|
||||
union all
|
||||
SELECT REPLACE(UUID(),'-',''),#{CORPINFO_ID},#{INSPECTION_SITE},#{REGULATORY_STATUS},0,
|
||||
#{CREATOR},#{CREATORNAME},NOW() from bus_traffic_tank_truck_inspection where TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
f.TANKTRUCKINSPECTION_ID,
|
||||
f.INSPECTION_SITE,
|
||||
f.REGULATORY_STATUS
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID}
|
||||
</select>
|
||||
<select id="findById2" parameterType="pd" resultType="pd">
|
||||
select
|
||||
f.TANKTRUCKINSPECTION_ID,
|
||||
f.INSPECTION_SITE,
|
||||
f.REGULATORY_STATUS
|
||||
from
|
||||
bus_traffic_tank_truck_inspection f
|
||||
where
|
||||
f.TANKTRUCKINSPECTION_ID = #{TANKTRUCKINSPECTION_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表
|
||||
INSPECTION_SITE 检查部位
|
||||
REGULATORY_STATUS 规定状态
|
||||
-->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
<if test="pd.INSPECTION_SITE != null and pd.INSPECTION_SITE != ''">
|
||||
and f.INSPECTION_SITE LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_SITE}),'%')
|
||||
</if>
|
||||
<if test="pd.REGULATORY_STATUS != null and pd.REGULATORY_STATUS != ''">
|
||||
and f.REGULATORY_STATUS LIKE CONCAT(CONCAT('%', #{pd.REGULATORY_STATUS}),'%')
|
||||
</if>
|
||||
order by f.CREATTIME desc
|
||||
</select>
|
||||
<select id="datalistPage2" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*
|
||||
from
|
||||
bus_traffic_tank_truck_inspection f
|
||||
<where>
|
||||
<if test="pd.INSPECTION_SITE != null and pd.INSPECTION_SITE != ''">
|
||||
and f.INSPECTION_SITE LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_SITE}),'%')
|
||||
</if>
|
||||
<if test="pd.REGULATORY_STATUS != null and pd.REGULATORY_STATUS != ''">
|
||||
and f.REGULATORY_STATUS LIKE CONCAT(CONCAT('%', #{pd.REGULATORY_STATUS}),'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="tankTruckInspectionListAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
*
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
<if test="INSPECTION_SITE != null and INSPECTION_SITE != ''">
|
||||
and f.INSPECTION_SITE LIKE CONCAT(CONCAT('%', #{INSPECTION_SITE}),'%')
|
||||
</if>
|
||||
<if test="REGULATORY_STATUS != null and REGULATORY_STATUS != ''">
|
||||
and f.REGULATORY_STATUS LIKE CONCAT(CONCAT('%', #{REGULATORY_STATUS}),'%')
|
||||
</if>
|
||||
order by f.CREATTIME desc
|
||||
</select>
|
||||
|
||||
<select id="tankTruckInspectionListAll2" parameterType="page" resultType="pd">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
bus_traffic_tank_truck_inspection
|
||||
<where>
|
||||
<if test="INSPECTION_SITE != null and INSPECTION_SITE != ''">
|
||||
and INSPECTION_SITE LIKE CONCAT(CONCAT('%', #{INSPECTION_SITE}),'%')
|
||||
</if>
|
||||
<if test="REGULATORY_STATUS != null and REGULATORY_STATUS != ''">
|
||||
and REGULATORY_STATUS LIKE CONCAT(CONCAT('%', #{REGULATORY_STATUS}),'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="dataCount" parameterType="page" resultType="integer">
|
||||
select
|
||||
count(*) num
|
||||
from
|
||||
bus_traffic_tank_truck_inspection_corp f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{corpId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,262 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.tankTruckInspection.TankTruckInspectionRecordMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
bus_traffic_tank_truck_inspection_record
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.FREIGHTTRAILER_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.NUM,
|
||||
f.PLATE_NUMBER,
|
||||
f.VIN,
|
||||
f.VEHICLE_BODY_NUMBER,
|
||||
f.TRAILER_TYPE,
|
||||
f.OPER_CERTIFICATE_NUM,
|
||||
f.BELONGING_DEPT,
|
||||
f.CAR_OWNERS,
|
||||
f.CAR_OWNERS_TEL,
|
||||
f.CONTACTS,
|
||||
f.CONTACT_PHONE,
|
||||
f.INITIAL_REGISTRATION_DATE,
|
||||
f.CERTIFICATE_DATE,
|
||||
f.DUE_DATE,
|
||||
f.TRAILER_BRAND,
|
||||
f.TRAILER_MODEL,
|
||||
f.APPROVED_TOTAL_MASS,
|
||||
f.APPROVED_LOAD_CAPACITY,
|
||||
f.VOLUME,
|
||||
f.NOTES,
|
||||
f.TRAILER_IMG,
|
||||
f.DRIVING_LICENSE_IMG,
|
||||
f.OPER_CERTIFICATE_IMG,
|
||||
f.TRAILER_INFO,
|
||||
f.CREATOR,
|
||||
f.CREATORNAME,
|
||||
f.CREATTIME,
|
||||
f.ISDELETE,
|
||||
f.ISSCRAP,
|
||||
f.ISASSIGNED
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field2">
|
||||
TANKTRUCKINSPECTIONRECORD_ID,
|
||||
CORPINFO_ID,
|
||||
VEHICLE,
|
||||
INSPECTION_DATE,
|
||||
INSPECTIONTOR,
|
||||
DUE_DATE,
|
||||
INSPECTION_CYCLE,
|
||||
REMINDER_DAYS,
|
||||
REMINDER_DATE,
|
||||
REMINDER_STATUS,
|
||||
INSPECTION_ATTACHMENT,
|
||||
INSPECTION_IMG,
|
||||
NOTES,
|
||||
CREATOR,
|
||||
CREATORNAME,
|
||||
CREATTIME,
|
||||
ISDELETE
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{TANKTRUCKINSPECTIONRECORD_ID},
|
||||
#{CORPINFO_ID},
|
||||
#{VEHICLE},
|
||||
#{INSPECTION_DATE},
|
||||
#{INSPECTIONTOR},
|
||||
#{DUE_DATE},
|
||||
#{INSPECTION_CYCLE},
|
||||
#{REMINDER_DAYS},
|
||||
#{REMINDER_DATE},
|
||||
#{REMINDER_STATUS},
|
||||
#{INSPECTION_ATTACHMENT},
|
||||
#{INSPECTION_IMG},
|
||||
#{NOTES},
|
||||
#{CREATOR},
|
||||
#{CREATORNAME},
|
||||
#{CREATTIME},
|
||||
#{ISDELETE}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
<insert id="saveDetail" parameterType="pd">
|
||||
insert into
|
||||
bus_traffic_tank_truck_inspection_record_detail
|
||||
(
|
||||
RECORDDETAIL_ID,
|
||||
CORPINFO_ID,
|
||||
MAIN_ID,
|
||||
INSPECTION_SITE,
|
||||
REGULATORY_STATUS,
|
||||
INSPECTION_STATUS,
|
||||
DATA_SORT,
|
||||
ISDELETE,
|
||||
CREATOR,
|
||||
CREATORNAME,
|
||||
CREATTIME
|
||||
) values (
|
||||
#{RECORDDETAIL_ID},
|
||||
#{CORPINFO_ID},
|
||||
#{MAIN_ID},
|
||||
#{INSPECTION_SITE},
|
||||
#{REGULATORY_STATUS},
|
||||
#{INSPECTION_STATUS},
|
||||
#{DATA_SORT},
|
||||
#{ISDELETE},
|
||||
#{CREATOR},
|
||||
#{CREATORNAME},
|
||||
#{CREATTIME}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1',
|
||||
DELETEOR = #{DELETEOR},
|
||||
DELETEORNAME = #{DELETEORNAME},
|
||||
DELETTIME = #{DELETTIME}
|
||||
where
|
||||
TANKTRUCKINSPECTIONRECORD_ID = #{TANKTRUCKINSPECTIONRECORD_ID}
|
||||
</delete>
|
||||
<delete id="deleteDetail" parameterType="pd">
|
||||
update
|
||||
bus_traffic_tank_truck_inspection_record_detail
|
||||
set
|
||||
ISDELETE = '1',
|
||||
DELETEOR = #{DELETEOR},
|
||||
DELETEORNAME = #{DELETEORNAME},
|
||||
DELETTIME = #{DELETTIME}
|
||||
where
|
||||
MAIN_ID = #{TANKTRUCKINSPECTIONRECORD_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
VEHICLE = #{VEHICLE},
|
||||
INSPECTION_DATE = #{INSPECTION_DATE},
|
||||
INSPECTIONTOR = #{INSPECTIONTOR},
|
||||
DUE_DATE = #{DUE_DATE},
|
||||
INSPECTION_CYCLE = #{INSPECTION_CYCLE},
|
||||
REMINDER_DAYS = #{REMINDER_DAYS},
|
||||
REMINDER_DATE = #{REMINDER_DATE},
|
||||
REMINDER_STATUS = #{REMINDER_STATUS},
|
||||
INSPECTION_ATTACHMENT = #{INSPECTION_ATTACHMENT},
|
||||
INSPECTION_IMG = #{INSPECTION_IMG},
|
||||
NOTES = #{NOTES},
|
||||
OPERATOR = #{OPERATOR},
|
||||
OPERATORNAME = #{OPERATORNAME},
|
||||
OPERATTIME = #{OPERATTIME}
|
||||
where
|
||||
TANKTRUCKINSPECTIONRECORD_ID = #{TANKTRUCKINSPECTIONRECORD_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
f.TANKTRUCKINSPECTIONRECORD_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.VEHICLE,
|
||||
f.INSPECTION_DATE,
|
||||
f.INSPECTIONTOR,
|
||||
f.DUE_DATE,
|
||||
f.INSPECTION_CYCLE,
|
||||
f.REMINDER_DAYS,
|
||||
f.REMINDER_DATE,
|
||||
f.REMINDER_STATUS,
|
||||
f.INSPECTION_ATTACHMENT,
|
||||
f.INSPECTION_IMG,
|
||||
f.NOTES,
|
||||
(SELECT PLATE_NUMBER FROM `v_traffic` where ID = f.VEHICLE) VEHICLE_NAME,
|
||||
(select GROUP_CONCAT(NAME SEPARATOR ',') from sys_user where FIND_IN_SET(USER_ID,f.INSPECTIONTOR)) INSPECTIONTOR_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.TANKTRUCKINSPECTIONRECORD_ID = #{TANKTRUCKINSPECTIONRECORD_ID}
|
||||
</select>
|
||||
<select id="findById2" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.RECORDDETAIL_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.MAIN_ID,
|
||||
f.INSPECTION_SITE,
|
||||
f.REGULATORY_STATUS,
|
||||
f.INSPECTION_STATUS
|
||||
from
|
||||
bus_traffic_tank_truck_inspection_record_detail f
|
||||
where
|
||||
f.MAIN_ID = #{TANKTRUCKINSPECTIONRECORD_ID}
|
||||
and f.ISDELETE = '0'
|
||||
order by DATA_SORT
|
||||
</select>
|
||||
|
||||
<!-- 列表
|
||||
INSPECTION_SITE 检查部位
|
||||
REGULATORY_STATUS 规定状态
|
||||
-->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*,
|
||||
(SELECT PLATE_NUMBER FROM `v_traffic` where ID = f.VEHICLE) VEHICLE_NAME,
|
||||
(select GROUP_CONCAT(NAME SEPARATOR ',') from sys_user where FIND_IN_SET(USER_ID,f.INSPECTIONTOR)) INSPECTIONTOR_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
<if test="pd.VEHICLE != null and pd.VEHICLE != ''">
|
||||
and f.VEHICLE LIKE CONCAT(CONCAT('%', #{pd.VEHICLE}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTIONTOR != null and pd.INSPECTIONTOR != ''">
|
||||
and f.INSPECTIONTOR LIKE CONCAT(CONCAT('%', #{pd.INSPECTIONTOR}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_DATE != null and pd.INSPECTION_DATE != ''">
|
||||
and f.INSPECTION_DATE = #{pd.INSPECTION_DATE}
|
||||
</if>
|
||||
order by f.CREATTIME desc
|
||||
</select>
|
||||
<select id="datalistPage2" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*
|
||||
from
|
||||
bus_traffic_tank_truck_inspection f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
<if test="pd.INSPECTION_SITE != null and pd.INSPECTION_SITE != ''">
|
||||
and f.INSPECTION_SITE LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_SITE}),'%')
|
||||
</if>
|
||||
<if test="pd.REGULATORY_STATUS != null and pd.REGULATORY_STATUS != ''">
|
||||
and f.REGULATORY_STATUS LIKE CONCAT(CONCAT('%', #{pd.REGULATORY_STATUS}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="dataCount" parameterType="page" resultType="integer">
|
||||
select
|
||||
count(*) num
|
||||
from
|
||||
bus_traffic_tank_truck_inspection_corp f
|
||||
where f.ISDELETE = '0' and f.CORPINFO_ID = #{corpId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue