<?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.ruoyi.system.mapper.TPedigreeChartMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.model.TPedigreeChart">
|
<result column="id" property="id" />
|
<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="disabled" property="disabled" />
|
<result column="generation_type" property="generationType" />
|
<result column="strain_name" property="strainName" />
|
<result column="strain_code" property="strainCode" />
|
<result column="strain_source_start" property="strainSourceStart" />
|
<result column="strain_source_end" property="strainSourceEnd" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, create_time, update_time, create_by, update_by, disabled, generation_type, strain_name, strain_code, strain_source_start, strain_source_end
|
</sql>
|
<select id="pageList" resultType="com.ruoyi.system.vo.TPedigreeChartVO">
|
SELECT
|
*
|
FROM t_pedigree_chart
|
<where>
|
<if test="query.strainName != null and query.strainName != ''">
|
AND strain_name LIKE CONCAT('%', #{query.strainName}, '%')
|
</if>
|
<if test="query.strainCode != null and query.strainCode != ''">
|
AND strain_code LIKE CONCAT('%', #{query.strainCode}, '%')
|
</if>
|
<if test="query.generationType != null">
|
and generation_type = #{query.generationType}
|
</if>
|
<if test="query.roleType == 1">
|
and status = 2
|
</if>
|
<if test="query.roleType == 2">
|
and status = 2
|
</if>
|
<if test="query.roleType == 3">
|
and (status = 2 or status = 1)
|
</if>
|
<if test="query.projectIds != null and query.projectIds.size() > 0">
|
and project_id in
|
<foreach item="item" collection="query.projectIds" separator="," open="(" close=")" index="">
|
#{item}
|
</foreach>
|
</if>
|
AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY create_time DESC
|
</select>
|
<select id="listConfirm" resultType="com.ruoyi.system.vo.TPedigreeChartConfirmVO">
|
select t1.* from t_pedigree_chart_detail t1
|
where t1.pedigree_chart_id = #{query.id}
|
AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
and t1.preserve_signature is null
|
|
</select>
|
<select id="pageListDetail" resultType="com.ruoyi.system.vo.TPedigreeChartDetailVO">
|
select * from t_pedigree_chart_detail
|
where pedigree_chart_id = #{query.id}
|
and status = 1
|
and type = 1
|
and audit_status = 1
|
and disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
order by create_time desc
|
</select>
|
<select id="pageListCountDetail" resultType="com.ruoyi.system.vo.TPedigreeChartDetailVO">
|
select * from t_pedigree_chart_detail
|
where pedigree_chart_id = #{query.id}
|
and status = 1
|
and type = 2
|
and audit_status = 1
|
and disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
order by create_time desc
|
</select>
|
|
|
</mapper>
|