交通提醒

dev
xiepeng 2024-04-02 17:41:20 +08:00
parent 9df5aa57b1
commit a05521088b
30 changed files with 1561 additions and 0 deletions

View File

@ -57,5 +57,11 @@ public interface NoticeManagementMapper {
*/
void deleteAll(String[] ArrayDATA_IDS);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listTrafficAll(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface CompassMapper {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,29 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface InspectAnnuallyMapper {
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface InsuranceMapper {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface MaintenanceMapper {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface OperationMapper {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.mapper.datasource.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface TaxationMapper {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,108 @@
package com.zcloud.scheduled.trafficRemind;
import com.zcloud.entity.PageData;
import com.zcloud.service.traffic.*;
import com.zcloud.service.notice.NoticeManagementService;
import com.zcloud.util.SendMessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Component
public class TrafficRemindScheduled {
@Autowired
private InspectAnnuallyService inspectAnnuallyService;
@Autowired
private InsuranceService insuranceService;
@Autowired
private MaintenanceService maintenanceService;
@Autowired
private OperationService operationService;
@Autowired
private CompassService compassService;
@Autowired
private TaxationService taxationService;
@Autowired
private SendMessageUtil sendMessageUtil;
@Autowired
private NoticeManagementService noticeManagementService;
//@Scheduled(cron ="0 0 8 * * ?") // 每天8点
@Scheduled(cron ="0/5 * * * * ?")
public void Scheduled(){
try {
System.out.println("============定时发送今日交通到期提醒==========");
PageData pd = new PageData();
pd.put("KEYWORDS", "TRAFFIC");
List<PageData> trafficNoticeAll = noticeManagementService.listTrafficAll(pd); // 获取所有的交通提醒
for (PageData notice : trafficNoticeAll) {
PageData noticeId = new PageData();
noticeId.put("NOTICE_MANAGEMENT_ID", notice.getString("NOTICE_MANAGEMENT_ID"));
PageData annuallyNotice = null;
try {
annuallyNotice = noticeManagementService.findById(noticeId); // 查询 当前的 交通通知
} catch (Exception e) {
throw new RuntimeException(e);
}
List<String> notifierId = Arrays.asList(annuallyNotice.getString("ADDRESSEE").split(",")); // 通过ADDRESS拆分 获取所有要推送的人
List<PageData> varList = new ArrayList<>();
if(annuallyNotice.getString("NOTICE_NAME").contains("年检")) {
varList = inspectAnnuallyService.getYestoday(pd);
} else if (annuallyNotice.getString("NOTICE_NAME").contains("保险")) {
varList = insuranceService.getYestoday(pd);
}else if(annuallyNotice.getString("NOTICE_NAME").contains("维保")) {
varList = maintenanceService.getYestoday(pd);
} else if (annuallyNotice.getString("NOTICE_NAME").contains("营运")) {
varList = operationService.getYestoday(pd);
} else if (annuallyNotice.getString("NOTICE_NAME").contains("北斗")) {
varList = compassService.getYestoday(pd);
} else if(annuallyNotice.getString("NOTICE_NAME").contains("车船税")){
varList = taxationService.getYestoday(pd);
}
if (varList != null && varList.size() > 0) {
for (String userId : notifierId) {
for (PageData h : varList) {
// 发送年检到期通知
PageData mes = new PageData();
mes.put("RECEIVER_ID", userId);// 收信人 userid
mes.put("templateCode", annuallyNotice.getString("NOTICE_CODE"));// 通知模板编码
mes.put("CORPINFO_ID", h.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "plate_number");// 存入短信模板中的参数名称
params1.put("value", h.get("PLATE_NUMBER").toString());// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "vehicle_model");// 存入短信模板中的参数名称
params2.put("value", h.get("VEHICLEMODEL").toString());// 存入上面参数名称所传递的值
paramsList.add(params2);
try {
sendMessageUtil.sendTrafficNotice(mes, paramsList);
} catch (Exception e) {
}
}
}
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -57,5 +57,11 @@ public interface NoticeManagementService {
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listTrafficAll(PageData pd)throws Exception;
}

View File

@ -85,5 +85,10 @@ public class NoticeManagementServiceImpl implements NoticeManagementService {
noticemanagementMapper.deleteAll(ArrayDATA_IDS);
}
@Override
public List<PageData> listTrafficAll(PageData pd) throws Exception {
return noticemanagementMapper.listTrafficAll(pd);
}
}

View File

@ -0,0 +1,22 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface CompassService {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,29 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
public interface InspectAnnuallyService {
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface InsuranceService {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface MaintenanceService {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface OperationService {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,22 @@
package com.zcloud.service.traffic;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
public interface TaxationService {
/**
*
* @param pd
* @return
*/
List<PageData> getYestoday(PageData pd);
}

View File

@ -0,0 +1,37 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.CompassMapper;
import com.zcloud.mapper.datasource.traffic.OperationMapper;
import com.zcloud.service.traffic.CompassService;
import com.zcloud.service.traffic.OperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class CompassServiceImpl implements CompassService {
@Autowired
private CompassMapper compassMapper;
/**
*
* @param pd
* @return
*/
@Override
public List<PageData> getYestoday(PageData pd) {
return compassMapper.getYestoday(pd);
}
}

View File

@ -0,0 +1,47 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.InspectAnnuallyMapper;
import com.zcloud.service.traffic.InspectAnnuallyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class InspectAnnuallyServiceImpl implements InspectAnnuallyService {
@Autowired
private InspectAnnuallyMapper inspectAnnuallyMapper;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
inspectAnnuallyMapper.edit(pd);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return inspectAnnuallyMapper.listAll(pd);
}
@Override
public List<PageData> getYestoday(PageData pd) {
return inspectAnnuallyMapper.getYestoday(pd);
}
}

View File

@ -0,0 +1,37 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.InspectAnnuallyMapper;
import com.zcloud.mapper.datasource.traffic.InsuranceMapper;
import com.zcloud.service.traffic.InsuranceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class InsuranceServiceImpl implements InsuranceService {
@Autowired
private InsuranceMapper insuranceMapper;
/**
*
* @param pd
* @return
*/
@Override
public List<PageData> getYestoday(PageData pd) {
return insuranceMapper.getYestoday(pd);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.MaintenanceMapper;
import com.zcloud.mapper.datasource.traffic.OperationMapper;
import com.zcloud.service.traffic.MaintenanceService;
import com.zcloud.service.traffic.OperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class MaintenanceServiceImpl implements MaintenanceService {
@Autowired
private MaintenanceMapper maintenanceMapper;
/**
*
* @param pd
* @return
*/
@Override
public List<PageData> getYestoday(PageData pd) {
return maintenanceMapper.getYestoday(pd);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.InsuranceMapper;
import com.zcloud.mapper.datasource.traffic.OperationMapper;
import com.zcloud.service.traffic.InsuranceService;
import com.zcloud.service.traffic.OperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class OperationServiceImpl implements OperationService {
@Autowired
private OperationMapper operationMapper;
/**
*
* @param pd
* @return
*/
@Override
public List<PageData> getYestoday(PageData pd) {
return operationMapper.getYestoday(pd);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.traffic.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.traffic.OperationMapper;
import com.zcloud.mapper.datasource.traffic.TaxationMapper;
import com.zcloud.service.traffic.OperationService;
import com.zcloud.service.traffic.TaxationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-06-19
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class TaxationServiceImpl implements TaxationService {
@Autowired
private TaxationMapper taxationMapper;
/**
*
* @param pd
* @return
*/
@Override
public List<PageData> getYestoday(PageData pd) {
return taxationMapper.getYestoday(pd);
}
}

View File

@ -324,4 +324,45 @@ public class SendMessageUtil {
JSONObject jsonObject = JSONObject.parseObject(json);
return jsonObject.get("access_token").toString();
}
public void sendTrafficNotice(PageData pd, List<PageData> paramsList) throws Exception{
PageData nm = new PageData();
nm.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
nm.put("ISENABLE", "1");
nm.put("SMSCODE", pd.get("templateCode"));
List<PageData> nmList =noticemanagementService.listAll(nm);
if(nmList==null || nmList.size()==0){//未开启该提醒
return;
}
PageData template = new PageData();
template.put("TEMPLATE_CODE",pd.get("templateCode"));
template = this.noticeTemplateService.findByCode(template);
String content = template.getString("TEMPLATE_STR");
if(paramsList != null && paramsList.size() > 0) {
StringBuffer parStr = new StringBuffer();
for(PageData par: paramsList) {
content = content.replace(("${" + par.getString("name") + "}"),par.getString("value"));
}
}
PageData pd1 = new PageData();
pd1.put("NOTICECORP_ID", UuidUtil.get32UUID());
pd1.put("USERNAME","秦安双控");
pd1.put("CREATOR", "秦安双控"); //添加人
pd1.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd1.put("SYNOPSIS",template.getString("NAME"));
pd1.put("CONTENT","<p>"+content+"</p>");
pd1.put("ISALL","yes");
pd1.put("ISREPLY",0);
pd1.put("ISDELETE",0);
pd1.put("ISTOP",0);
pd1.put("STATUS",1);
pd1.put("CORP_INFO_ID",pd.getString("CORPINFO_ID"));
noticeCorpService.save(pd1);
pd1.put("NOTICECORPUSERID_ID",UuidUtil.get32UUID());
pd1.put("USER_ID",pd.getString("RECEIVER_ID"));
pd1.put("TYPE",0);
noticeCorpUserService.save(pd1);
}
}

View File

@ -175,4 +175,17 @@
</foreach>
</delete>
<!-- 列表(全部) -->
<select id="listTrafficAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="NOTICE_CODE != null and NOTICE_CODE != ''"><!-- 关键词检索 -->
and f.NOTICE_CODE LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
</if>
</select>
</mapper>

View File

@ -0,0 +1,122 @@
<?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.traffic.CompassMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_MECHANICAL_BEIDOU
</sql>
<!-- 字段 -->
<sql id="Field">
BEIDOU_ID,
CORPINFO_ID,
INDUSTRY_TYPE,
INDUSTRY_TYPE_TREE,
INDUSTRY_TYPE_NAMES,
OPER_CORP,
VEHICLE,
BASICINFO_LICENSE_PLATE,
BASICINFO_VIN,
BASICINFO_VEHICLETYPE,
BASICINFO_CAR_OWNERS,
BASICINFO_CARPHONE,
BASICINFO_INITIAL_REGISTRATION_DATE,
BASICINFO_PROVINCE,
BASICINFO_CITY,
BASICINFO_COUNTY,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
NETWORK_ACCESS_COMPANY,
PROCESSING_DATE,
DUE_DATE,
ACTUAL_COLLECTION,
ALL_FEES,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
BEIDOUINFO,
NOTES,
NUM,
CONTRACT,
CERTIFICATE,
TRANSPORTATIONCOMPANY,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME,
OPERATOR,
OPERATORNAME,
OPERATTIME,
DELETEOR,
DELETEORNAME,
DELETTIME
</sql>
<!-- 字段值定义 -->
<sql id="FieldValue">
#{BEIDOU_ID},
#{CORPINFO_ID},
#{INDUSTRY_TYPE},
#{INDUSTRY_TYPE_TREE},
#{INDUSTRY_TYPE_NAMES},
#{OPER_CORP},
#{VEHICLE},
#{BASICINFO_LICENSE_PLATE},
#{BASICINFO_VIN},
#{BASICINFO_VEHICLETYPE},
#{BASICINFO_CAR_OWNERS},
#{BASICINFO_CARPHONE},
#{BASICINFO_INITIAL_REGISTRATION_DATE},
#{BASICINFO_PROVINCE},
#{BASICINFO_CITY},
#{BASICINFO_COUNTY},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{NETWORK_ACCESS_COMPANY},
#{PROCESSING_DATE},
#{DUE_DATE},
#{ACTUAL_COLLECTION},
#{ALL_FEES},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{BEIDOUINFO},
#{NOTES},
#{NUM},
#{CONTRACT},
#{CERTIFICATE},
#{TRANSPORTATIONCOMPANY},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME},
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME}
</sql>
<select id="getYestoday" parameterType="pd" resultType="pd">
select
case when v1.TRAFFIC_TYPE = '1' then '营运车辆' else '货运挂车' end as VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0'
AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
AND f.DUE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0
AND f.REMINDER_STATUS = '1'
</select>
</mapper>

View File

@ -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.traffic.InspectAnnuallyMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_MECHANICAL_INSPECT_ANNUALLY
</sql>
<!-- 字段 -->
<sql id="Field">
INSPECTANNUALLY_ID,
CORPINFO_ID,
NUM,
VEHICLE_MODEL,
VEHICLE,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
PROCESSING_DATE,
ANNUAL_INSPECTION_CYCLE,
DUE_DATE,
INSPECTFEES,
ACTUAL_COLLECTION,
ADDRESS,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
INSPECTINFO,
NOTES,
ARCHIVES_TYPE,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{INSPECTANNUALLY_ID},
#{CORPINFO_ID},
#{NUM},
#{VEHICLE_MODEL},
#{VEHICLE},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{PROCESSING_DATE},
#{ANNUAL_INSPECTION_CYCLE},
#{DUE_DATE},
#{INSPECTFEES},
#{ACTUAL_COLLECTION},
#{ADDRESS},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{INSPECTINFO},
#{NOTES},
#{ARCHIVES_TYPE},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
DELETEOR = #{DELETEOR},
DELETEORNAME = #{DELETEORNAME},
DELETTIME = #{DELETTIME}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
NUM = #{NUM},
VEHICLE_MODEL = #{VEHICLE_MODEL},
VEHICLE = #{VEHICLE},
CAR_OWNERS = #{CAR_OWNERS},
TELEPHONE = #{TELEPHONE},
REGISTRANT = #{REGISTRANT},
PROCESSING_DATE = #{PROCESSING_DATE},
ANNUAL_INSPECTION_CYCLE = #{ANNUAL_INSPECTION_CYCLE},
DUE_DATE = #{DUE_DATE},
INSPECTFEES = #{INSPECTFEES},
ACTUAL_COLLECTION = #{ACTUAL_COLLECTION},
ADDRESS = #{ADDRESS},
REMINDER_DAYS = #{REMINDER_DAYS},
REMINDER_DATE = #{REMINDER_DATE},
REMINDER_STATUS = #{REMINDER_STATUS},
INSPECTINFO = #{INSPECTINFO},
NOTES = #{NOTES},
ARCHIVES_TYPE = #{ARCHIVES_TYPE},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</update>
<!-- 修改 -->
<update id="edit2" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="REMINDER_STATUS != null">
REMINDER_STATUS = #{REMINDER_STATUS},
</if>
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.INSPECTANNUALLY_ID,
f.CORPINFO_ID,
f.NUM,
f.VEHICLE_MODEL,
f.VEHICLE,
f.CAR_OWNERS,
f.TELEPHONE,
f.REGISTRANT,
f.PROCESSING_DATE,
f.ANNUAL_INSPECTION_CYCLE,
f.DUE_DATE,
f.INSPECTFEES,
f.ACTUAL_COLLECTION,
f.ADDRESS,
f.REMINDER_DAYS,
f.REMINDER_DATE,
f.REMINDER_STATUS,
f.INSPECTINFO,
f.NOTES,
f.ARCHIVES_TYPE,
f.ISDELETE,
f.CREATOR,
f.CREATORNAME,
f.CREATTIME,
(SELECT sd.NAME FROM sys_dictionaries sd where sd.DICTIONARIES_ID=f.ANNUAL_INSPECTION_CYCLE) as ANNUAL_INSPECTION_CYCLE_NAME,
v.COMPANY_AREA as AREA
from
<include refid="tableName"></include> f
left join v_traffic v on f.VEHICLE = v.ID
where
f.INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</select>
<!-- 列表
BASICINFO_LICENSE_PLATE 车牌号
CAR_OWNERS 车主业户
REGISTRANT 登记人
DUE_DATE 到期日期
VEHICLE_MODEL 营运车型
REMINDER_STATUS 提醒状态
-->
<select id="datalistPage" parameterType="page" resultType="pd">
select
b.NAME,
f.*,
case when f.DUE_DATE &lt; NOW() then 0 else 1 end as DUE_DATE_TYPE,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
left join sys_dictionaries b on f.ANNUAL_INSPECTION_CYCLE = b.DICTIONARIES_ID AND b.PARENT_ID = '8b7dea3977fd4360a3cc8112368b90ff'
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.CAR_OWNERS != null and pd.CAR_OWNERS != ''">
and f.CAR_OWNERS LIKE CONCAT(CONCAT('%', #{pd.CAR_OWNERS}),'%')
</if>
<if test="pd.REGISTRANT != null and pd.REGISTRANT != ''">
and f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}),'%')
</if>
<if test="pd.DUE_DATE != null and pd.DUE_DATE != ''">
and f.DUE_DATE = #{pd.DUE_DATE}
</if>
<if test="pd.VEHICLE_MODEL != null and pd.VEHICLE_MODEL != ''">
and f.VEHICLE_MODEL LIKE CONCAT(CONCAT('%', #{pd.VEHICLE_MODEL}),'%')
</if>
<if test="pd.REMINDER_STATUS != null and pd.REMINDER_STATUS != ''">
and f.REMINDER_STATUS = #{pd.REMINDER_STATUS}
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
and case when f.DUE_DATE &lt; NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE}
</if>
ORDER BY f.CREATTIME DESC
</select>
<select id="annuallyList" parameterType="page" resultType="pd">
select
*
from
<include refid="tableName"></include> f
where
f.ISDELETE = '0'
AND
f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<select id="listOut" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
and f.INSPECTANNUALLY_ID in
<foreach item="item" index="index" open="(" separator="," close=")" collection="ArrayDATA_IDS">
#{item}
</foreach>
</select>
<select id="getYestoday" parameterType="pd" resultType="pd">
select
b.NAME,
case when f.VEHICLE_MODEL = '1' then '营运车辆' else '货运挂车' end as VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
LEFT JOIN sys_dictionaries b on f.ANNUAL_INSPECTION_CYCLE = b.DICTIONARIES_ID AND b.PARENT_ID = '8b7dea3977fd4360a3cc8112368b90ff'
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0'
AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
AND f.DUE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0
AND f.REMINDER_STATUS = '1'
</select>
</mapper>

View File

@ -0,0 +1,87 @@
<?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.traffic.InsuranceMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_MECHANICAL_INSURE
</sql>
<!-- 字段 -->
<sql id="Field">
INSURE_ID,
CORPINFO_ID,
NUM,
VEHICLE_MODEL,
VEHICLE,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
INSURANCE_COMPANY,
INSURANCE_COVERAGE,
PROCESSING_DATE,
EFFECTIVE_DATE,
DUE_DATE,
ALL_FEES,
ACTUAL_COLLECTION,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
ATTACHMENT_UPLOAD,
INSUREINFO,
NOTES,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{INSURE_ID},
#{CORPINFO_ID},
#{NUM},
#{VEHICLE_MODEL},
#{VEHICLE},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{INSURANCE_COMPANY},
#{INSURANCE_COVERAGE},
#{PROCESSING_DATE},
#{EFFECTIVE_DATE},
#{DUE_DATE},
#{ALL_FEES},
#{ACTUAL_COLLECTION},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{ATTACHMENT_UPLOAD},
#{INSUREINFO},
#{NOTES},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME}
</sql>
<select id="getYestoday" parameterType="pd" resultType="pd">
select
case when f.VEHICLE_MODEL = '1' then '营运车辆' else '货运挂车' end as VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0'
AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
AND f.DUE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0
AND f.REMINDER_STATUS = '1'
</select>
</mapper>

View File

@ -0,0 +1,121 @@
<?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.traffic.MaintenanceMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_MECHANICAL_MAINTENANCE
</sql>
<!-- 字段 -->
<sql id="Field">
MAINTENANCE_ID,
CORPINFO_ID,
INDUSTRY_TYPE,
INDUSTRY_TYPE_TREE,
INDUSTRY_TYPE_NAMES,
OPER_CORP,
VEHICLE,
BASICINFO_LICENSE_PLATE,
BASICINFO_VIN,
BASICINFO_VEHICLETYPE,
BASICINFO_CAR_OWNERS,
BASICINFO_CARPHONE,
BASICINFO_INITIAL_REGISTRATION_DATE,
BASICINFO_PROVINCE,
BASICINFO_CITY,
BASICINFO_COUNTY,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
MAINTENANCE_LEVEL,
MAINTENANCE_CYCLE,
KILOMETERS,
PROCESSING_DATE,
DUE_DATE,
AGREEMENT_NUM,
MAINTENANCE_COMPANY,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
MAINTENANCEINFO,
NOTES,
NUM,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME,
OPERATOR,
OPERATORNAME,
OPERATTIME,
DELETEOR,
DELETEORNAME,
DELETTIME
</sql>
<!-- 字段值定义 -->
<sql id="FieldValue">
#{MAINTENANCE_ID},
#{CORPINFO_ID},
#{INDUSTRY_TYPE},
#{INDUSTRY_TYPE_TREE},
#{INDUSTRY_TYPE_NAMES},
#{OPER_CORP},
#{VEHICLE},
#{BASICINFO_LICENSE_PLATE},
#{BASICINFO_VIN},
#{BASICINFO_VEHICLETYPE},
#{BASICINFO_CAR_OWNERS},
#{BASICINFO_CARPHONE},
#{BASICINFO_INITIAL_REGISTRATION_DATE},
#{BASICINFO_PROVINCE},
#{BASICINFO_CITY},
#{BASICINFO_COUNTY},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{MAINTENANCE_LEVEL},
#{MAINTENANCE_CYCLE},
#{KILOMETERS},
#{PROCESSING_DATE},
#{DUE_DATE},
#{AGREEMENT_NUM},
#{MAINTENANCE_COMPANY},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{MAINTENANCEINFO},
#{NOTES},
#{NUM},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME},
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME}
</sql>
<select id="getYestoday" parameterType="pd" resultType="pd">
select
case when v1.TRAFFIC_TYPE = '1' then '营运车辆' else '货运挂车' end as VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0'
AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
AND f.DUE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0
AND f.REMINDER_STATUS = '1'
</select>
</mapper>

View File

@ -0,0 +1,115 @@
<?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.traffic.OperationMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_MECHANICAL_OPERATIONS
</sql>
<!-- 字段 -->
<sql id="Field">
OPERATIONS_ID,
CORPINFO_ID,
INDUSTRY_TYPE,
INDUSTRY_TYPE_TREE,
INDUSTRY_TYPE_NAMES,
OPER_CORP,
VEHICLE_MODEL,
VEHICLE,
BASICINFO_LICENSE_PLATE,
BASICINFO_VIN,
BASICINFO_VEHICLETYPE,
BASICINFO_CAR_OWNERS,
BASICINFO_CARPHONE,
BASICINFO_INITIAL_REGISTRATION_DATE,
BASICINFO_PROVINCE,
BASICINFO_CITY,
BASICINFO_COUNTY,
CAR_OWNERS,
TELEPHONE,
REGISTRANT,
PROCESSING_DATE,
CYCLE,
DUE_DATE,
REMINDER_DAYS,
REMINDER_DATE,
REMINDER_STATUS,
OPERATIONSINFO,
NOTES,
NUM,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME,
OPERATOR,
OPERATORNAME,
OPERATTIME,
DELETEOR,
DELETEORNAME,
DELETTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{OPERATIONS_ID},
#{CORPINFO_ID},
#{INDUSTRY_TYPE},
#{INDUSTRY_TYPE_TREE},
#{INDUSTRY_TYPE_NAMES},
#{OPER_CORP},
#{VEHICLE_MODEL},
#{VEHICLE},
#{BASICINFO_LICENSE_PLATE},
#{BASICINFO_VIN},
#{BASICINFO_VEHICLETYPE},
#{BASICINFO_CAR_OWNERS},
#{BASICINFO_CARPHONE},
#{BASICINFO_INITIAL_REGISTRATION_DATE},
#{BASICINFO_PROVINCE},
#{BASICINFO_CITY},
#{BASICINFO_COUNTY},
#{CAR_OWNERS},
#{TELEPHONE},
#{REGISTRANT},
#{PROCESSING_DATE},
#{CYCLE},
#{DUE_DATE},
#{REMINDER_DAYS},
#{REMINDER_DATE},
#{REMINDER_STATUS},
#{OPERATIONSINFO},
#{NOTES},
#{NUM},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME},
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME}
</sql>
<select id="getYestoday" parameterType="pd" resultType="pd">
select
case when f.VEHICLE_MODEL = '1' then '营运车辆' else '货运挂车' end as VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
from
<include refid="tableName"></include> f
INNER JOIN v_traffic v1 on f.VEHICLE = v1.ID
LEFT JOIN bus_traffic_operatingvehicle bto on bto.OPERATING_ID = f.VEHICLE
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf on btmf.FREIGHTTRAILER_ID = f.VEHICLE
where f.ISDELETE = '0'
AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0')
AND f.DUE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0
AND f.REMINDER_STATUS = '1'
</select>
</mapper>

View File

@ -0,0 +1,162 @@
<?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.traffic.TaxationMapper">
<!--表名 -->
<sql id="tableName">
BUS_TRAFFIC_TAXATION_MANAGE
</sql>
<!-- 字段 -->
<sql id="Field">
f.TAXATION_ID,
f.RECORD_NUMBER,
f.CORPINFO_ID,
f.PLATE_NUMBER,
f.VEHICLEOWNER,
f.CONTACT_NUMBER,
f.TRANSACTION_DATA,
f.TAXESDUES_PERIOD,
f.EXPIRE_DATE,
f.REGISTRANT,
f.TRANSPORT_ENTERPRISES,
f.REMINDER_STATUS,
f.EXPIRE_STATUS,
f.ARCHIVES_TYPE,
f.TRAILER_VEHICLE,
f.FRAMES_NUMBER,
f.VEHICLE_TYPE,
f.VEHICLEOWNER_NUMBER,
f.FIRSTSHOW_DATE,
f.PROVINCE,
f.CITY,
f.COUNTY,
f.REMINDER_DAY,
f.REMINDER_DATA,
f.TAXESDUES_MATERIAL,
f.REMARK,
f.REGISTER_NUMBER,
f.VEHICLE_MODEL,
f.VEHICLE_BRAND,
f.DRIVINGLICENSE_PHOTO,
f.ISDELETE,
f.CREATOR,
f.CREATORNAME,
f.CREATTIME,
f.OPERATOR,
f.OPERATORNAME,
f.OPERATTIME,
f.DELETOR,
f.DELETORNAME,
f.DELETTIME,
f.FREIGHTTRAILER_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
TAXATION_ID,
RECORD_NUMBER,
CORPINFO_ID,
PLATE_NUMBER,
VEHICLEOWNER,
CONTACT_NUMBER,
TRANSACTION_DATA,
TAXESDUES_PERIOD,
EXPIRE_DATE,
REGISTRANT,
TRANSPORT_ENTERPRISES,
REMINDER_STATUS,
EXPIRE_STATUS,
ARCHIVES_TYPE,
TRAILER_VEHICLE,
FRAMES_NUMBER,
VEHICLE_TYPE,
VEHICLEOWNER_NUMBER,
FIRSTSHOW_DATE,
PROVINCE,
CITY,
COUNTY,
REMINDER_DAY,
REMINDER_DATA,
TAXESDUES_MATERIAL,
REMARK,
REGISTER_NUMBER,
VEHICLE_MODEL,
VEHICLE_BRAND,
DRIVINGLICENSE_PHOTO,
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME,
OPERATOR,
OPERATORNAME,
OPERATTIME,
DELETOR,
DELETORNAME,
DELETTIME,
FREIGHTTRAILER_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{TAXATION_ID},
#{RECORD_NUMBER},
#{CORPINFO_ID,},
#{PLATE_NUMBER},
#{VEHICLEOWNER},
#{CONTACT_NUMBER},
#{TRANSACTION_DATA},
#{TAXESDUES_PERIOD},
#{EXPIRE_DATE},
#{REGISTRANT},
#{TRANSPORT_ENTERPRISES},
#{REMINDER_STATUS},
#{EXPIRE_STATUS},
#{ARCHIVES_TYPE},
#{TRAILER_VEHICLE},
#{FRAMES_NUMBER},
#{VEHICLE_TYPE},
#{VEHICLEOWNER_NUMBER},
#{FIRSTSHOW_DATE},
#{PROVINCE},
#{CITY},
#{COUNTY},
#{REMINDER_DAY},
#{REMINDER_DATA},
#{TAXESDUES_MATERIAL},
#{REMARK},
#{REGISTER_NUMBER},
#{VEHICLE_MODEL},
#{VEHICLE_BRAND},
#{DRIVINGLICENSE_PHOTO},
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME},
#{DELETOR},
#{DELETORNAME},
#{DELETTIME},
#{FREIGHTTRAILER_ID}
</sql>
<select id="getYestoday" parameterType="pd" resultType="pd">
SELECT
CASE WHEN v1.TRAFFIC_TYPE = '1' THEN '营运车辆' ELSE '货运挂车' END AS VEHICLEMODEL,
f.*,
v1.PLATE_NUMBER
FROM
<include refid="tableName"></include> f
INNER JOIN v_traffic v1 ON f.FREIGHTTRAILER_ID = v1.ID
LEFT JOIN bus_traffic_mechanical_freighttrailer btmf ON btmf.FREIGHTTRAILER_ID = v1.ID
WHERE f.ISDELETE = '0'
AND btmf.ISSCRAP = '0'
AND f.EXPIRE_DATE != ''
AND TO_DAYS( NOW() ) - TO_DAYS( f.EXPIRE_DATE ) = 0
AND f.REMINDER_STATUS = '0'
</select>
</mapper>