zss
2023-08-18 6170908b69269ee14eae05787eafe682fda00eef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?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.yuanchu.mom.mapper.RawInspectMapper">
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.RawInspect">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="code" column="code" jdbcType="VARCHAR"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="specifications" column="specifications" jdbcType="VARCHAR"/>
        <result property="unit" column="unit" jdbcType="VARCHAR"/>
        <result property="number" column="number" jdbcType="INTEGER"/>
        <result property="insState" column="ins_state" jdbcType="INTEGER"/>
        <result property="judgeState" column="judge_state" jdbcType="INTEGER"/>
        <result property="insTime" column="ins_time" jdbcType="DATE"/>
        <result property="userName" column="user_name" jdbcType="VARCHAR"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="DATE"/>
        <result property="updateTime" column="update_time" jdbcType="DATE"/>
        <result property="formTime" column="form_time" jdbcType="DATE"/>
    </resultMap>
    <select id="selectRawInspectsByLimit" resultType="com.yuanchu.mom.pojo.RawInspect">
        select id, code, name, specifications, unit, number, ins_state, judge_state, ins_time, user_name, create_time,
        form_time
        from mom_ocean.raw_inspect
        where state = 1
        <if test="formTime!=null and formTime!=''">
            and form_time = #{formTime}
        </if>
        <if test="createTime!=null and createTime!=''">
            and create_time = #{createTime}
        </if>
        <if test="insState!=2">
            and ins_state = #{insState}
        </if>
        <if test="judgeState!=2">
            and judge_state = #{judgeState}
        </if>
        order by id desc
        limit #{pageSize},#{countSize}
    </select>
    <select id="selCountRaw" resultType="java.lang.Integer">
        select count(id)
        from mom_ocean.raw_inspect
        where state=1
        and ins_state=1
        and judge_state=#{judgeState}
        <if test="begin != null and begin!=''">
            and raw_inspect.create_time &gt;= #{begin}
        </if>
        <if test="end != null and end!=''">
            and raw_inspect.create_time &lt;= #{end}
        </if>
    </select>
    <select id="seAllCount" resultType="java.lang.Long">
        select count(id)
        from mom_ocean.raw_inspect
        where state=1
        <if test="begin != null and begin!=''">
            and raw_inspect.create_time &gt;= #{begin}
        </if>
        <if test="end != null and end!=''">
            and raw_inspect.create_time &lt;= #{end}
        </if>
    </select>
</mapper>