The year and month in the database table are separate fields, how to spell the time as the query condition

     <if test="startTime!= null and startTime != ''">
                    AND TO_DATE( CONCAT( CONCAT( year, '-' ), month ), 'yyyy-mm' ) <![CDATA[ >= ]]> to_date( #{startTime}, 'yyyy-MM-dd' );
                </if>
                <if test="endTime!= null and endTime!=''">
                    AND TO_DATE( CONCAT( CONCAT( year, '-' ), month ), 'yyyy-mm' ) <![CDATA[ <= ]]> to_date( #{endTime}, 'yyyy-MM-dd' );
                </if>

CONCAT is to splice two fields

Guess you like

Origin blog.csdn.net/linsenaa/article/details/118338656