<?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="org.springblade.capcancel.mapper.CapCancelListMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.capcancel.entity.CapCancelList">
        <result column="THEMONTH" property="themonth"/>
        <result column="SPID" property="spid"/>
        <result column="SPNAME" property="spname"/>
        <result column="USERID" property="userid"/>
        <result column="PROVINCE" property="province"/>
        <result column="AREA" property="area"/>
        <result column="ORDERTIME" property="ordertime"/>
        <result column="OUTPUT" property="output"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        THEMONTH, SPID, SPNAME, USERID, PROVINCE, AREA, ORDERTIME, OUTPUT
    </sql>

    <select id="getListByMonth" resultType="org.springblade.capcancel.vo.CapCancelListVO">
        select
        SPID,
        SPNAME,
        USERID,
        PROVINCE,
        AREA,
        to_char(ORDERTIME,'yyyy-mm-dd hh24:mi:ss') AS ORDERTIME
        FROM CAP_CANCEL_LIST where OUTPUT = 1
        AND THEMONTH = #{month}
        ORDER BY PROVINCE,AREA
    </select>

</mapper>
