<?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="org.jeecg.modules.projectManagement.mapper.FdMilestonesProgressChangeMapper">
    <select id="getByChangeTime" resultType="org.jeecg.modules.projectManagement.entity.FdMilestonesProgressChange">
        SELECT
            *
        FROM
            fd_milestones_progress_change mpc
        WHERE
            1 = 1
            <if test="startDate!=null and startDate!='' and startDate!='null'">
                <![CDATA[ and DATE_FORMAT(mpc.change_time,'%Y-%m-%d') >=DATE_FORMAT(#{startDate},'%Y-%m-%d') ]]>
            </if>
            <if test="endDate!=null and endDate!='' and endDate!='null'">
                <![CDATA[ and DATE_FORMAT(mpc.change_time,'%Y-%m-%d') <=DATE_FORMAT(#{endDate},'%Y-%m-%d') ]]>
            </if>
        GROUP BY
            mpc.milestones_id
        ORDER BY
            mpc.create_time DESC
    </select>
</mapper>