Browse Source

监督端-检查计划统计修改(时间相关)

v6
zouyx 2 years ago
parent
commit
8a560848b3
  1. 99
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html
  2. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

99
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html

@ -72,13 +72,14 @@
<option value="year">年度</option> <option value="year">年度</option>
<option value="quarter">季度</option> <option value="quarter">季度</option>
<option value="month">月度</option> <option value="month">月度</option>
<option value="day">自定义时间</option>
</select> </select>
<select id="quarter" name="quarter"> <select id="quarter" name="quarter">
<option value="">所有</option> <option value="">所有</option>
<option value="1">第一季度</option> <option value="1">第1季度</option>
<option value="2">第二季度</option> <option value="2">第2季度</option>
<option value="3">第三季度</option> <option value="3">第3季度</option>
<option value="4">第四季度</option> <option value="4">第4季度</option>
</select> </select>
<select id="month" name="month"> <select id="month" name="month">
<option value="">所有</option> <option value="">所有</option>
@ -96,6 +97,12 @@
<option value="12">12月</option> <option value="12">12月</option>
</select> </select>
</li> </li>
<li id="day" class="day" style="display: flex;">
<p>自定义时间:</p>
<input type="text" class="time-input" id="beginTime" placeholder="开始时间" name="beginTime" style="width: 100px"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" style="width: 100px"/>
</li>
<li> <li>
<a class="btn btn-success btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-success btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="resetP()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-reset btn-sm" onclick="resetP()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -105,7 +112,7 @@
<div class="static-content"> <div class="static-content">
<ul> <ul>
<li id="b"> <li id="b">
<p><span id="yearDate"></span>:</p> <p><span id="timeString"></span>:</p>
<p><label>计划总数</label><b><span id="total">0</span></b></p> <p><label>计划总数</label><b><span id="total">0</span></b></p>
<p><label>年度计划</label><b><span id="yearTotal">0</span></b></p> <p><label>年度计划</label><b><span id="yearTotal">0</span></b></p>
<p><label>季度计划</label><b><span id="quarterTotal">0</span></b></p> <p><label>季度计划</label><b><span id="quarterTotal">0</span></b></p>
@ -177,7 +184,8 @@
$("#monthDom").hide();*/ $("#monthDom").hide();*/
$("#quarter").hide(); $("#quarter").hide();
$("#month").hide(); $("#month").hide();
$("#select-time").hide(); $("#day").hide();
// $("#select-time").hide();
$("#chart-box-1").hide(); $("#chart-box-1").hide();
$("#chart-box-2").hide(); $("#chart-box-2").hide();
$("#chart-box-3").hide(); $("#chart-box-3").hide();
@ -225,7 +233,41 @@
$("#quarterTotal").text(0); $("#quarterTotal").text(0);
$("#monthTotal").text(0); $("#monthTotal").text(0);
} }
$("#yearDate").text(document.getElementById("year").value) if(document.getElementById("dateSearch").value=="year"){
$("#timeString").text(document.getElementById("year").value+"年")
}else if(document.getElementById("dateSearch").value=="quarter"){
let doc=document.getElementById("quarter")
let index=doc.selectedIndex
let text=document.getElementById("year").value+"年"
if(doc.value!=null&&doc.value!=""){
text=text+doc.options[index].text;
}
$("#timeString").text(text);
}else if(document.getElementById("dateSearch").value=="month"){
let doc=document.getElementById("month")
let index=doc.selectedIndex
let text=document.getElementById("year").value+"年"
if(doc.value!=null&&doc.value!=""){
text=text+doc.options[index].text;
}
$("#timeString").text(text);
}else if(document.getElementById("dateSearch").value=="day"){
let beginTime=document.getElementById("beginTime").value;
let endTime=document.getElementById("endTime").value;
console.log(beginTime);
console.log(endTime);
if(beginTime!=null&&beginTime!=""){
if(endTime!=null&&endTime!=""){
$("#timeString").text(beginTime+"~"+endTime);
}else{
$("#timeString").text(beginTime+"~");
}
}else if(endTime!=null&&endTime!=""){
$("#timeString").text("~"+endTime);
}else{
$("#timeString").text("~");
}
}
}, },
error: function (er) { //失败,回调函数 error: function (er) { //失败,回调函数
} }
@ -462,15 +504,58 @@
function timeType() { function timeType() {
var dateSearch = document.getElementById("dateSearch"); var dateSearch = document.getElementById("dateSearch");
console.log(dateSearch.value); console.log(dateSearch.value);
/* if(dateSearch.value=="quarter"){
$("#quarter").show();
$("#month").hide();
document.getElementById("month").value="";
}else if(dateSearch.value=="month"){
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").show();
}else {
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").hide();
document.getElementById("month").value="";
}*/
if(dateSearch.value=="quarter"){ if(dateSearch.value=="quarter"){
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").show(); $("#quarter").show();
$("#month").hide(); $("#month").hide();
document.getElementById("month").value=""; document.getElementById("month").value="";
}else if(dateSearch.value=="month"){ }else if(dateSearch.value=="month"){
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").hide(); $("#quarter").hide();
document.getElementById("quarter").value=""; document.getElementById("quarter").value="";
$("#month").show(); $("#month").show();
}else if(dateSearch.value=="day"){
$("#day").show();
$("#year").hide();
document.getElementById("year").value="";
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").hide();
document.getElementById("month").value="";
}else { }else {
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").hide(); $("#quarter").hide();
document.getElementById("quarter").value=""; document.getElementById("quarter").value="";
$("#month").hide(); $("#month").hide();

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

@ -184,13 +184,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM enforcement_inspection_program FROM enforcement_inspection_program
<where> <where>
<if test="bureauDeptName != null and bureauDeptName != ''"> <if test="bureauDeptName != null and bureauDeptName != ''">
bureau_dept_name like concat('%', #{bureauDeptName}, '%') and bureau_dept_name like concat('%', #{bureauDeptName}, '%')
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null and beginTime != ''">
<![CDATA[ create_time >= concat('%', #{beginTime}, '%') ]]> and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{beginTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
<![CDATA[ create_time <= concat('%', #{endTime}, '%') ]]> and #{endTime} >= DATE_FORMAT(create_time,'%Y-%m-%d')
</if> </if>
<if test="year != null and year != ''"> <if test="year != null and year != ''">
and YEAR(create_time) = #{year} and YEAR(create_time) = #{year}
@ -220,10 +220,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bureau_dept_name like concat('%', #{bureauDeptName}, '%') bureau_dept_name like concat('%', #{bureauDeptName}, '%')
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null and beginTime != ''">
<![CDATA[ create_time >= concat('%', #{beginTime}, '%') ]]> and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{beginTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
<![CDATA[ create_time <= concat('%', #{endTime}, '%') ]]> and #{endTime} >= DATE_FORMAT(create_time,'%Y-%m-%d')
</if> </if>
<if test="year != null and year != ''"> <if test="year != null and year != ''">
and YEAR(create_time) = #{year} and YEAR(create_time) = #{year}

Loading…
Cancel
Save