| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_lock_ram.LockReport; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LockReportMapper extends CustomMapper<LockReport>{ |
| | | List<LockReport> getReport(@Param("lockIds") List<Integer> lockIds, @Param("nowYear") int nowYear); |
| | | } |
| | |
| | | package com.whyc.pojo.db_lock_ram; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "本年开锁次数") |
| | | private Integer yearCount; |
| | | |
| | | @ApiModelProperty(value = "锁的名字") |
| | | @TableField(exist = false) |
| | | private String lockName; |
| | | |
| | | |
| | | } |
| | |
| | | //获取锁的频次 |
| | | public List<LockReport> getReport(List<Integer> lockIds) { |
| | | int nowYear=ActionUtil.getNowYear(); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.in("lock_id",lockIds); |
| | | wrapper.eq("record_year",nowYear); |
| | | List<LockReport> list=mapper.selectList(wrapper); |
| | | List<LockReport> list=mapper.getReport(lockIds,nowYear); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | <?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.whyc.mapper.LockReportMapper"> |
| | | |
| | | <select id="getReport" resultType="com.whyc.pojo.db_lock_ram.LockReport"> |
| | | select tb_lock_report.*, tb_lock_inf.lock_name from db_lock_ram.tb_lock_report,db_area.tb_lock_inf |
| | | <where> |
| | | tb_lock_report.lock_id = tb_lock_inf.lock_id |
| | | <if test="lockIds != null and lockIds.size() > 0"> |
| | | and tb_lock_inf.lock_id in |
| | | <foreach collection="lockIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | and tb_lock_report.record_year = #{nowYear} |
| | | </where> |
| | | </select> |
| | | </mapper> |