123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.ims.eval.dao.OrganizationEvaluationRuleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.ims.eval.entity.OrganizationEvaluationRule">
- <id column="id" property="id" />
- <result column="organization_name" property="organizationName" />
- <result column="organization_id" property="organizationId" />
- <result column="organization_type" property="organizationType" />
- <result column="bin_section" property="binSection" />
- <result column="bin_stage" property="binStage" />
- <result column="evaluation_cycle" property="evaluationCycle" />
- <result column="evaluate_rule_id" property="evaluateRuleId" />
- <result column="create_time" property="createTime" />
- <result column="create_by" property="createBy" />
- <result column="update_time" property="updateTime" />
- <result column="update_by" property="updateBy" />
- <result column="del_flag" property="delFlag" />
- <result column="is_check" property="isCheck" />
- <result column="order_num" property="orderNum" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, organization_name, organization_id, organization_type, bin_section, bin_stage, evaluation_cycle, evaluate_rule_id, create_time, create_by, update_time, update_by, del_flag, is_check, order_num, year, month
- </sql>
- <select id="list" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
- SELECT
- r.*,
- i.rule_name,
- bs.section_name binSectionName
- FROM
- organization_evaluation_rule r
- LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
- LEFT JOIN bin_section bs ON r.bin_section = bs.id
- <where>
- and r.del_flag = false
- <if test="id !=null and id !=''">
- AND r.id = #{id}
- </if>
- <if test="organizationName !=null and organizationName !=''">
- AND r.organization_name like CONCAT('%',#{organizationName},'%')
- </if>
- <if test="organizationId !=null and organizationId !=''">
- AND r.organization_id = #{organizationId}
- </if>
- <if test="organizationType !=null and organizationType !=''">
- AND r.organization_type = #{organizationType}
- </if>
- <if test="binSection !=null and binSection !=''">
- AND r.bin_section = #{binSection}
- </if>
- <if test="binStage !=null and binStage !=''">
- AND r.bin_stage = #{binStage}
- </if>
- <if test="evaluationCycle !=null and evaluationCycle !=''">
- AND r.evaluation_cycle = #{evaluationCycle}
- </if>
- order by order_num asc
- </where>
- </select>
- <select id="selectListAll" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
- SELECT
- r.*,i.rule_name
- FROM
- organization_evaluation_rule r
- LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
- <where>
- and r.del_flag = false
- <if test="id !=null and id !=''">
- AND r.id = #{id}
- </if>
- <if test="organizationName !=null and organizationName !=''">
- AND r.organization_name like CONCAT('%',#{organizationName},'%')
- </if>
- <if test="organizationId !=null and organizationId !=''">
- AND r.organization_id = #{organizationId}
- </if>
- <if test="organizationType !=null and organizationType !=''">
- AND r.organization_type = #{organizationType}
- </if>
- <if test="binSection !=null and binSection !=''">
- AND r.bin_section = #{binSection}
- </if>
- <if test="binStage !=null and binStage !=''">
- AND r.bin_stage = #{binStage}
- </if>
- <if test="evaluationCycle !=null and evaluationCycle !=''">
- AND r.evaluation_cycle = #{evaluationCycle}
- </if>
- order by order_num asc
- </where>
- </select>
- <select id="selectOrganizationRuleId" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
- SELECT
- r.*,
- i.rule_name,
- bs.section_name binSectionName,
- be.stage_name binStageName
- FROM
- organization_evaluation_rule r
- LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
- LEFT JOIN bin_section bs ON r.bin_section = bs.id
- LEFT JOIN bin_stage be on be.id = r.bin_stage
- <where>
- <if test="ids !=null">
- AND r.id in
- <foreach item="item" collection="ids" separator="," open="(" close=")" index="">'${item}'</foreach>
- </if>
- order by order_num asc
- </where>
- </select>
- </mapper>
|