Mybatis传入对象

 

 

 

@Column(name="stock_financing_id", length=255)
private String stockFinancingId;

List<Orders> queryByCondition(@Param("condition") Orders condition);
<result column="stock_financing_id" jdbcType="VARCHAR" property="stockFinancingId" />
<select id="queryByCondition" resultMap="BaseResultMap" parameterType="com.shawnway.trade.mybatis.pojo.InvestmentSummary" >
  select
  <include refid="Base_Column_List" />
  from investment_summary
  where 1 = 1
  <if test="condition.tradingAccountId != null">
    and trading_account_id = #{condition.tradingAccountId,jdbcType=INTEGER}
  </if>
  <if test="condition.customerId != null">
    and customer_id = #{condition.customerId,jdbcType=INTEGER}
  </if>
  <if test="condition.securityId != null">
    and security_id = #{condition.securityId,jdbcType=INTEGER}
  </if>
  <if test="condition.stockFinancingId != null">
    and stock_financing_id = #{condition.stockFinancingId,jdbcType=VARCHAR}
  </if>
</select>

 


相关推荐:

如何将列表中的每个元素传入函数进行批量处理

本文详解如何将列表中每个数值逐一传递给单参数函数(如温度转换函数),避免直接传入列表导致的类型错误,并提供列表推导式、map()和循环三种主流实现方式及最佳实践建议。 本文详解如何将列表中每个数值逐一传递给单参数函数(如温度转换函数),避免直接传入列表导致的类型错误,并提供列表推导式、map()和循...

Python 中字典 KeyError 的根本原因与对象哈希一致性问题解析

本文深入剖析Python字典出现KeyError的典型陷阱:即使键的哈希值看似存在,仍因对象身份(identity)与相等性(equality)逻辑不一致导致查找失败,重点聚焦__hash__与__eq__协议的正确实现。 本文深入剖析python字典出现keyerror的典型陷阱:即使键的哈希值看...

Python 字典 KeyError 的根本原因与对象哈希一致性问题解析

本文深入剖析Python字典出现KeyError的典型陷阱:即使键的哈希值看似存在,仍因对象身份(identity)与相等性(equality)不一致导致查找失败,重点揭示__hash__与__eq__协同失效的底层机制及修复方案。 本文深入剖析python字典出现keyerror的典型陷阱:即使键...