highChartsOneMappingSql
因为分析历史数据展示图表。在新建一个类后想在该类的基础上能兼容查询其他表格数据。 考虑使用mybatis 的 xml映射。属性字段与表字段一一对应。
<select id="findHighChartsOneList" resultType="全限定名">
SELECT
<include refid="highChartsOneMappingSql"/>
FROM high_charts_one a
<include refid="highChartsOneMappingSqlJoins"/>
<where>
a.thisday_a > (sysdate -40) and (
a.warehouse_a = #{warehouse.id} or o1.parent_ids like '%'||#{warehouse.id} ||'%' )
</where>
ORDER BY a.line_code_a , a.thisday_a
</select>
其中
<sql id="highChartsOneMappingSql">
a.org_code_a AS "org_code_a",
a.line_code_a AS "line_code_a",
a.COUNT_A AS "COUNT_A",
a.milli_A AS "milli_A",
a.thisday_A AS "thisday_A",
a.out_wh_qt_a AS "out_wh_qt_a",
a.msg_a AS "msg_a",
a.warehouse_a AS "warehouse_a"
</sql>
在我这次错误中,出现问题的原因是属性字段名称带下划线,正确的做法是使用驼峰格式命名,问题解决。天天都要进步。