“djh”
7 天以前 994de8bc7067afc1e32043eeeaabdda60d400ef1
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
<?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>
 
</mapper>