123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?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="cn.cslg.pas.mapper.ProjectMapper">
- <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.ProjectVO"
- resultType="cn.cslg.pas.domain.Project">
- select a.id, a.`name`, a.creat_id as create_by, a.technical_theme,
- a.innerfile as inner_file, a.`update`, a.`status`, a.contract_no,
- a.`case` as case_date, a.update_time, a.sort, a.clientid as client_id,
- a.scenarioid as scenario, a.typeid as type, a.remark,
- a.create_time,a.department_id,a.personnel_id,a.product_id,a.structure_id,a.is_category,
- u.`name` as create_name,
- (select count(*) from os_thematic_file where zid = a.id and type = 1) as report_num
- from os_thematic a
- left join os_distribution u on u.id = a.creat_id
- <where>
- <if test="params.name != '' and params.name != null">
- and a.name like concat('%', #{params.name}, '%')
- </if>
- <if test="params.technicalTheme != '' and params.technicalTheme != null">
- and a.technical_theme like concat('%', #{params.technicalTheme}, '%')
- </if>
- <if test="params.innerFile != '' and params.innerFile != null">
- and a.innerfile like concat('%', #{params.innerFile}, '%')
- </if>
- <if test="params.departmentId != '' and params.departmentId != null">
- and a.department_id = #{params.departmentId}
- </if>
- <if test="params.personnelIds != null and params.personnelIds.size() != 0">
- and a.creat_id in
- <foreach item="item" collection="params.personnelIds" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="params.type != null and params.type.size() != 0">
- <foreach item="item" index="index" collection="params.type" open=" and (" separator="or" close=")">
- FIND_IN_SET(#{item}, a.typeid)
- </foreach>
- </if>
- <if test="params.scenario != null and params.scenario.size() != 0">
- <foreach item="item" index="index" collection="params.scenario" open=" and (" separator="or" close=")">
- FIND_IN_SET(#{item}, a.scenarioid)
- </foreach>
- </if>
- <if test="params.PersonnelId!=null">
- and (a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
- or a.creat_id = #{params.PersonnelId}
- <if test="params.tenantId!=null">
- or a.tenantId = #{params.tenantId}
- </if>
- )
- </if>
- <if test="params.eventId != null and params.eventId != ''">
- and a.id in (select project_id from asso_event_project where event_id = #{params.eventId})
- </if>
- </where>
- order by a.`${params.sort.prop}` ${params.sort.order}
- </select>
- <select id="getProjects" parameterType="cn.cslg.pas.common.model.vo.ProjectVO"
- resultType="cn.cslg.pas.domain.Project">
- select a.id
- from os_thematic a
- left join os_distribution u on u.id = a.creat_id
- <where>
- <if test="PersonnelId!=null">
- and (a.id in (select tid from os_distribution_doing where uid=#{PersonnelId} )
- or a.creat_id = #{PersonnelId}
- <if test="tenantId!=null">
- or a.tenantId = #{tenantId}
- </if>
- )
- </if>
- </where>
- </select>
- <select id="getListForCount"
- resultType="cn.cslg.pas.domain.Project"
- parameterType="cn.cslg.pas.common.model.vo.ProjectVO">
- select a.id, a.`name`, a.creat_id as create_by, a.technical_theme,
- a.innerfile as inner_file, a.`update`, a.`status`, a.contract_no,
- a.`case` as case_date, a.update_time, a.sort, a.clientid as client_id,
- a.scenarioid as scenario, a.typeid as type, a.remark, a.create_time,a.department_id,a.personnel_id
- from os_thematic a
- <where>
- <if test="params.PersonnelId!=null">
- and a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
- <if test="params.tenantId!=null">
- or a.tenantId = #{params.tenantId}
- </if>
- </if>
- </where>
- </select>
- <!--根据产品id统计数量-->
- <!--int countByProductId(Integer productId);-->
- <select id="countByProductId" resultType="int">
- select count(*)
- from os_thematic
- where product_id = #{productId}
- </select>
- <!--根据id查询数据-->
- <!--ProjectVO getStandardById(Integer id);-->
- <select id="getStandardById" resultMap="getStandardByIdMap">
- select id,
- product_id,
- structure_id,
- is_category
- from os_thematic
- where id = #{id}
- </select>
- <resultMap id="getStandardByIdMap" type="cn.cslg.pas.common.model.vo.ProjectStandardVO">
- <id column="id" property="id"/>
- <result column="product_id" property="productId"/>
- <result column="structure_id" property="structureId"/>
- <result column="is_category" property="isCategory"/>
- </resultMap>
- </mapper>
|