mysql where条件中的判断语句

mysql where条件中的判断语句 


AND CASE 1 WHEN "Y"=(SELECT is_open from category as oca where oca.category_id=#{categoryId,jdbcType=VARCHAR}) 
THEN (cat.category_id = #{categoryId,jdbcType=VARCHAR} OR cat.parent_id = #{categoryId,jdbcType=VARCHAR}) 
ELSE (cat.category_id = #{categoryId,jdbcType=VARCHAR}) 
END

mybatis的配置文件:

	
	


你可能感兴趣的:(mysql,mybatis)