123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?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.IndicatorMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.ims.eval.entity.Indicator">
- <id column="id" property="id" />
- <result column="indicator_name" property="indicatorName" />
- <result column="indicator_code" property="indicatorCode" />
- <result column="unit" property="unit" />
- <result column="indicator_type_id" property="indicatorTypeId" />
- <result column="coefficient" property="coefficient" />
- <result column="is_quantified" property="isQuantified" />
- <result column="is_additional" property="isAdditional" />
- <result column="is_child" property="isChild" />
- <result column="bin_section" property="binSection" />
- <result column="bin_stage" property="binStage" />
- <result column="dept_id" property="deptId" />
- <result column="company" property="company" />
- <result column="create_time" property="createTime" />
- <result column="update_time" property="updateTime" />
- <result column="create_by" property="createBy" />
- <result column="update_by" property="updateBy" />
- <result column="enable" property="enable" />
- <result column="remark" property="remark" />
- <result column="des" property="des" />
- <result column="order_num" property="orderNum" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, indicator_name, indicator_code, unit, indicator_type_id, coefficient, is_quantified, is_additional, is_child, bin_section, bin_stage, dept_id, company, create_time, update_time, create_by, update_by, enable, remark, des, order_num
- </sql>
- <select id="selectByCode" resultType="com.ims.eval.entity.Indicator">
- SELECT
- *
- FROM
- indicator
- where indicator_code = #{code}
- </select>
- <select id="seleclistPage" resultType="com.ims.eval.entity.Indicator">
- SELECT
- i.*,t.type_name indicatorTypeName,
- b.stage_name binStageName,
- bs.section_name binSectionName
- FROM
- indicator i
- LEFT JOIN indicator_type t ON i.indicator_type_id = t.id
- LEFT JOIN bin_stage b ON i.bin_stage = b.id
- LEFT JOIN bin_section bs ON i.bin_section = bs.id
- <where>
- <if test="id !=null and id !=''">
- AND i.id = #{id}
- </if>
- <if test="indicatorName !=null and indicatorName !=''">
- AND i.indicator_name like CONCAT('%',#{indicatorName},'%')
- </if>
- <if test="indicatorCode !=null and indicatorCode !=''">
- AND i.indicator_code = #{indicatorCode}
- </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>
- <if test="dept_id !=null and dept_id !=''">
- AND i.dept_id = #{dept}
- </if>
- <if test="company !=null and company !=''">
- AND i.company = #{company}
- </if>
- </where>
- order by i.order_num asc
- </select>
- <select id="selectListByIds" resultType="com.ims.eval.entity.dto.response.IndicatorResDTO">
- SELECT
- i.id id,
- i.is_quantified isQuantified,
- d.id indicatorDictionaryID,
- d.option_code optionCode,
- d.option_name optionName,
- d.child_code
- FROM
- INDICATOR i
- LEFT JOIN indicator_dictionary d ON i.ID = d.indicator_id
- <where>
- AND i.id in
- <foreach item="item" collection="indicatorIds" separator="," open="(" close=")" index="">'${item}'</foreach>
- </where>
- </select>
- <select id="selectById" resultType="com.ims.eval.entity.dto.request.IndicatorDTO">
- SELECT
- i.*,t.type_name indicatorTypeName,
- b.stage_name binStageName,
- bs.section_name binSectionName
- FROM
- indicator i
- LEFT JOIN indicator_type t ON i.indicator_type_id = t.id
- LEFT JOIN bin_stage b ON i.bin_stage = b.id
- LEFT JOIN bin_section bs ON i.bin_section = bs.id
- where i.id = #{id}
- </select>
- <select id="seleclistAll" resultType="com.ims.eval.entity.Indicator">
- SELECT
- i.*,t.type_name indicatorTypeName,
- b.stage_name binStageName,
- bs.section_name binSectionName,
- dd.key_name dept_idName
- FROM
- indicator i
- LEFT JOIN indicator_type t ON i.indicator_type_id = t.id
- LEFT JOIN bin_stage b ON i.bin_stage = b.id
- LEFT JOIN bin_section bs ON i.bin_section = bs.id
- inner join data_dictionary dd on dd.data_key = i.dept_id
- <where>
- <if test="id !=null and id !=''">
- AND i.id = #{id}
- </if>
- <if test="indicatorName !=null and indicatorName !=''">
- AND i.indicator_name like CONCAT('%',#{indicatorName},'%')
- </if>
- <if test="indicatorCode !=null and indicatorCode !=''">
- AND i.indicator_code = #{indicatorCode}
- </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>
- <if test="dept_id !=null and dept_id !=''">
- AND i.dept_id = #{dept}
- </if>
- <if test="company !=null and company !=''">
- AND i.company = #{company}
- </if>
- </where>
- </select>
- </mapper>
|