maven
昨天 61b1802b1b26fc35c07fd09edc4ff2ff8ade6688
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
<?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.safe.mapper.SafeAccidentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.safe.pojo.SafeAccident">
        <id column="id" property="id" />
        <result column="accident_code" property="accidentCode" />
        <result column="accident_name" property="accidentName" />
        <result column="accident_type" property="accidentType" />
        <result column="happen_time" property="happenTime" />
        <result column="happen_location" property="happenLocation" />
        <result column="accident_grade" property="accidentGrade" />
        <result column="accident_cause" property="accidentCause" />
        <result column="root_cause" property="rootCause" />
        <result column="person_loss" property="personLoss" />
        <result column="asset_loss" property="assetLoss" />
        <result column="production_loss" property="productionLoss" />
        <result column="handle_measures" property="handleMeasures" />
        <result column="responsible_person" property="responsiblePerson" />
        <result column="remark" property="remark" />
        <result column="create_time" property="createTime" />
        <result column="create_user" property="createUser" />
        <result column="update_time" property="updateTime" />
        <result column="update_user" property="updateUser" />
        <result column="tenant_id" property="tenantId" />
    </resultMap>
    <select id="pageSafeAccident" resultType="com.ruoyi.safe.pojo.SafeAccident">
        select sa.*,
               su.nick_name createUserName,
        from safe_accident sa
        left join sys_user su on sa.create_user = su.user_id
        where 1=1
        <if test="c.accidentCode != null and c.accidentCode != ''">
            and sa.accident_code like concat('%', #{c.accidentCode}, '%')
        </if>
        <if test="c.accidentName != null and c.accidentName != ''">
            and sa.accident_name like concat('%', #{c.accidentName}, '%')
        </if>
        <if test="c.accidentType != null and c.accidentType != ''">
            and sa.accident_type like concat('%', #{c.accidentType}, '%')
        </if>
        <if test="c.accidentGrade != null and c.accidentGrade != ''">
            and sa.accident_grade like concat('%', #{c.accidentGrade}, '%')
        </if>
    </select>
 
</mapper>