mybatis 之 resultType="Integer"

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis 之 resultType="Integer"相关的知识,希望对你有一定的参考价值。


public class EcPromoteRuleAdditionalNew extends BaseBO {


    private String[] promoteRuleIds;

    public String[] getPromoteRuleIds() {
        return promoteRuleIds;
    }

    public void setPromoteRuleIds(String[] promoteRuleIds) {
        this.promoteRuleIds = promoteRuleIds;
    }

}

 


if (!allUsedPromoteRuleIds.equals("")) { allUsedPromoteRuleIds = allUsedPromoteRuleIds.substring(0, allUsedPromoteRuleIds.lastIndexOf(",")); } // 根据促销规则查询是否不支持货到付款 if (allUsedPromoteRuleIds != null && !allUsedPromoteRuleIds.equals("")) { EcPromoteRuleAdditionalNew promoteRuleAdditional = new EcPromoteRuleAdditionalNew(); promoteRuleAdditional.setPromoteRuleIds(allUsedPromoteRuleIds .split(",")); Integer count = myecService .getAdditionalKDFHCount(promoteRuleAdditional);
<!-- 根据促销规则查询附加优惠是否支持货到付款 -->
  <select id="getAdditionalKDFHCount"  resultType="Integer" parameterType="EcPromoteRuleAdditionalNew">
           select count(1)
         from ec_promote_rule_new pr,
              ec_promote_rule_ADDITIONAL_NEW pra
         where pr.promote_rule_id = pra.promote_rule_id
               and pra.additional_type = FKFS
               and pra.additional_value = KDFH
                <if test="promoteRuleIds != null">
                    and pra.PROMOTE_RULE_ID in
                    <foreach collection="promoteRuleIds" index="index" item="item" open="(" separator="," close=")">
                           #{item}
                     </foreach>
                </if>
  </select>

 

以上是关于mybatis 之 resultType="Integer"的主要内容,如果未能解决你的问题,请参考以下文章

MyBatis映射文件 之 resultType 自动映射

MyBatis应用开发(10)映射之结果映射resultType

mybatis 之 resultType="Integer"

mybatis 之resultType="Map"

mybatis 之resultType="HashMap" parameterType="list"

mybatis <foreach>标签问题