“djh”
8 天以前 ab25f94a1e593001bf993d182f9a3860fd098583
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
67
68
<?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.gkhy.exam.system.mapper.ProductItemMapper">
    <update  id="deletedByCompanyId">
        update product_item SET del_flag =2 where company_id = #{companyId} and type = #{type}
    </update>
 
    <select id="selectProductItemList" resultType="com.gkhy.exam.system.domain.ProductItem">
        SELECT
            pi.`id`,
            pi.`catalogue_id`,
            CONCAT(c.`number`, ' ', c.`mess`) AS catalogue_name,
            pi.`company_id`,
            sc.`name` as company_name,
            pi.`number`,
            pi.`erdact`,
            pi.`type`,
            pi.`file_name`,
            pi.`file_path`,
            pi.`del_flag`,
            pi.`create_by`,
            pi.`create_time`,
            pi.`update_by`,
            pi.`update_time`
        FROM
            product_item pi
                LEFT JOIN sys_company sc on pi.company_id = sc.id
        left join catalogue c on pi.catalogue_id = c.id
        WHERE
            pi.del_flag = 1 and pi.type = #{type}
        <if test="companyId!=null and companyId!=''">
            and pi.company_id =#{companyId}
        </if>
        <if test="catalogueId!=null and catalogueId!=''">
            and pi.catalogue_id = #{catalogueId}
        </if>
        ORDER BY
            pi.create_time ASC
    </select>
    <select id="writeProduct" resultType="com.gkhy.exam.system.domain.ProductItem">
        SELECT
        pi.`id`,
        pi.`catalogue_id`,
        c.`mess` as catalogue_name,
        pi.`company_id`,
        sc.`name` as company_name,
        pi.`number`,
        pi.`erdact`,
        pi.`file_name`,
        pi.`file_path`,
        pi.`del_flag`,
        pi.`create_by`,
        pi.`create_time`,
        pi.`update_by`,
        pi.`update_time`
        FROM
        product_item pi
        LEFT JOIN sys_company sc on pi.company_id = sc.id
        left join catalogue c on pi.catalogue_id = c.id
        WHERE
        pi.del_flag = 1 and pi.company_id = #{companyId}  and pi.catalogue_id in
        (<foreach collection="catalogueIds" item="catalogueId" separator=",">
            #{catalogueId}
         </foreach>)
        ORDER BY
        pi.create_time ASC
    </select>
</mapper>