<?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.gkhy.safePlatform.riskCtrl.repository.RiskSpiReportRepository" >
|
|
<resultMap id="BaseMapper" type="com.gkhy.safePlatform.riskCtrl.entity.RiskSpiReport">
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
<result column="eid" property="eid" jdbcType="BIGINT"/>
|
<result column="dep_id" property="depId" jdbcType="BIGINT"/>
|
<result column="year" property="year" jdbcType="INTEGER"/>
|
<result column="month" property="month" jdbcType="INTEGER"/>
|
<result column="val" property="val" jdbcType="DECIMAL"/>
|
<result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
|
<select id="listByConditions" resultMap="BaseMapper">
|
select * from risk_spi_report
|
<where>
|
<if test="eid != null and eid > 0">
|
and eid = #{searchDTO.eid}
|
</if>
|
<if test="depId != null and depId > 0">
|
and dep_id = #{searchDTO.depId}
|
</if>
|
<if test="year != null and year > 2000 and year < 2999">
|
and year = #{year}
|
</if>
|
<if test="beginMonth != null and beginMonth > 0 and beginMonth <= 12">
|
and month >= beginMonth
|
</if>
|
<if test="endMonth != null and endMonth > 0 and endMonth <= 12">
|
and month >= endMonth
|
</if>
|
</where>
|
</select>
|
|
<select id="getMonthlySpiReport" resultMap="BaseMapper">
|
select * from risk_spi_report
|
<where>
|
<if test="depId != null">
|
and dep_id = #{depId}
|
</if>
|
<if test="year != null">
|
and year = #{year}
|
</if>
|
<if test="month != null">
|
and month = #{month}
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|