123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?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.ResponsibilityIndicatorInfoMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.ims.eval.entity.ResponsibilityIndicatorInfo">
- <id column="id" property="id"/>
- <result column="dept_responsibility_id" property="deptResponsibilityId"/>
- <result column="indicator_id" property="indicatorId"/>
- <result column="indicator_dictionary_id" property="indicatorDictionaryId"/>
- <result column="option_code" property="optionCode"/>
- <result column="is_quantified" property="isQuantified"/>
- <result column="quantified_value" property="quantifiedValue"/>
- <result column="non_quantified_value" property="nonQuantifiedValue"/>
- <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="remark" property="remark"/>
- <result column="data_state" property="dataState"/>
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id
- , dept_responsibility_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark, data_state
- </sql>
- <select id="listByresponsibilityId" resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
- select
- ri.id,
- ri.dept_responsibility_id,
- ri.indicator_id,
- ri.is_quantified,
- be.stage_name,
- be.id binStage,
- bn.id binSection,
- bn.section_name,
- oer.id organizationEvaluationRuleId,
- oer.organization_name,
- oer.organization_short_name,
- dd.key_name deptName,
- it.type_name,
- i.indicator_name,
- ri.quantified_value,
- ri.non_quantified_value,
- i.unit,
- ri.state
- from
- responsibility_indicator_info ri
- inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
- inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
- left join indicator i on ri.indicator_id = i.id
- left join bin_stage be on i.bin_stage = be.id
- left join bin_section bn on i.bin_section = bn.id
- left join indicator_type it on i.indicator_type_id = it.id
- inner join data_dictionary dd on dd.data_key = i.dept_id
- <where>
- ri.dept_responsibility_id in
- <foreach item="item" collection="deptResponsibilityIds" separator="," open="(" close=")" index="">
- '${item}'
- </foreach>
- <if test="optionCode !=null and optionCode !=''">
- and ri.option_code = #{optionCode}
- </if>
- <if test="dept !=null and dept !=''">
- and dd.key_name = #{dept}
- </if>
- <if test="organizationId !=null and organizationId !=''">
- and oer.organization_id = #{organizationId}
- </if>
- </where>
- order by oer.organization_id,dd.data_key,i.id desc
- </select>
- <select id="selectResponsibilityIndicatorInfoList" resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
- select
- ri.id,
- ri.dept_responsibility_id,
- ri.indicator_id,
- ri.is_quantified,
- ri.data_state,
- be.stage_name,
- be.id binStage,
- bn.id binSection,
- bn.section_name,
- oer.id organizationEvaluationRuleId,
- oer.organization_name,
- dd.key_name deptName,
- it.type_name,
- i.indicator_name,
- ri.quantified_value,
- ri.non_quantified_value,
- i.unit,
- ri.state
- from
- responsibility_indicator_info ri
- inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
- inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
- left join indicator i on ri.indicator_id = i.id
- left join bin_stage be on i.bin_stage = be.id
- left join bin_section bn on i.bin_section = bn.id
- left join indicator_type it on i.indicator_type_id = it.id
- inner join data_dictionary dd on dd.data_key = i.dept_id
- <where>
- <if test="deptResponsibilityId != null and deptResponsibilityId != ''">
- and ri.dept_responsibility_id = #{deptResponsibilityId}
- </if>
- <if test="isQuantified != null and isQuantified != ''">
- and ri.is_quantified = #{isQuantified}
- </if>
- <if test="dataState != null and dataState != ''">
- and ri.data_state = #{dataState}
- </if>
- </where>
- </select>
- <select id="selectResponsibilityIndicatorList" resultType="java.util.Map">
- select distinct
- i.id,
- i.indicator_name
- from
- responsibility_indicator_info ri
- inner join "indicator" i on i.id = ri.indicator_id
- <where>
- <if test="responsibilityId !=null and responsibilityId !=''">
- and ri.dept_responsibility_id = #{responsibilityId}
- </if>
- <if test="binSection !=null and binSection !=''">
- and i.bin_section = #{binSection}
- </if>
- <if test="binStage !=null and binStage !=''">
- and i.bin_stage = #{binStage}
- </if>
- </where>
- </select>
- <select id="getResponsibilityInfoList"
- resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
- select
- ri.id,
- ri.dept_responsibility_id,
- ri.option_code,
- d.option_name,
- ri.indicator_id,
- ri.is_quantified,
- ri.child_code,
- d.child_name,
- be.stage_name,
- be.id binStage,
- bn.id binSection,
- bn.section_name,
- oer.id organizationEvaluationRuleId,
- oer.organization_name,
- oer.organization_short_name,
- oer.organization_id,
- dd.key_name deptName,
- it.type_name,
- i.indicator_name,
- ri.quantified_value,
- ri.non_quantified_value,
- i.unit,
- ri.state
- from
- responsibility_indicator_info ri
- inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
- inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
- left join indicator i on ri.indicator_id = i.id
- left join indicator_dictionary d on ri.indicator_dictionary_id = d.id
- left join bin_stage be on i.bin_stage = be.id
- left join bin_section bn on i.bin_section = bn.id
- left join indicator_type it on i.indicator_type_id = it.id
- inner join data_dictionary dd on dd.data_key = i.dept_id
- <where>
- <if test="responsibilityId !=null and responsibilityId !=''">
- ri.dept_responsibility_id = #{responsibilityId}
- </if>
- <if test="organizationShortName !=null and organizationShortName !=''">
- and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
- </if>
- <if test="binSection !=null and binSection !=''">
- and bn.id = #{binSection}
- </if>
- <if test="binStage !=null and binStage !=''">
- and be.id = #{binStage}
- </if>
- and ri.data_state = '有效'
- </where>
- order by ri.child_code desc
- </select>
- </mapper>
|