<?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.ruoyi.web.v2.mapper.JsStockInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.web.v2.entity.JsStockInfo">
        <id column="id" property="id" />
        <result column="number" property="number" />
        <result column="create_time" property="createTime" />
        <result column="material_name" property="materialName" />
    </resultMap>
    <select id="listPage" resultType="com.ruoyi.web.v2.entity.JsStockInfo">
 SELECT SUM(in_num)  in_num ,SUM(out_num)  out_num ,`number` ,DATE_FORMAT(create_time,'%Y-%m-%d') create_time   ,material_name ,linghuoren FROM `js_stock_info`
${ew.customSqlSegment}
          GROUP BY `material_name` , DATE_FORMAT(create_time,'%Y-%m-%d') , linghuoren
    </select>
    <select id="listList" resultType="com.ruoyi.web.v2.entity.JsStockInfo">
        SELECT SUM(in_num)  in_num ,SUM(out_num)  out_num ,`number` ,DATE_FORMAT(create_time,'%Y-%m-%d') create_time   ,material_name ,linghuoren FROM `js_stock_info`
${ew.customSqlSegment}
          GROUP BY `material_name` , DATE_FORMAT(create_time,'%Y-%m-%d') , linghuoren
    </select>

</mapper>
