| | |
| | | </set> |
| | | where po_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!-- 统计 --> |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'</if> |
| | | </sql> |
| | | <sql id="Count_Select_DateType"> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'</if> |
| | | </sql> |
| | | <sql id="Count_Group_DateType"> |
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')</if> |
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y')</if> |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(`po_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_pdd_order` t WHERE po_order_create_time IS NOT NULL |
| | | <include refid="Count_Select_DateType" /> |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY po_order_create_time |
| | | </select> |
| | | |
| | | |
| | | </mapper> |