Blame view

SubjectTestDictMapper.xml 2.23 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
<?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.meishu.mapper.SubjectTestDictMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestDictDO">
        <id column="id" property="id" />
        <result column="create_date" property="createTime" />
        <result column="update_date" property="updateTime" />
        <result column="create_date" property="deleteTime" />
        <result column="test_name" property="testName" />
<!--        <result column="out_line" property="outline" />-->
<!--        <result column="test_time" property="testTime" />-->
    </resultMap>

    <sql id="Base_Column_List">
        create_date,
        update_date,
        create_date,
        id, test_name, out_line, test_time
    </sql>


    <!-- 通用查询结果列 -->
    <select id="getAllTest" parameterType="com.meishu.dto.test.GetAllTestDTO" resultType="com.meishu.vo.test.GetAllTestVO">
        SELECT
        t.id,
        t.test_name,
        t.examination,
        t2.id as rule_id,
        t2.rule_name,
        t2.status
        FROM
        subject_test_dict t
        LEFT JOIN subject_rule t2 ON t.rule_id = t2.id
        WHERE
        t.delete_date IS NULL
        AND t2.delete_date IS NULL
        <if test="ruleId!=null and ruleId !=''">
            AND t2.id = #{ruleId}
        </if>
        <if test="testName!=null and testName !=''">
            AND t.test_name LIKE  concat('%',#{testName} ,'%')
        </if>
    </select>

    <select id="getTest" parameterType="com.meishu.dto.test.GetAllTestDTO" resultType="com.meishu.vo.test.GetAllTestVO">
        SELECT
        t.id,
        t.test_name,
        t.examination,
        t2.id as rule_id,
        t2.rule_name
        FROM
        subject_test_dict t
        LEFT JOIN subject_rule t2 ON t.rule_id = t2.id
        WHERE
        t.delete_date IS NULL
        AND t2.delete_date IS NULL
        <if test="ruleId!=null and ruleId !=''">
            AND t2.id = #{ruleId}
        </if>
        <if test="testName!=null and testName !=''">
            AND t.test_name LIKE  concat('%',#{testName} ,'%')
        </if>
    </select>
</mapper>