mybatis sql判断多个元素不为空
SELECT * FROM result co where <if test="projectId != null"> co.projectId=#{projectId} and </if> <if test="startTime!=null and endTime!=null"> modifyTime between #{startTime} and #{endTime} </if> <if test="startTime!=null and endTime==null ">
modifyTime>= #{startTime} </if> order by co.id desc;
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号