IMSaleStatMapper.xml 972 字节
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sibu.orderHelper.integral.web.dao.IMSaleStatDao">
  <resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMStoreSaleStatBean">
    <result column="money" jdbcType="VARCHAR" property="money" />
    <result column="integral" jdbcType="VARCHAR" property="integral" />
  </resultMap>

  <select id="selectByDate" parameterType="map" resultMap="BaseResultMap">
    select * from
    <foreach collection="tableNames" open="((" close="))" separator=") UNION ALL (" item="tableName">
    SELECT
    Sum(total_money) AS money,
    Sum(total_integral) AS integral
    FROM
      ${tableName}
    WHERE
      pay_dt >= #{startDt}
    AND
      <![CDATA[
      pay_dt <= #{endDt}
      ]]>
    AND
      order_status IN (3,4,5,8,100)
    LIMIT 1
    </foreach>
    as temp
  </select>

</mapper>