<?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.RiskMonthReportRepository">
|
<resultMap id="BaseMapper" type="com.gkhy.safePlatform.riskCtrl.entity.RiskMonthReport">
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
<result column="biz" property="biz" jdbcType="TINYINT"/>
|
<result column="eid" property="eid" jdbcType="BIGINT"/>
|
<result column="dep_id" property="depId" jdbcType="BIGINT"/>
|
<result column="dep_level" property="depLevel" jdbcType="INTEGER"/>
|
<result column="year" property="year" jdbcType="INTEGER"/>
|
<result column="month" property="month" jdbcType="INTEGER"/>
|
<result column="begin_date" property="beginDate" jdbcType="DATE"/>
|
<result column="end_date" property="endDate" jdbcType="DATE"/>
|
<result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
|
<sql id="base_table_name">risk_month_report</sql>
|
|
<sql id="all_columns">
|
id,biz,eid,dep_id,dep_level,year,month,begin_date,end_date,gmt_create
|
</sql>
|
|
<select id="findByMonth" resultMap="BaseMapper">
|
select <include refid="all_columns"></include> from <include refid="base_table_name"></include>
|
where biz = #{biz}
|
and dep_id = #{depId}
|
and year = #{year}
|
and month = #{month}
|
</select>
|
|
<select id="listByConditions" resultMap="BaseMapper">
|
select <include refid="all_columns"></include> from <include refid="base_table_name"></include>
|
<where>
|
<if test="params.biz != null">
|
biz = #{params.biz}
|
</if>
|
<if test="params.eid != null">
|
and eid = #{params.eid}
|
</if>
|
<if test="params.depId != null">
|
and dep_id = #{params.depId}
|
</if>
|
<if test="params.depLevel != null">
|
and dep_level = #{params.depLevel}
|
</if>
|
<if test="params.year != null">
|
and year = #{params.year}
|
</if>
|
<if test="params.month != null">
|
and month = #{params.month}
|
</if>
|
<if test="params.startDate != null">
|
and start_date >= #{params.startDate}
|
</if>
|
<if test="params.endDate != null">
|
and end_date <= #{params.endDate}
|
</if>
|
</where>
|
</select>
|
</mapper>
|