123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.demo.mapper.StatisticsMapper">
- <select id="selectTotal" resultType="java.lang.Integer">
- SELECT
- COUNT(*)
- FROM
- `dl_statistics`
- WHERE behavior = 0
- AND deleted = 0;
- </select>
- <select id="selectUserIdsByEquipmentCode" resultType="java.lang.String">
- SELECT DISTINCT
- user_id
- FROM
- `dl_statistics`
- WHERE
- equipment_code = #{equipmentCode};
- </select>
- <select id="selectScanByEquipmentCode" resultType="java.lang.Integer">
- SELECT
- COUNT(*)
- FROM
- `dl_statistics`
- WHERE
- equipment_code = #{equipmentCode}
- AND behavior = 0;
- </select>
- <select id="selectDealCountByEquipmentCode" resultType="java.lang.Integer">
- SELECT
- SUM(deal_tool_count)
- FROM
- `dl_statistics`
- WHERE
- equipment_code = #{equipmentCode}
- AND behavior = 1;
- </select>
- <select id="selectTimeDisByMonth" resultType="java.lang.Integer">
- SELECT
- COUNT(*) count
- FROM
- `dl_statistics`
- WHERE behavior = 0
- <if test="month != null">
- AND DATE_FORMAT(`time`,'%Y-%m') = #{month}
- </if>;
- </select>
- <select id="selectTimeDisByDay" resultType="java.lang.Integer">
- SELECT
- COUNT(*) count
- FROM
- `dl_statistics`
- WHERE behavior = 0
- <if test="day != null">
- AND DATE_FORMAT(`time`,'%Y-%m-%d') = #{day}
- </if>;
- </select>
- <select id="selectTimeDisByYear" resultType="java.lang.Integer">
- SELECT
- COUNT(*) count
- FROM
- `dl_statistics`
- WHERE behavior = 0
- <if test="year != null">
- AND DATE_FORMAT(`time`,'%Y') = #{year}
- </if>;
- </select>
- <select id="selectTotalPriceByEquipmentCode" resultType="java.math.BigDecimal">
- SELECT
- SUM(
- CONVERT (
- deal_tool_price,
- DECIMAL (16, 2)
- )
- )
- FROM
- `dl_statistics`
- WHERE
- equipment_code = #{equipmentCode}
- AND behavior = 1;
- </select>
- </mapper>
|