• 徐俊's avatar
    xujun · 2ac57ddc
    徐俊 authored
    2ac57ddc
ComProjectGroupDetailDAO.xml 2.33 KB
<?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.yiboshi.science.dao.ComProjectGroupDetailDAO">
    <sql id="allColumns">
        t.id as id, t.group_id as group_id, t.proj_id as proj_id
    </sql>

    <select id="getProjectGroupDetailByGP" resultType="com.yiboshi.science.param.dto.ComProjectGroupDetailDTO">
        select * from com_project_group_detail where group_id = #{groupId} and proj_id = #{projId}
    </select>

    <select id="getProjectDetailList" resultType="com.yiboshi.science.param.dto.ComProjectGroupDetailDTO">
        select * from com_project_group_detail where group_id = #{groupId} order by created
    </select>

    <select id="getProjectDetailList2" resultType="com.yiboshi.science.param.dto.ComProjectGroupDetailDTO">
        select a.id, a.group_id, a.proj_id, a.remark, a.created, a.updated, b.proj_no, b.proj_name, b.knowledge_id
        from com_project_group_detail a left join com_project b on a.proj_id = b.id
        where group_id = #{groupId} order by created
    </select>

    <select id="getProjectDetailListbyPage" resultType="com.yiboshi.science.param.dto.ComProjectGroupDetailDTO">
        select a.*, b.app_unit_id, f.unit_name as app_unit_name, b.proj_no, b.app_no, b.proj_class, b.proj_name, d.name as knowledge_name, c.cert_id, c.person_name
        from com_project_group_detail a
        left join com_project b on a.proj_id = b.id
        left join com_person c on b.app_person_id = c.id
        left join system_parameter d on b.knowledge_id = d.id
        left join system_parameter e on d.parent_id = e.id
        left join com_unit f on b.app_unit_id = f.id
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

    <select id="getProjectListByGroupIds" resultType="com.yiboshi.science.param.dto.ComProjectGroupDetailDTO">
        select a.*, b.proj_no, b.proj_name, d.name as knowledge_name from com_project_group_detail a
        left join com_project b on a.proj_id = b.id
        left join system_parameter d on b.knowledge_id = d.id
        left join system_parameter e on d.parent_id = e.id
        where a.group_id in
        <foreach collection="groupIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>