过户管理 报废管理

dev
xiepeng 2024-03-14 09:04:40 +08:00
parent 5ef28f2aa2
commit d21ddeeb85
10 changed files with 768 additions and 1 deletions

View File

@ -118,6 +118,7 @@ public class AssignedManageController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd = assignedManageService.findById(pd); pd = assignedManageService.findById(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);

View File

@ -5,6 +5,7 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno; import com.zcloud.logs.LogAnno;
import com.zcloud.service.freighttrailer.FreightTrailerService; import com.zcloud.service.freighttrailer.FreightTrailerService;
import com.zcloud.service.scrapManage.ScrapManageService;
import com.zcloud.service.system.ImgFilesService; import com.zcloud.service.system.ImgFilesService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +27,9 @@ public class FreighttTrailerController extends BaseController {
@Autowired @Autowired
private ImgFilesService imgfilesService; private ImgFilesService imgfilesService;
@Autowired
private ScrapManageService scrapManageService;
/** /**
* *
* *
@ -69,6 +73,30 @@ public class FreighttTrailerController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
if(Tools.notEmpty(pd.getString("FREIGHTTRAILER_ID"))) {
PageData findPageData = freightTrailerService.findById(pd);
PageData scrapAddData = new PageData();
scrapAddData.put("SCRAP_ID",this.get32UUID());
scrapAddData.put("RECORD_NUMBER", findPageData.get("NUM"));
scrapAddData.put("FRAMES_NUMBER", findPageData.get("VIN"));
scrapAddData.put("PLATE_NUMBER", findPageData.get("PLATE_NUMBER"));
scrapAddData.put("SCRAP_VEHICLEMODEL", "货运挂车");
scrapAddData.put("VEHICLEOWNER", findPageData.get("CAR_OWNERS"));
scrapAddData.put("CONTACT_NUMBER", findPageData.get("CONTACT_PHONE"));
scrapAddData.put("SCRAP_DATE", DateUtil.date2Str(new Date()));
scrapAddData.put("REGISTRANT", Jurisdiction.getUsername());
scrapAddData.put("CREATTIME", DateUtil.date2Str(new Date()));
scrapAddData.put("OPERATTIME", DateUtil.date2Str(new Date()));
scrapAddData.put("VEHICLEOWNER_NUMBER", findPageData.get("CAR_OWNERS_TEL"));
scrapAddData.put("FIRSTSHOW_DATE", findPageData.get("INITIAL_REGISTRATION_DATE"));
scrapAddData.put("BRAND", findPageData.get("TRAILER_BRAND"));
scrapAddData.put("VEHICLE_MODEL", findPageData.get("TRAILER_MODEL"));
scrapAddData.put("TRANSACTION_DATE", DateUtil.date2Str(new Date()));
scrapAddData.put("CORPINFO_ID", findPageData.get("CORPINFO_ID"));
scrapAddData.put("SCRAP_VEHICLE", findPageData.get("PLATE_NUMBER"));
scrapAddData.put("ISDELETE", "0");
scrapManageService.save(scrapAddData);
}
pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id
pd.put("DELETEORNAME", Jurisdiction.getUsername()); //删除人 pd.put("DELETEORNAME", Jurisdiction.getUsername()); //删除人
pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间 pd.put("DELETTIME", DateUtil.date2Str(new Date())); //删除时间

View File

@ -5,6 +5,7 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno; import com.zcloud.logs.LogAnno;
import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.operatingvehicles.OperatingVehiclesService;
import com.zcloud.service.scrapManage.ScrapManageService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -28,6 +29,9 @@ public class OperatingVehiclesController extends BaseController {
@Autowired @Autowired
private Smb smb; private Smb smb;
@Autowired
private ScrapManageService scrapManageService;
/** /**
* @param * @param
* @throws Exception * @throws Exception
@ -99,6 +103,31 @@ public class OperatingVehiclesController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
if(Tools.notEmpty(pd.getString("OPERATING_ID"))) {
PageData findPageData = operatingVehiclesService.findById(pd);
PageData scrapAddData = new PageData();
scrapAddData.put("SCRAP_ID",this.get32UUID());
scrapAddData.put("RECORD_NUMBER", findPageData.get("GOODSSELFNUMBER"));
scrapAddData.put("FRAMES_NUMBER", findPageData.get("FRAMES_NUMBER"));
scrapAddData.put("PLATE_NUMBER", findPageData.get("PLATE_NUMBER"));
scrapAddData.put("SCRAP_VEHICLEMODEL", "运输车辆");
scrapAddData.put("VEHICLEOWNER", findPageData.get("VEHICLEOWNER"));
scrapAddData.put("CONTACT_NUMBER", findPageData.get("CONTACT_NUMBER"));
scrapAddData.put("SCRAP_DATE", DateUtil.date2Str(new Date()));
scrapAddData.put("REGISTRANT", Jurisdiction.getUsername());
scrapAddData.put("CREATTIME", DateUtil.date2Str(new Date()));
scrapAddData.put("OPERATTIME", DateUtil.date2Str(new Date()));
scrapAddData.put("VEHICLEOWNER_NUMBER", findPageData.get("VEHICLEOWNER_NUMBER"));
scrapAddData.put("FIRSTSHOW_DATE", findPageData.get("FIRSTSHOW_DATE"));
scrapAddData.put("BRAND", findPageData.get("VEHICLE_BRAND"));
scrapAddData.put("VEHICLE_MODEL", findPageData.get("VEHICLE_MODEL"));
scrapAddData.put("TRANSACTION_DATE", DateUtil.date2Str(new Date()));
scrapAddData.put("CORPINFO_ID", findPageData.get("CORPINFO_ID"));
scrapAddData.put("SCRAP_VEHICLE", findPageData.get("PLATE_NUMBER"));
scrapAddData.put("ISDELETE", "0");
scrapManageService.save(scrapAddData);
}
pd.put("DELETOR", Jurisdiction.getUSER_ID()); pd.put("DELETOR", Jurisdiction.getUSER_ID());
pd.put("DELETORNAME", Jurisdiction.getUsername()); pd.put("DELETORNAME", Jurisdiction.getUsername());
pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("DELETTIME", DateUtil.date2Str(new Date()));
@ -171,6 +200,7 @@ public class OperatingVehiclesController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd = operatingVehiclesService.findById(pd); pd = operatingVehiclesService.findById(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
@ -207,6 +237,20 @@ public class OperatingVehiclesController extends BaseController {
return map; return map;
} }
@RequestMapping(value = "/findById")
@ResponseBody
public Object findById() 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 = operatingVehiclesService.findById(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/*@RequestMapping(value = "/list") /*@RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public Object list(Page page) throws Exception { public Object list(Page page) throws Exception {

View File

@ -0,0 +1,169 @@
package com.zcloud.controller.scrapManage;
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.assignedManage.AssignedManageService;
import com.zcloud.service.freighttrailer.FreightTrailerService;
import com.zcloud.service.operatingvehicles.OperatingVehiclesService;
import com.zcloud.service.scrapManage.ScrapManageService;
import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/scrapmanage")
public class ScrapManageController extends BaseController {
@Autowired
private ScrapManageService scrapManageService;
@Autowired
private FreightTrailerService freightTrailerService;
@Autowired
private OperatingVehiclesService operatingVehiclesService;
@Autowired
private Smb smb;
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@ResponseBody
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("SCRAP_ID", this.get32UUID()); //车船税主键
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
scrapManageService.save(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/delete")
@ResponseBody
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("DELETOR", Jurisdiction.getUSER_ID());
pd.put("DELETORNAME", Jurisdiction.getUsername());
pd.put("DELETTIME", DateUtil.date2Str(new Date()));
scrapManageService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@ResponseBody
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("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
scrapManageService.edit(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/goEdit")
@ResponseBody
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 = scrapManageService.findById(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
@RequestMapping(value="/list")
@ResponseBody
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();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = scrapManageService.list(page); //列出MajorDangerSource列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/freightVehicleList")
@ResponseBody
public Object freightVehicleList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> freightlist = freightTrailerService.trailerList(corpId); //货运挂车列表
map.put("list", freightlist);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/operationVehicleList")
@ResponseBody
public Object operationVehicleList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> freightlist = operatingVehiclesService.operationVehicleList(corpId); //货运挂车列表
map.put("list", freightlist);
map.put("result", errInfo);
return map;
}
}

View File

@ -0,0 +1,35 @@
package com.zcloud.mapper.datasource.scrapManage;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
public interface ScrapManageMapper{
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
List<PageData> datalistPage(Page page);
}

View File

@ -0,0 +1,35 @@
package com.zcloud.service.scrapManage;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
public interface ScrapManageService {
/**
* @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;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
public List<PageData> list(Page page);
}

View File

@ -0,0 +1,46 @@
package com.zcloud.service.scrapManage.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.assignedManage.AssignedManageMapper;
import com.zcloud.mapper.datasource.scrapManage.ScrapManageMapper;
import com.zcloud.service.assignedManage.AssignedManageService;
import com.zcloud.service.scrapManage.ScrapManageService;
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 ScrapManageServiceImpl implements ScrapManageService {
@Autowired
private ScrapManageMapper scrapManageMapper;
@Override
public void save(PageData pd) throws Exception {
scrapManageMapper.save(pd);
}
@Override
public void delete(PageData pd) throws Exception {
scrapManageMapper.delete(pd);
}
@Override
public void edit(PageData pd) throws Exception {
scrapManageMapper.edit(pd);
}
@Override
public PageData findById(PageData pd) throws Exception {
return scrapManageMapper.findById(pd);
}
@Override
public List<PageData> list(Page page) {
return scrapManageMapper.datalistPage(page);
}
}

View File

@ -242,6 +242,10 @@
<include refid="tableName"></include> f <include refid="tableName"></include> f
where where
f.ASSIGNED_ID = #{ASSIGNED_ID} f.ASSIGNED_ID = #{ASSIGNED_ID}
and
f.ISDELETE = '0'
and
f.CORPINFO_ID = #{CORPINFO_ID}
</select> </select>
<!-- 列表 --> <!-- 列表 -->

View File

@ -277,7 +277,9 @@
from from
<include refid="tableName"></include> f <include refid="tableName"></include> f
where where
f.OPERATING_ID = #{OPERATING_ID} f.OPERATING_ID = #{OPERATING_ID} AND
f.ISDELETE = '0' AND
f.CORPINFO_ID = #{CORPINFO_ID}
</select> </select>
<!-- 列表 --> <!-- 列表 -->

View File

@ -0,0 +1,403 @@
<?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.scrapManage.ScrapManageMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_SCRAP_MANAGEMENT
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.SCRAP_ID,
f.RECORD_NUMBER,
f.PLATE_NUMBER,
f.SCRAP_VEHICLEMODEL,
f.VEHICLEOWNER,
f.CONTACT_NUMBER,
f.SCRAP_DATE,
f.REGISTRANT,
f.CORPINFO_ID,
f.TRANSPORT_ENTERPRISES,
f.SCRAP_VEHICLE,
f.VEHICLEOWNER_NUMBER,
f.DRIVINGLICENSE_PHOTO,
f.FRAMES_NUMBER,
f.BRAND,
f.EMISSION_STANDARD,
f.POWER_TYPE,
f.FIRSTSHOW_DATE,
f.SCRAP_MATERIAL,
f.REMARK,
f.ENGINE_NUMBER,
f.VEHICLE_MODEL,
f.TRANSACTION_DATE,
f.ISDELETE,
f.CREATOR,
f.CREATORNAME,
f.CREATTIME,
f.OPERATOR,
f.OPERATORNAME,
f.OPERATTIME,
f.DELETOR,
f.DELETORNAME,
f.DELETTIME
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
SCRAP_ID,
RECORD_NUMBER,
PLATE_NUMBER,
SCRAP_VEHICLEMODEL,
VEHICLEOWNER,
CONTACT_NUMBER,
SCRAP_DATE,
REGISTRANT,
CORPINFO_ID,
TRANSPORT_ENTERPRISES,
SCRAP_VEHICLE,
VEHICLEOWNER_NUMBER,
DRIVINGLICENSE_PHOTO,
FRAMES_NUMBER,
BRAND,
EMISSION_STANDARD,
POWER_TYPE,
FIRSTSHOW_DATE,
SCRAP_MATERIAL,
REMARK,
ENGINE_NUMBER,
VEHICLE_MODEL,
TRANSACTION_DATE,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME,
OPERATOR,
OPERATORNAME,
OPERATTIME,
DELETOR,
DELETORNAME,
DELETTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{SCRAP_ID},
#{RECORD_NUMBER},
#{PLATE_NUMBER},
#{SCRAP_VEHICLEMODEL},
#{VEHICLEOWNER},
#{CONTACT_NUMBER},
#{SCRAP_DATE},
#{REGISTRANT},
#{CORPINFO_ID},
#{TRANSPORT_ENTERPRISES},
#{SCRAP_VEHICLE},
#{VEHICLEOWNER_NUMBER},
#{DRIVINGLICENSE_PHOTO},
#{FRAMES_NUMBER},
#{BRAND},
#{EMISSION_STANDARD},
#{POWER_TYPE},
#{FIRSTSHOW_DATE},
#{SCRAP_MATERIAL},
#{REMARK},
#{ENGINE_NUMBER},
#{VEHICLE_MODEL},
#{TRANSACTION_DAT},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME},
#{DELETOR},
#{DELETORNAME},
#{DELETTIME}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
SCRAP_ID = #{SCRAP_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
SCRAP_ID = #{SCRAP_ID},
RECORD_NUMBER = #{RECORD_NUMBER},
PLATE_NUMBER = #{PLATE_NUMBER},
SCRAP_VEHICLEMODEL = #{SCRAP_VEHICLEMODEL},
VEHICLEOWNER = #{VEHICLEOWNER},
CONTACT_NUMBER = #{CONTACT_NUMBER},
SCRAP_DATE = #{SCRAP_DATE},
REGISTRANT = #{REGISTRANT},
CORPINFO_ID = #{CORPINFO_ID},
TRANSPORT_ENTERPRISES = #{TRANSPORT_ENTERPRISES},
SCRAP_VEHICLE = #{SCRAP_VEHICLE},
VEHICLEOWNER_NUMBER = #{VEHICLEOWNER_NUMBER},
DRIVINGLICENSE_PHOTO = #{DRIVINGLICENSE_PHOTO},
FRAMES_NUMBER = #{FRAMES_NUMBER},
BRAND = #{BRAND},
EMISSION_STANDARD = #{EMISSION_STANDARD},
POWER_TYPE = #{POWER_TYPE},
FIRSTSHOW_DATE = #{FIRSTSHOW_DATE},
SCRAP_MATERIAL = #{SCRAP_MATERIAL},
REMARK = #{REMARK},
ENGINE_NUMBER = #{ENGINE_NUMBER},
VEHICLE_MODEL = #{VEHICLE_MODEL},
TRANSACTION_DATE = #{TRANSACTION_DATE},
ISDELETE = #{ISDELETE},
CREATOR = #{CREATOR},
CREATORNAME = #{CREATORNAME},
CREATTIME = #{CREATTIME},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME},
DELETOR = #{DELETOR},
DELETORNAME = #{DELETORNAME},
DELETTIME =#{DELETTIME},
where
SCRAP_ID = #{SCRAP_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.SCRAP_ID = #{SCRAP_ID} and
f.ISDELETE = '0' AND
f.CORPINFO_ID = #{CORPINFO_ID}
</select>
<!-- 列表 -->
<!--<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
left join sys_user u on u.USER_ID = f.USER_ID
left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID
left join sys_post p on p.POST_ID = u.POST_ID
left join sys_user ru on ru.USER_ID = f.REVIEW_USER_ID
left join oa_department rd on rd.DEPARTMENT_ID = ru.DEPARTMENT_ID
where (f.ISDELETE = '0' or (f.ISDELETE = '1' and f.REVIEW_STATUS = '-1'))
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">&lt;!&ndash; 关键词检索 &ndash;&gt;
and
(
u.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.REVIEW_STATUS != null and pd.REVIEW_STATUS != ''">&lt;!&ndash; 关键词检索 &ndash;&gt;
<choose>
<when test="pd.REVIEW_STATUS == 0">
and f.REVIEW_STATUS = '0'
</when>
<when test="pd.REVIEW_STATUS == 1">
and f.REVIEW_STATUS = '1'
</when>
<when test="pd.REVIEW_STATUS == 2">
and f.REVIEW_STATUS = '2'
</when>
<when test="pd.REVIEW_STATUS == -1">
and f.ISDELETE = '0' and f.REVIEW_STATUS = '-1'
</when>
<when test="pd.REVIEW_STATUS == 3">
and f.CREATOR = f.OPERATOR and f.ISDELETE = '1' and f.REVIEW_STATUS = '-1'
</when>
<when test="pd.REVIEW_STATUS == 4">
and f.CREATOR != f.OPERATOR and f.ISDELETE = '1' and f.REVIEW_STATUS = '-1'
</when>
</choose>
</if>
<if test="pd.REVIEW_USER_NAME != null and pd.REVIEW_USER_NAME != ''">&lt;!&ndash; 关键词检索 &ndash;&gt;
and ru.NAME LIKE CONCAT(CONCAT('%', #{pd.REVIEW_USER_NAME}),'%')
</if>
<if test="pd.DEPT_DOWN_ARR != null and pd.DEPT_DOWN_ARR.size() > 0">
AND d.DEPARTMENT_ID IN
<foreach item="item" collection="pd.DEPT_DOWN_ARR" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
&lt;!&ndash; <if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">关键词检索
and d.DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
</if>
&ndash;&gt;
<choose>
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</when>
<otherwise>
<choose>
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
<choose>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
((d.DEPARTMENT_ID in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
)) or (
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
))
</otherwise>
</choose>
</when>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
or f.REVIEW_USER_ID = #{pd.USER_ID}
and
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
d.DEPARTMENT_ID in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID})
or f.REVIEW_USER_ID = #{pd.USER_ID}
</otherwise>
</choose>
</when>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
d.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</otherwise>
</choose>
</when>
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
and d.DEPARTMENT_ID=#{pd.DEPARTMENT_ID}
and f.REVIEW_USER_ID = #{pd.USER_ID}
</when>
<otherwise>
</otherwise>
</choose>
</otherwise>
</choose>
<choose>
<when test="pd.STARTTIME != null and pd.STARTTIME != '' and pd.ENDTIME != null and pd.ENDTIME != ''">
and DATE_FORMAT(#{pd.STARTTIME},'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(f.STARTTIME,'%Y-%m-%d %H:%i:%s')
and DATE_FORMAT(#{pd.ENDTIME},'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(f.ENDTIME,'%Y-%m-%d %H:%i:%s')
</when>
<otherwise>
<if test="pd.STARTTIME != null and pd.STARTTIME != ''">
and DATE_FORMAT(#{pd.STARTTIME},'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(f.ENDTIME,'%Y-%m-%d %H:%i:%s')
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and DATE_FORMAT(#{pd.ENDTIME},'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(f.STARTTIME,'%Y-%m-%d %H:%i:%s')
</if>
</otherwise>
</choose>
order by f.OPERATTIME desc
</select>-->
<!-- 列表(全部) -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.SCRAP_VEHICLEMODEL != null and pd.SCRAP_VEHICLEMODEL != ''"><!-- 关键词检索 -->
and f.SCRAP_VEHICLEMODEL = #{pd.SCRAP_VEHICLEMODEL}
</if>
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''"><!-- 关键词检索 -->
and f.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.VEHICLEOWNER != null and pd.VEHICLEOWNER != ''"><!-- 关键词检索 -->
and f.VEHICLEOWNER LIKE CONCAT(CONCAT('%', #{pd.VEHICLEOWNER}),'%')
</if>
<if test="pd.REGISTRANT != null and pd.REGISTRANT != ''"><!-- 关键词检索 -->
and f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}),'%')
</if>
</select>
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.SCRAP_ID = '0'
</select>
</mapper>