<select id="findListByQuery" resultMap="BaseResultMap" parameterType="cn.shusang.domain.ccg.ctx.CardInfoContext" >
select
<include refid="Base_Column_List" />
from card_info as a
where a.is_delete = 'N'
<if test="nameLike!=null and nameLike.trim() != ''">
AND a.name like CONCAT('%',#{nameLike},'%')
</if>
<if test="ruleDesc!=null and ruleDesc.trim() != ''">
AND a.rule_desc like CONCAT('%',#{ruleDesc},'%')
</if>
<if test="categoryCode!=null and categoryCode != ''">
AND a.category_code = #{categoryCode}
</if>
<if test="subCategoryCode!=null and subCategoryCode != ''">
AND a.sub_category_code = #{subCategoryCode}
</if>
<if test="printNumber!=null">
AND a.print_number = #{printNumber}
</if>
<if test="seriesCodes!=null and seriesCodes.size()!=0">
AND a.series_code IN
<foreach collection="seriesCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="rareDegreeCodes!=null and rareDegreeCodes.size()!=0">
AND a.rare_degree_code IN
<foreach collection="rareDegreeCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="(combatQuantitys!=null and combatQuantitys.size()!=0) or combatQuantityGreaterThanOrEqualTo != null or combatQuantityLessThanOrEqualTo != null">
<trim prefix="AND (" suffix=")" prefixOverrides="OR">
<if test="combatQuantityGreaterThanOrEqualTo != null">
a.combat_quantity <![CDATA[ >= ]]> #{combatQuantityGreaterThanOrEqualTo}
</if>
<if test="combatQuantityLessThanOrEqualTo != null">
or a.combat_quantity <![CDATA[ <= ]]> #{combatQuantityLessThanOrEqualTo}
</if>
<if test="combatQuantitys!=null and combatQuantitys.size()!=0">
or a.combat_quantity IN
<foreach collection="combatQuantitys" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</trim>
</if>
<if test="(energyConsumes!=null and energyConsumes.size()!=0) or energyConsumeGreaterThanOrEqualTo != null">
<trim prefix="AND (" suffix=")" prefixOverrides="OR">
<if test="energyConsumeGreaterThanOrEqualTo != null">
a.energy_consume <![CDATA[ >= ]]> #{energyConsumeGreaterThanOrEqualTo}
</if>
<if test="energyConsumes!=null and energyConsumes.size()!=0">
or a.energy_consume IN
<foreach collection="energyConsumes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</trim>
</if>
<choose>
<when test="orderBy!=null and orderBy!=''">
ORDER BY a.${orderBy}
</when>
<otherwise>
ORDER BY a.update_time DESC
</otherwise>
</choose>
</select>
文章来源地址https://www.toymoban.com/news/detail-725626.html
文章来源:https://www.toymoban.com/news/detail-725626.html
到了这里,关于常用mybatis的XML的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!