|
|
@@ -5,39 +5,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.yunfeiyun.agmp.fms.mapper.FmsSolarMapper">
|
|
|
|
|
|
<sql id="selectFmsSolarVo">
|
|
|
- select solarId, solarName, solarRemark, solarStartdate, solarDigest, year, tid
|
|
|
- from FmsSolar
|
|
|
+ select fs.solarId, solarName, solarStartdate, fsd.solarDigest,fsd.solarRemark
|
|
|
+ from FmsSolar fs
|
|
|
+ LEFT JOIN ( select * from FmsSolarinfo where tid = #{tid} ) fsd on fsd.solarId = fs.solarId
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectFmsSolarList" parameterType="FmsSolar" resultType="FmsSolar">
|
|
|
+ <select id="selectFmsSolarVoList" parameterType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo" resultType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo">
|
|
|
<include refid="selectFmsSolarVo"/>
|
|
|
<where>
|
|
|
- tid = #{tid}
|
|
|
- <if test="solarName != null and solarName != ''"> and solarName like concat('%', #{solarName}, '%')</if>
|
|
|
- <if test="solarRemark != null and solarRemark != ''"> and solarRemark = #{solarRemark}</if>
|
|
|
- <if test="solarStartdate != null and solarStartdate != ''"> and solarStartdate = #{solarStartdate}</if>
|
|
|
- <if test="solarDigest != null and solarDigest != ''"> and solarDigest = #{solarDigest}</if>
|
|
|
- <if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
+ <if test="solarName != null and solarName != ''"> and fs.solarName like concat('%', #{solarName}, '%')</if>
|
|
|
+ <if test="solarStartdate != null and solarStartdate != ''"> and fs.solarStartdate = #{solarStartdate}</if>
|
|
|
</where>
|
|
|
- order by solarStartdate
|
|
|
+ order by fs.solarStartdate
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectFmsSolarBySolarId" parameterType="String" resultType="FmsSolar">
|
|
|
+ <select id="selectFmsSolarBySolarId" parameterType="String" resultType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo">
|
|
|
<include refid="selectFmsSolarVo"/>
|
|
|
- where solarId = #{solarId} and tid = #{tid}
|
|
|
+ <where>
|
|
|
+ fs.solarId = #{solarId}
|
|
|
+ </where>
|
|
|
</select>
|
|
|
- <select id="selectFmsSolarBySolarName" parameterType="String" resultType="FmsSolar">
|
|
|
+ <select id="selectFmsSolarBySolarName" parameterType="String" resultType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo">
|
|
|
<include refid="selectFmsSolarVo"/>
|
|
|
- where solarName = #{solarName} and year = #{year} and tid = #{tid}
|
|
|
+ <where>
|
|
|
+ fs.solarName = #{solarName}
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getFmsSolarByDate" parameterType="FmsSolar" resultType="FmsSolar">
|
|
|
+ <select id="getFmsSolarByDate" parameterType="java.lang.String" resultType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo">
|
|
|
<include refid="selectFmsSolarVo"/>
|
|
|
<where>
|
|
|
- tid = #{tid} and year = #{year}
|
|
|
- <if test="solarStartdate != null and solarStartdate != ''">and solarStartdate <= #{solarStartdate}</if>
|
|
|
+ <if test="solarStartdate != null and solarStartdate != ''">and fs.solarStartdate <= #{solarStartdate}</if>
|
|
|
</where>
|
|
|
- order by solarStartdate desc limit 1
|
|
|
+ order by fs.solarStartdate desc limit 1
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertFmsSolar" parameterType="FmsSolar">
|
|
|
@@ -45,20 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="solarId != null">solarId,</if>
|
|
|
<if test="solarName != null">solarName,</if>
|
|
|
- <if test="solarRemark != null">solarRemark,</if>
|
|
|
<if test="solarStartdate != null">solarStartdate,</if>
|
|
|
- <if test="solarDigest != null">solarDigest,</if>
|
|
|
- <if test="year != null">year,</if>
|
|
|
- <if test="tid != null">tid,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="solarId != null">#{solarId},</if>
|
|
|
<if test="solarName != null">#{solarName},</if>
|
|
|
- <if test="solarRemark != null">#{solarRemark},</if>
|
|
|
<if test="solarStartdate != null">#{solarStartdate},</if>
|
|
|
- <if test="solarDigest != null">#{solarDigest},</if>
|
|
|
- <if test="year != null">#{year},</if>
|
|
|
- <if test="tid != null">#{tid},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -68,20 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="item.solarId != null">solarId,</if>
|
|
|
<if test="item.solarName != null">solarName,</if>
|
|
|
- <if test="item.solarRemark != null">solarRemark,</if>
|
|
|
<if test="item.solarStartdate != null">solarStartdate,</if>
|
|
|
- <if test="item.solarDigest != null">solarDigest,</if>
|
|
|
- <if test="item.year != null">year,</if>
|
|
|
- <if test="item.tid != null">tid,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="item.solarId != null">#{item.solarId},</if>
|
|
|
<if test="item.solarName != null">#{item.solarName},</if>
|
|
|
- <if test="item.solarRemark != null">#{item.solarRemark},</if>
|
|
|
<if test="item.solarStartdate != null">#{item.solarStartdate},</if>
|
|
|
- <if test="item.solarDigest != null">#{item.solarDigest},</if>
|
|
|
- <if test="item.year != null">#{item.year},</if>
|
|
|
- <if test="item.tid != null">#{item.tid},</if>
|
|
|
</trim>
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
@@ -90,9 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="updateFmsSolar" parameterType="FmsSolar">
|
|
|
update FmsSolar
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="solarRemark != null">solarRemark = #{solarRemark},</if>
|
|
|
<if test="solarStartdate != null">solarStartdate = #{solarStartdate},</if>
|
|
|
- <if test="solarDigest != null">solarDigest = #{solarDigest},</if>
|
|
|
</trim>
|
|
|
where solarId = #{solarId} and tid = #{tid}
|
|
|
</update>
|
|
|
@@ -101,22 +83,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<foreach collection="fmsSolarList" item="item" separator=";">
|
|
|
update FmsSolar
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="item.solarRemark != null">solarRemark = #{item.solarRemark},</if>
|
|
|
<if test="item.solarStartdate != null">solarStartdate = #{item.solarStartdate},</if>
|
|
|
- <if test="item.solarDigest != null">solarDigest = #{item.solarDigest},</if>
|
|
|
- <if test="tid != null">tid = #{item.tid},</if>
|
|
|
</trim>
|
|
|
- where solarName = #{item.solarName} and year = #{item.year}
|
|
|
- <if test="tid != null and tid !='' and tid != '-1'">
|
|
|
- and tid = #{tid}
|
|
|
- </if>
|
|
|
-
|
|
|
+ where solarName = #{item.solarName}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteFmsSolarBySolarId" parameterType="String">
|
|
|
delete from FmsSolar where solarId = #{solarId}
|
|
|
- <if test="tid != null and tid !='' and tid != '-1'">and tid = #{tid}</if>
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteFmsSolarBySolarIds" parameterType="String">
|
|
|
@@ -124,6 +98,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<foreach item="solarId" collection="array" open="(" separator="," close=")">
|
|
|
#{solarId}
|
|
|
</foreach>
|
|
|
- <if test="tid != null and tid !='' and tid != '-1'">and tid = #{tid}</if>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <insert id="insertFmsSolarinfo">
|
|
|
+ insert into FmsSolarinfo
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="solarId != null">solarId,</if>
|
|
|
+ <if test="solarDigest != null">solarDigest,</if>
|
|
|
+ <if test="solarRemark != null">solarRemark,</if>
|
|
|
+ <if test="tid != null">tid,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="solarId != null">#{solarId},</if>
|
|
|
+ <if test="solarDigest != null">#{solarDigest},</if>
|
|
|
+ <if test="solarRemark != null">#{solarRemark},</if>
|
|
|
+ <if test="tid != null">#{tid},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFmsSolarinfo">
|
|
|
+ update FmsSolarinfo
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="solarDigest != null">solarDigest = #{solarDigest},</if>
|
|
|
+ <if test="solarRemark != null">solarRemark = #{solarRemark},</if>
|
|
|
+ </trim>
|
|
|
+ where solarId = #{solarId} and tid = #{tid}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectFmsSolarList" resultType="com.yunfeiyun.agmp.fms.domain.FmsSolar">
|
|
|
+ select solarId, solarName, solarRemark, solarStartdate
|
|
|
+ from FmsSolar
|
|
|
+ <where>
|
|
|
+ <if test="solarName != null and solarName != ''"> and fs.solarName like concat('%', #{solarName}, '%')</if>
|
|
|
+ <if test="solarRemark != null and solarRemark != ''"> and fs.solarRemark = #{solarRemark}</if>
|
|
|
+ <if test="solarStartdate != null and solarStartdate != ''"> and fs.solarStartdate = #{solarStartdate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFmsSolarinfoBySolarId" resultType="com.yunfeiyun.agmp.fms.domain.vo.FmsSolarVo">
|
|
|
+ select solarId,solarDigest,solarRemark,tid from FmsSolarinfo where tid = #{tid} and solarId = #{solarId}
|
|
|
+ </select>
|
|
|
</mapper>
|