third commit by ailanyin

This commit is contained in:
2022-03-29 11:04:01 +08:00
parent e340066b15
commit 8a1288dee0
63 changed files with 1632 additions and 323 deletions

View File

@ -1,20 +1,22 @@
package com.ailanyin.mapper;
import com.ailanyin.model.HxCarLocationLog;
import com.ailanyin.model.HxReaderInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2022-01-15 09:50:40
*/
* @author ailanyin
* @version 1.0
* @since 2022-01-15 09:50:40
*/
@Mapper
public interface HxCarLocationLogMapper{
public interface HxCarLocationLogMapper {
/**
/**
* 条件查询列表
*
* @param hxCarLocationLog hxCarLocationLog
@ -58,4 +60,7 @@ public interface HxCarLocationLogMapper{
*/
List<HxCarLocationLog> getBigPicData();
Integer selectLastLogDistanceByCardNumAndReadId(@Param("cardNum") String cardNum, @Param("readId") Long readerInfoId);
List<HxCarLocationLog> selectByParam(@Param("readId") Long readId, @Param("maxTotal") Integer maxTotal, @Param("selectTime") Date selectTime);
}

View File

@ -0,0 +1,56 @@
package com.ailanyin.mapper;
import com.ailanyin.model.HxCarLogConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2022-02-15 04:15:39
*/
@Mapper
public interface HxCarLogConfigMapper{
/**
* 条件查询列表
*
* @param hxCarLogConfig hxCarLogConfig
* @return list
*/
List<HxCarLogConfig> selectList(HxCarLogConfig hxCarLogConfig);
/**
* 新增
*
* @param hxCarLogConfig hxCarLogConfig
*/
void insertSelective(HxCarLogConfig hxCarLogConfig);
/**
* 修改
*
* @param hxCarLogConfig hxCarLogConfig
*/
void updateByPrimaryKeySelective(HxCarLogConfig hxCarLogConfig);
/**
* 批量删除
*
* @param ids ids
*/
void deleteByIds(@Param("list") Long[] ids);
/**
* 主键查询
*
* @param id id
* @return hxCarLogConfig
*/
HxCarLogConfig selectByPrimaryKey(Long id);
HxCarLogConfig selectOne();
}

View File

@ -35,4 +35,5 @@ public interface HxDangerousWorkMapper {
*/
List<HxDangerousWork> selectByTime(Map handleDate);
List<HxDangerousWork> selectLimit10(String type);
}

View File

@ -29,43 +29,11 @@ public interface HxHiddenDangerMapper {
*/
void insertSelective(HxHiddenDanger hxHiddenDanger);
/**
* 获取所有的存在的类别以及数量
*
* @param year 年份
* @return list
*/
List<Map> getAllCategoryAndCount(Integer year);
List<Map<String, Integer>> selectCountGroupByMonth();
/**
* 根据年和整改情况查询个数
*
* @param alreadyUpdate alreadyUpdate
* @param year year
* @return count
*/
Long getCountByMeasures(@Param("alreadyUpdate") String alreadyUpdate, @Param("year") Integer year);
List<String> getAllCategoryByYear(Integer nowYear);
/**
* 获取所有车间
*
* @return list
*/
List<String> getAllWorkshopList();
Integer selectCountByCategoryAndYear(@Param("category") String category, @Param("nowYear") Integer nowYear);
/**
* 获取已整改 和 所有
* @param workshop 车间
* @param alreadyUpdate 已整改
* @return map
*/
Map selectWorkShopDangerCount(@Param("workshop") String workshop, @Param("alreadyUpdate") String alreadyUpdate);
List<String> getAllWorkshopByYear(String year);
Map selectByWorkShopAndYear(@Param("workshop") String workshop,@Param("year") String year);
List<String> getAllMonthByYear(String year);
Map getAllByMonth(String month);
List<Map> selectByYearGroupUnit(String year);
}

View File

@ -58,4 +58,7 @@ public interface HxReaderInfoMapper{
* @return 个数
*/
int checkIsExist(HxReaderInfo hxReaderInfo);
List<HxReaderInfo> getAllReadInfo();
}

View File

@ -0,0 +1,33 @@
package com.ailanyin.mapper;
import com.ailanyin.model.HxTableConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2022-03-08 09:18:14
*/
@Mapper
public interface HxTableConfigMapper{
/**
* 查询
*
* @param tableName tableName
* @return String
*/
String selectByTableName(String tableName);
/**
* 修改
*
* @param hxTableConfig hxTableConfig
*/
void updateByTableName(HxTableConfig hxTableConfig);
}

View File

@ -40,6 +40,10 @@ public class HxCarLocationLog implements Serializable {
@Excel(name = "读卡器ID", width = 20)
private Long readId;
@ApiModelProperty(value = "读卡器名称")
@Excel(name = "读卡器名称", width = 20)
private String readName;
@ApiModelProperty(value = "与正北夹角")
@Excel(name = "与正北夹角", width = 20)
private Integer northAngle;
@ -64,6 +68,10 @@ public class HxCarLocationLog implements Serializable {
@Excel(name = "驾驶人手机号", width = 20)
private String driverPhone;
@ApiModelProperty(value = "进or出(1->进0->出)")
@Excel(name = "进or出(1->进0->出)", width = 20)
private String status;
@ApiModelProperty(value = "录入时间")
@Excel(name = "录入时间", format = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date createTime;

View File

@ -0,0 +1,38 @@
package com.ailanyin.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author ailanyin
* @version 1.0
* @since 2022-02-15 04:15:39
*/
@Data
public class HxCarLogConfig implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
@Excel(name = "", width = 20)
private Long id;
@ApiModelProperty(value = "最大条数")
@Excel(name = "最大条数", width = 20)
private Integer maxTotal;
@ApiModelProperty(value = "最大天数")
@Excel(name = "最大天数", width = 20)
private Integer maxDay;
@ApiModelProperty(value = "")
@Excel(name = "", format = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date createTime;
}

View File

@ -17,14 +17,27 @@ public class HxDangerousWork implements Serializable {
private Long id;
@ApiModelProperty(value = "日期")
@Excel(name = "日期", width = 20)
private String todayDate;
@ApiModelProperty(value = "开始日期")
@Excel(name = "开始日期", width = 20)
private String startDate;
@ApiModelProperty(value = "部门名称")
@Excel(name = "部门名称", width = 20)
@ApiModelProperty(value = "结束日期")
@Excel(name = "结束日期", width = 20)
private String endDate;
@ApiModelProperty(value = "单位名称")
@Excel(name = "单位名称", width = 20)
private String deptName;
@ApiModelProperty(value = "作业地点")
@Excel(name = "作业地点", width = 20)
private String workAddress;
@ApiModelProperty(value = "作业人数")
@Excel(name = "作业人数", width = 20)
private String workerTotal;
@ApiModelProperty(value = "作业内容")
@Excel(name = "作业内容", width = 20)
private String workContent;

View File

@ -17,33 +17,41 @@ public class HxHiddenDanger implements Serializable {
private Long id;
@ApiModelProperty(value = "月份")
@Excel(name = "月份", width = 20)
private String month;
@ApiModelProperty(value = "检查日期")
@Excel(name = "检查日期", width = 20)
private String checkDate;
@ApiModelProperty(value = "车间名称")
@Excel(name = "车间名称", width = 20)
private String workshopName;
@ApiModelProperty(value = "所在位置")
@Excel(name = "所在位置", width = 20)
private String address;
@ApiModelProperty(value = "隐患内容")
@Excel(name = "隐患内容", width = 20)
private String dangerContent;
@ApiModelProperty(value = "存在问题")
@Excel(name = "存在问题", width = 20)
private String existProblem;
@ApiModelProperty(value = "类别")
@Excel(name = "类别", width = 20)
private String category;
@ApiModelProperty(value = "措施")
@Excel(name = "措施", width = 20)
private String measures;
@ApiModelProperty(value = "整改建议")
@Excel(name = "整改建议", width = 20)
private String updateSuggest;
@ApiModelProperty(value = "临时控制措施")
@Excel(name = "临时控制措施", width = 20)
private String tempUpdateMethod;
@ApiModelProperty(value = "责任单位")
@Excel(name = "责任单位", width = 20)
private String responsibleUnit;
@ApiModelProperty(value = "责任人")
@Excel(name = "责任人", width = 20)
private String personLiable;
private String responsiblePerson;
@ApiModelProperty(value = "备注")
@Excel(name = "备注", width = 20)
private String remark;
@ApiModelProperty(value = "建议完成日期")
@Excel(name = "建议完成日期", width = 20)
private String suggestCompleteTime;
private Date createTime;

View File

@ -47,6 +47,10 @@ public class HxReaderInfo implements Serializable {
@Excel(name = "读卡器端口", width = 20)
private Integer readerPort;
@ApiModelProperty(value = "记录距离")
@Excel(name = "记录距离", width = 20)
private Integer recordDistance;
@ApiModelProperty(value = "录入时间")
@Excel(name = "录入时间", format = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date createTime;

View File

@ -37,5 +37,8 @@ public class HxStorehouse implements Serializable {
@Excel(name = "产品信息", width = 20)
private String productInfo;
@ApiModelProperty(value = "鉴权信息")
private String auth;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,26 @@
package com.ailanyin.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author ailanyin
* @version 1.0
* @since 2022-03-08 09:18:14
*/
@Data
public class HxTableConfig implements Serializable {
private static final long serialVersionUID = 1L;
private String tableName;
private String keyInfo;
}

View File

@ -10,12 +10,14 @@
<result column="distance" property="distance" jdbcType="INTEGER" />
<result column="low_voltage" property="lowVoltage" jdbcType="INTEGER" />
<result column="read_id" property="readId" jdbcType="BIGINT" />
<result column="read_name" property="readName" jdbcType="VARCHAR" />
<result column="north_angle" property="northAngle" jdbcType="INTEGER" />
<result column="car_abscissa" property="carAbscissa" jdbcType="VARCHAR" />
<result column="car_ordinate" property="carOrdinate" jdbcType="VARCHAR" />
<result column="car_id" property="carId" jdbcType="VARCHAR" />
<result column="driver_name" property="driverName" jdbcType="VARCHAR" />
<result column="driver_phone" property="driverPhone" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap>
@ -25,15 +27,42 @@
"distance",
"low_voltage",
"read_id",
"read_name",
"north_angle",
"car_abscissa",
"car_ordinate",
"car_id",
"driver_name",
"driver_phone",
"status",
"create_time"
</sql>
<select id="selectLastLogDistanceByCardNumAndReadId" resultType="int">
select "distance" FROM ROOT."hx_car_location_log"
where "card_number" = #{cardNum}
and "read_id" == #{readId}
order by "id" desc limit 1
</select>
<select id="selectByParam" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_car_location_log"
<where>
<if test="readId != null">
and "read_id" = #{readId}
</if>
<if test="selectTime != null">
and date_format("create_time",'%y%m%d') &gt;= date_format(#{selectTime},'%y%m%d')
</if>
</where>
order by "id" desc
<if test="maxTotal != null">
limit #{maxTotal}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
@ -99,6 +128,9 @@
<if test="readId != null">
"read_id",
</if>
<if test="readName != null">
"read_name",
</if>
<if test="northAngle != null">
"north_angle",
</if>
@ -117,6 +149,9 @@
<if test="driverPhone != null">
"driver_phone",
</if>
<if test="status != null">
"status",
</if>
<if test="createTime != null">
"create_time",
</if>
@ -137,6 +172,9 @@
<if test="readId != null">
#{readId,jdbcType=INTEGER},
</if>
<if test="readName != null">
#{readName,jdbcType=VARCHAR},
</if>
<if test="northAngle != null">
#{northAngle,jdbcType=INTEGER},
</if>
@ -155,6 +193,9 @@
<if test="driverPhone != null">
#{driverPhone,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>

View File

@ -0,0 +1,114 @@
<?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.ailanyin.mapper.HxCarLogConfigMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.HxCarLogConfig">
<result column="id" property="id" jdbcType="BIGINT" />
<result column="max_total" property="maxTotal" jdbcType="INTEGER" />
<result column="max_day" property="maxDay" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List">
"id",
"max_total",
"max_day",
"create_time"
</sql>
<select id="selectList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_car_log_config"
<where>
<if test="id != null">
and "id" = #{id,jdbcType=BIGINT}
</if>
<if test="maxTotal != null">
and "max_total" = #{maxTotal,jdbcType=INTEGER}
</if>
<if test="maxDay != null">
and "max_day" = #{maxDay,jdbcType=INTEGER}
</if>
<if test="createTime != null">
and "create_time" = #{createTime,jdbcType=TIMESTAMP}
</if>
</where>
order by "id" desc
</select>
<insert id="insertSelective" >
insert into ROOT."hx_car_log_config"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
"id",
</if>
<if test="maxTotal != null">
"max_total",
</if>
<if test="maxDay != null">
"max_day",
</if>
<if test="createTime != null">
"create_time",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="maxTotal != null">
#{maxTotal,jdbcType=INTEGER},
</if>
<if test="maxDay != null">
#{maxDay,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_car_log_config"
where "id" = #{id}
</select>
<select id="selectOne" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_car_log_config"
limit 1
</select>
<update id="updateByPrimaryKeySelective">
update ROOT."hx_car_log_config"
<set>
<if test="id != null">
"id" = #{id,jdbcType=BIGINT},
</if>
<if test="maxTotal != null">
"max_total" = #{maxTotal,jdbcType=INTEGER},
</if>
<if test="maxDay != null">
"max_day" = #{maxDay,jdbcType=INTEGER},
</if>
<if test="createTime != null">
"create_time" = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where "id" = #{id}
</update>
<delete id="deleteByIds">
delete from ROOT."hx_car_log_config" where "id" in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -3,14 +3,18 @@
<mapper namespace="com.ailanyin.mapper.HxDangerousWorkMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.HxDangerousWork">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="today_date" jdbcType="VARCHAR" property="todayDate" />
<result column="start_date" jdbcType="VARCHAR" property="startDate" />
<result column="end_date" jdbcType="VARCHAR" property="endDate" />
<result column="dept_name" jdbcType="VARCHAR" property="deptName" />
<result column="work_address" jdbcType="VARCHAR" property="workAddress" />
<result column="worker_total" jdbcType="VARCHAR" property="workerTotal" />
<result column="work_content" jdbcType="VARCHAR" property="workContent" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
"id", "today_date", "dept_name", "work_content", "remark", "create_time"
"id", "start_date", "end_date", "dept_name", "work_address", "worker_total", "work_content",
"remark", "create_time"
</sql>
<select id="selectHxDangerousWorkList" resultMap="BaseResultMap">
select
@ -24,7 +28,7 @@
This element was generated on Wed Dec 08 09:39:34 UTC 2021.
-->
delete from hx_dangerous_work
where `id` = #{id,jdbcType=BIGINT}
where "id" = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.ailanyin.model.HxDangerousWork">
<!--
@ -45,12 +49,21 @@
<if test="id != null">
"id",
</if>
<if test="todayDate != null">
"today_date",
<if test="startDate != null">
"start_date",
</if>
<if test="endDate != null">
"end_date",
</if>
<if test="deptName != null">
"dept_name",
</if>
<if test="workAddress != null">
"work_address",
</if>
<if test="workerTotal != null">
"worker_total",
</if>
<if test="workContent != null">
"work_content",
</if>
@ -65,12 +78,21 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="todayDate != null">
#{todayDate,jdbcType=VARCHAR},
<if test="startDate != null">
#{startDate,jdbcType=VARCHAR},
</if>
<if test="endDate != null">
#{endDate,jdbcType=VARCHAR},
</if>
<if test="deptName != null">
#{deptName,jdbcType=VARCHAR},
</if>
<if test="workAddress != null">
#{workAddress,jdbcType=VARCHAR},
</if>
<if test="workerTotal != null">
#{workerTotal,jdbcType=VARCHAR},
</if>
<if test="workContent != null">
#{workContent,jdbcType=VARCHAR},
</if>
@ -127,6 +149,14 @@
select
<include refid="Base_Column_List" />
from ROOT."hx_dangerous_work"
where "today_date" &gt;= #{start} and "today_date" &lt;= #{end}
where ("start_date" &gt;= #{start} and "start_date" &lt;= #{end})
or ("end_date" &gt;= #{start} and "end_date" &lt;= #{end})
</select>
<select id="selectLimit10" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_dangerous_work"
order by "today_date" desc limit 10
</select>
</mapper>

View File

@ -326,10 +326,10 @@
sum("target_income") AS "targetIncome",
sum("real_income") * 100/sum("target_income") as "rate"
from ROOT."hx_dept_operate_index"
<if test="month != null">
where "month" = #{month}
</if>
where "dept_name" is not null
<if test="month != null">
and "month" = #{month}
</if>
group BY "dept_name"
</select>
</mapper>

View File

@ -3,26 +3,28 @@
<mapper namespace="com.ailanyin.mapper.HxHiddenDangerMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.HxHiddenDanger">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="month" jdbcType="VARCHAR" property="month" />
<result column="workshop_name" jdbcType="VARCHAR" property="workshopName" />
<result column="danger_content" jdbcType="VARCHAR" property="dangerContent" />
<result column="check_date" jdbcType="VARCHAR" property="checkDate" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="exist_problem" jdbcType="VARCHAR" property="existProblem" />
<result column="category" jdbcType="VARCHAR" property="category" />
<result column="measures" jdbcType="VARCHAR" property="measures" />
<result column="person_liable" jdbcType="VARCHAR" property="personLiable" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="update_suggest" jdbcType="VARCHAR" property="updateSuggest" />
<result column="temp_update_method" jdbcType="VARCHAR" property="tempUpdateMethod" />
<result column="responsible_unit" jdbcType="VARCHAR" property="responsibleUnit" />
<result column="responsible_person" jdbcType="VARCHAR" property="responsiblePerson" />
<result column="suggest_complete_time" jdbcType="VARCHAR" property="suggestCompleteTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
"id", "month", "workshop_name", "danger_content", "category", "measures", "person_liable",
"remark", "create_time"
"id", "check_date", "address", "exist_problem", "category", "update_suggest", "temp_update_method",
"responsible_unit", "responsible_person", "suggest_complete_time", "create_time"
</sql>
<select id="selectHxHiddenDangerList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_hidden_danger"
<where>
<if test="month != null">
"month" like concat(#{month}, '-%')
<if test="checkDate != null">
"check_date" like concat(#{checkDate}, '%')
</if>
</where>
</select>
@ -35,47 +37,39 @@
delete from hx_hidden_danger
where `id` = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.ailanyin.model.HxHiddenDanger">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Dec 08 09:02:58 UTC 2021.
-->
insert into hx_hidden_danger (`id`, `month`, `workshop_name`,
`danger_content`, `category`, `measures`,
`person_liable`, `remark`, `create_time`
)
values (#{id,jdbcType=BIGINT}, #{month,jdbcType=VARCHAR}, #{workshopName,jdbcType=VARCHAR},
#{dangerContent,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, #{measures,jdbcType=VARCHAR},
#{personLiable,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.ailanyin.model.HxHiddenDanger">
insert into ROOT."hx_hidden_danger"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
"id",
</if>
<if test="month != null">
"month",
<if test="checkDate != null">
"check_date",
</if>
<if test="workshopName != null">
"workshop_name",
<if test="address != null">
"address",
</if>
<if test="dangerContent != null">
"danger_content",
<if test="existProblem != null">
"exist_problem",
</if>
<if test="category != null">
"category",
</if>
<if test="measures != null">
"measures",
<if test="updateSuggest != null">
"update_suggest",
</if>
<if test="personLiable != null">
"person_liable",
<if test="tempUpdateMethod != null">
"temp_update_method",
</if>
<if test="remark != null">
"remark",
<if test="responsibleUnit != null">
"responsible_unit",
</if>
<if test="responsiblePerson != null">
"responsible_person",
</if>
<if test="suggestCompleteTime != null">
"suggest_complete_time",
</if>
<if test="createTime != null">
"create_time",
@ -85,26 +79,32 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="month != null">
#{month,jdbcType=VARCHAR},
<if test="checkDate != null">
#{checkDate,jdbcType=VARCHAR},
</if>
<if test="workshopName != null">
#{workshopName,jdbcType=VARCHAR},
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="dangerContent != null">
#{dangerContent,jdbcType=VARCHAR},
<if test="existProblem != null">
#{existProblem,jdbcType=VARCHAR},
</if>
<if test="category != null">
#{category,jdbcType=VARCHAR},
</if>
<if test="measures != null">
#{measures,jdbcType=VARCHAR},
<if test="updateSuggest != null">
#{updateSuggest,jdbcType=VARCHAR},
</if>
<if test="personLiable != null">
#{personLiable,jdbcType=VARCHAR},
<if test="tempUpdateMethod != null">
#{tempUpdateMethod,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
<if test="responsibleUnit != null">
#{responsibleUnit,jdbcType=VARCHAR},
</if>
<if test="responsiblePerson != null">
#{responsiblePerson,jdbcType=VARCHAR},
</if>
<if test="suggestCompleteTime != null">
#{suggestCompleteTime,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
@ -164,72 +164,30 @@
where `id` = #{id,jdbcType=BIGINT}
</update>
<select id="getAllCategoryAndCount" resultType="map">
select "hx_hidden_danger"."category",COUNT("id") as numbercount
from ROOT."hx_hidden_danger"
where "month" like concat(#{year}, '-%')
group BY "hx_hidden_danger"."category"
<select id="selectCountGroupByMonth" resultType="map">
select date_format("check_date", '%Y-%m') as "month", count("id") as "count"
from Root."hx_hidden_danger"
group by date_format("check_date", '%Y-%m') ORDER by date_format("check_date", '%Y-%m') ASC;
</select>
<select id="getCountByMeasures" resultType="long">
select COUNT("id") as numbercount
from ROOT."hx_hidden_danger"
where "month" like concat(#{year}, '-%')
<if test="alreadyUpdate != null">
and "measures" = #{alreadyUpdate}
<select id="getAllCategoryByYear" resultType="string">
select "category" as "category"
from Root."hx_hidden_danger"
where "check_date" like concat(#{nowYear}, '%')
group BY "category"
</select>
<select id="selectCountByCategoryAndYear" resultType="int">
select count("id") as "count"
from Root."hx_hidden_danger" where "check_date" like concat(#{nowYear}, '%')
<if test="category != null">
and "category" = #{category}
</if>
</select>
<select id="getAllWorkshopList" resultType="string">
select "workshop_name" from ROOT."hx_hidden_danger" GROUP BY "workshop_name"
</select>
<select id="getAllWorkshopByYear" resultType="string">
select "workshop_name" from ROOT."hx_hidden_danger"
where "month" like #{year}
GROUP BY "workshop_name"
</select>
<select id="selectWorkShopDangerCount" resultType="map">
select count("id") as updateCount,(select COUNT("id") from ROOT."hx_hidden_danger" where "workshop_name" = #{workshop}) as totalCount
from ROOT."hx_hidden_danger"
where "measures" = #{alreadyUpdate} and "workshop_name" = #{workshop}
</select>
<select id="selectByWorkShopAndYear" resultType="map">
select
count("id") as "total",
(select count("id")
from ROOT."hx_hidden_danger"
where "month" like #{year}
and "workshop_name" = #{workshop}
and "measures" = '已整改'
) * 100 / count("id") as "rate"
from ROOT."hx_hidden_danger"
where "month" like #{year}
and "workshop_name" = #{workshop}
</select>
<select id="getAllMonthByYear" resultType="string">
select
"month"
from ROOT."hx_hidden_danger"
group BY "month"
order by "month" asc
</select>
<select id="getAllByMonth" resultType="map">
select
COUNT("id") as "total",
(
select
COUNT("id")
from ROOT."hx_hidden_danger"
where "month" = #{month}
and "measures" = '已整改'
) *100 / COUNT("id") as "rate"
from ROOT."hx_hidden_danger"
where "month" = #{month}
<select id="selectByYearGroupUnit" resultType="map">
select "responsible_unit" as "unit",count("id") as "count"
from Root."hx_hidden_danger" where "check_date" like concat(#{year}, '%')
group BY "responsible_unit"
</select>
</mapper>

View File

@ -12,6 +12,7 @@
<result column="north_angle" property="northAngle" jdbcType="INTEGER" />
<result column="reader_ip" property="readerIp" jdbcType="VARCHAR" />
<result column="reader_port" property="readerPort" jdbcType="INTEGER" />
<result column="record_distance" property="recordDistance" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap>
@ -23,6 +24,7 @@
"north_angle",
"reader_ip",
"reader_port",
"record_distance",
"create_time"
</sql>
@ -80,8 +82,11 @@
<if test="readerPort != null">
"reader_port",
</if>
<if test="recordDistance != null">
"record_distance",
</if>
<if test="createTime != null">
"create_time",
"create_time"
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -106,6 +111,9 @@
<if test="readerPort != null">
#{readerPort,jdbcType=INTEGER},
</if>
<if test="recordDistance != null">
#{recordDistance,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
@ -119,6 +127,14 @@
where "id" = #{id}
</select>
<select id="getAllReadInfo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ROOT."hx_reader_info"
where "id" in (select "read_id"
from ROOT."hx_car_location_log" group BY "read_id")
</select>
<update id="updateByPrimaryKeySelective">
update ROOT."hx_reader_info"
<set>
@ -143,6 +159,9 @@
<if test="readerPort != null">
"reader_port" = #{readerPort,jdbcType=INTEGER},
</if>
<if test="recordDistance != null">
"record_distance" = #{recordDistance,jdbcType=INTEGER},
</if>
<if test="createTime != null">
"create_time" = #{createTime,jdbcType=TIMESTAMP},
</if>

View File

@ -0,0 +1,30 @@
<?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.ailanyin.mapper.HxTableConfigMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.HxTableConfig">
<result column="table_name" property="tableName" jdbcType="VARCHAR" />
<result column="key_info" property="keyInfo" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
"table_name",
"key_info"
</sql>
<select id="selectByTableName" resultType="string">
select
"key_info" as "keyInfo"
from ROOT."hx_table_config"
where "table_name" = #{tableName}
</select>
<update id="updateByTableName">
update ROOT."hx_table_config" set
"key_info" = #{keyInfo,jdbcType=VARCHAR}
where "table_name" = #{tableName}
</update>
</mapper>