puzhibing
6 天以前 fccb84b175884930aacfa3531c5bdb4333f8c851
ruoyi-system/target/classes/mapper/system/TTrainLibraryMapper.xml
@@ -23,11 +23,12 @@
        <result column="status" property="status" />
        <result column="type" property="type" />
        <result column="signature" property="signature" />
        <result column="project_id" property="projectId" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, strain_code, strain_name, create_time, update_time, create_by, update_by, disabled, strain_source, appraisal_method, features, save_method, save_location, stock, remark, status, `type`, signature,is_draft
        id, strain_code, strain_name, project_id, create_time, update_time, create_by, update_by, disabled, strain_source, appraisal_method, features, save_method, save_location, stock, remark, status, `type`, signature,is_draft
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TTrainLibraryVO">
        select
@@ -49,9 +50,15 @@
        <if test="query.isDraft != null">
                and is_draft = #{query.isDraft}
            </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
        order by strain_code desc
    </select>
    <select id="getDetailById" resultType="com.ruoyi.system.vo.TTrainLibraryWarehousingVO">
        select t1.* from t_train_library_warehousing t1
@@ -61,5 +68,43 @@
        order by create_time desc
    </select>
    <!-- 新增:查询所有数据(不分页) -->
    <select id="listAll" resultType="com.ruoyi.system.vo.TTrainLibraryVO">
        select
        <include refid="Base_Column_List"/>
        from t_train_library
        <where>
            <if test="query.strainCode != null and query.strainCode != ''">
                and strain_code like concat('%', #{query.strainCode}, '%')
            </if>
            <if test="query.strainName != null and query.strainName != ''">
                and strain_name like concat('%', #{query.strainName}, '%')
            </if>
            <if test="query.status != null">
                and status = #{query.status}
            </if>
            <if test="query.type != null">
                and `type` = #{query.type}
            </if>
            <if test="query.isDraft != null">
                and is_draft = #{query.isDraft}
            </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>
            <!-- 时间范围查询 -->
            <if test="query.startTime != null and query.startTime != ''">
                and create_time >= #{query.startTime}
            </if>
            <if test="query.endTime != null and query.endTime != ''">
                and create_time &lt;= #{query.endTime}
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by strain_code desc
    </select>
</mapper>