123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.diagbot.mapper.ResultRuleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.ResultRule">
- <id column="id" property="id" />
- <result column="is_deleted" property="isDeleted" />
- <result column="gmt_create" property="gmtCreate" />
- <result column="gmt_modified" property="gmtModified" />
- <result column="creator" property="creator" />
- <result column="modifier" property="modifier" />
- <result column="result_id" property="resultId" />
- <result column="rule_order_no" property="ruleOrderNo" />
- <result column="rule_type" property="ruleType" />
- <result column="rule_id" property="ruleId" />
- <result column="rule_lib_type" property="ruleLibType" />
- <result column="rule_lib_type_name" property="ruleLibTypeName" />
- <result column="rule_lib_name" property="ruleLibName" />
- <result column="rule_his_name" property="ruleHisName" />
- <result column="rule_his_detail_name" property="ruleHisDetailName" />
- <result column="has_sub_cond" property="hasSubCond" />
- <result column="rule_base_id" property="ruleBaseId" />
- <result column="group_type" property="groupType" />
- <result column="rule_base_type" property="ruleBaseType" />
- <result column="rule_base_lib_type" property="ruleBaseLibType" />
- <result column="rule_base_lib_type_name" property="ruleBaseLibTypeName" />
- <result column="rule_base_lib_name" property="ruleBaseLibName" />
- <result column="rule_base_his_name" property="ruleBaseHisName" />
- <result column="rule_base_his_detail_name" property="ruleBaseHisDetailName" />
- <result column="rule_base_max_value" property="ruleBaseMaxValue" />
- <result column="rule_base_min_value" property="ruleBaseMinValue" />
- <result column="rule_base_unit" property="ruleBaseUnit" />
- <result column="rule_base_input_value" property="ruleBaseInputValue" />
- <result column="reference_value" property="referenceValue" />
- <result column="output" property="output" />
- <result column="expected_output" property="expectedOutput" />
- <result column="success" property="success" />
- <result column="message" property="message" />
- <result column="input_params" property="inputParams" />
- <result column="output_params" property="outputParams" />
- <result column="rule_msg" property="ruleMsg" />
- </resultMap>
- <select id="getPage" resultType="com.diagbot.dto.ResultRulePageDTO">
- SELECT t.*
- FROM
- (SELECT
- a.gmt_modified AS gmtModified,
- a.modifier AS modifier,
- a.result_id AS resultId,
- a.rule_order_no AS ruleOrderNo,
- a.rule_type AS ruleType,
- a.rule_id AS ruleId,
- a.rule_lib_type AS ruleLibType,
- a.rule_lib_type_name AS ruleLibTypeName,
- a.rule_lib_name AS ruleLibName,
- a.rule_his_name AS ruleHisName,
- a.rule_his_detail_name AS ruleHisDetailName,
- a.group_type AS groupType,
- a.output AS output,
- a.expected_output AS expectedOutput,
- a.success AS success,
- a.message AS message,
- group_concat(id) as ids,
- group_concat(a.rule_base_lib_type) as ruleBaseLibTypes,
- group_concat(a.rule_base_lib_name) as ruleBaseLibNames
- FROM
- test_result_rule a
- WHERE
- a.is_deleted = 'N'
- <if test="resultRulePageVO.success != null">
- and a.success = #{resultRulePageVO.success}
- </if>
- <if test="resultRulePageVO.resultId != null">
- and a.result_id = #{resultRulePageVO.resultId}
- </if>
- GROUP BY
- a.result_id,
- a.rule_order_no
- ORDER BY
- a.result_id,
- a.rule_order_no) t
- WHERE 1 = 1
- <if test="resultRulePageVO.success != null and resultRulePageVO.success == 0">
- and t.message not like concat('%', '映射', '%')
- </if>
- <if test="resultRulePageVO.ruleLibType != null">
- and t.ruleLibType = #{resultRulePageVO.ruleLibType}
- </if>
- <if test="resultRulePageVO.ruleLibName != null and resultRulePageVO.ruleLibName != ''">
- and t.ruleLibName like concat('%', #{resultRulePageVO.ruleLibName}, '%')
- </if>
- <if test="resultRulePageVO.ruleBaseLibType != null">
- and t.ruleBaseLibTypes is not null
- and find_in_set( #{resultRulePageVO.ruleBaseLibType},t.ruleBaseLibTypes )>0
- </if>
- <if test="resultRulePageVO.ruleBaseLibName != null and resultRulePageVO.ruleBaseLibName != ''">
- and t.ruleBaseLibName like concat('%', #{resultRulePageVO.ruleBaseLibName}, '%')
- </if>
- <if test="resultRulePageVO.message != null and resultRulePageVO.message != ''">
- and t.message like concat('%', #{resultRulePageVO.message}, '%')
- </if>
- </select>
- </mapper>
|