51 lines
1.5 KiB
XML
51 lines
1.5 KiB
XML
<?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._3e.dao.ContrastDao">
|
|
|
|
|
|
<insert id= "addContrast" parameterType="com._3e.entity.Contrast" >
|
|
insert into Contrast (sourceId,source,type,targetId,name,memo)
|
|
values (#{sourceId},#{source},#{type},#{targetId},#{name},#{memo})
|
|
</insert>
|
|
|
|
<select id= "getContrast" parameterType="map" resultType="com._3e.entity.Contrast" >
|
|
select sourceId,source,type,targetId,name,memo from Contrast
|
|
where source=#{source} and type=#{type}
|
|
<if test="targetId!=null">
|
|
and targetId=#{targetId}
|
|
</if>
|
|
|
|
<if test="sourceId!=null">
|
|
and sourceId = #{sourceId}
|
|
</if>
|
|
|
|
|
|
</select>
|
|
<select id= "getContrasts" parameterType="map" resultType="com._3e.entity.Contrast" >
|
|
select sourceId,source,type,targetId,name,memo from Contrast
|
|
where source=#{source} and type=#{type}
|
|
<if test="targetId!=null">
|
|
and targetId=#{targetId}
|
|
</if>
|
|
|
|
<if test="sourceIds!=null">
|
|
and sourceId in
|
|
<foreach item="sourceid" index="index" collection="sourceIds"
|
|
open="(" separator="," close=")">
|
|
#{sourceid}
|
|
</foreach>
|
|
</if>
|
|
|
|
|
|
</select>
|
|
<select id="getContrastList" resultType="com._3e.entity.Contrast">
|
|
select sourceId,source,type,targetId,name,memo from Contrast
|
|
where source=#{source} and type=#{type} and targetId in
|
|
<foreach item="targetId" index="index" collection="targetIds" open="(" separator="," close=")">
|
|
#{targetId}
|
|
</foreach>
|
|
</select>
|
|
</mapper>
|