zss
2024-07-11 a3ba94e23fec4281502a94221f65cc0567eb02a8
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
<?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.InsProductResultMapper">
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsProductResult">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="insProductId" column="ins_product_id" jdbcType="INTEGER"/>
        <result property="insValue" column="ins_value" jdbcType="VARCHAR"/>
        <result property="comValue" column="com_value" jdbcType="VARCHAR"/>
        <result property="equipValue" column="equip_value" jdbcType="VARCHAR"/>
        <result property="createUser" column="create_user" jdbcType="INTEGER"/>
        <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <select id="selDetail" resultMap="BaseResultMap">
        select *
        from ins_product_result
        where 1=1
            <!--and ins_product_id in (#{ips})-->
        <if test="ips != null and ips.size() > 0">
            <!-- 使用foreach元素构建IN子句 -->
            and ins_product_id in
            <foreach item="item" collection="ips" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>