| | |
| | | <?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.InspectionItemMapper"> |
| | | <!--把原有的检验项目的数据清空--> |
| | | <update id="updateBatch"> |
| | | UPDATE mom_ocean.inspection_item o |
| | | <trim prefix="set" suffixOverrides=","> |
| | | <trim prefix="inspection_value=case" suffix="end,"> |
| | | <foreach collection="inspectionItems" item="item" index="index"> |
| | | WHEN o.id = #{item.id} THEN null |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="device_id=case" suffix="end,"> |
| | | <foreach collection="inspectionItems" item="item" index="index"> |
| | | WHEN o.id = #{item.id} THEN null |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="result=case" suffix="end,"> |
| | | <foreach collection="inspectionItems" item="item" index="index"> |
| | | WHEN o.id = #{item.id} THEN null |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="username=case" suffix="end,"> |
| | | <foreach collection="inspectionItems" item="item" index="index"> |
| | | WHEN o.id = #{item.id} THEN null |
| | | </foreach> |
| | | </trim> |
| | | </trim> |
| | | WHERE o.id in |
| | | <foreach collection="inspectionItems" index="index" item="item" separator="," open="(" close=")"> |
| | | #{item.id, jdbcType=BIGINT} |
| | | </foreach> |
| | | </update> |
| | | <resultMap id="selectInspectionItemMap" type="inspectionItemDto"> |
| | | <id property="father" column="ifather"/> |
| | | <association property="children" resultMap="selectInspectionItemDto2Map"/> |