mitao
3 天以前 dfe379f10f5d16a3b34b33f260d3a7ca97c7fdc6
ruoyi-system/src/main/resources/mapper/system/CaseMainMapper.xml
@@ -20,5 +20,31 @@
    <sql id="Base_Column_List">
        id, case_name, create_time, create_by, update_time, update_by, disabled, case_year, type_id, dept_id
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.model.CaseMain">
        select t1.*,t2.type_name as typeName,t3.dept_name as deptName from case_main t1
        left join case_type t2 on t1.type_id = t2.id
        left join sys_dept t3 on t1.dept_id = t3.dept_id
        where 1=1
        <if test="query.caseName != null and query.caseName != ''">
            and t1.case_name like concat('%',#{query.caseName},'%')
        </if>
        <if test="query.caseYear != null and query.caseYear != ''">
            and t1.case_year like concat('%',#{query.caseYear},'%')
        </if>
        <if test="query.typeId != null">
            and t1.type_id = #{query.typeId}
        </if>
        <if test="query.startTime != null and query.startTime != ''">
            and t1.update_time >= #{query.startTime}
        </if>
        <if test="query.endTime != null and query.endTime != ''">
            and t1.update_time &lt;= #{query.endTime}
        </if>
        and t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by t1.update_time desc
    </select>
</mapper>