Ver Fonte

采美百科bugfix

kaick há 1 ano atrás
pai
commit
2f3ad2b0e3
1 ficheiros alterados com 41 adições e 7 exclusões
  1. 41 7
      src/main/resources/mapper/PageMapper.xml

+ 41 - 7
src/main/resources/mapper/PageMapper.xml

@@ -1478,13 +1478,47 @@
     </insert>
 
     <insert id="insertreference">
-        insert into cm_baike_reference_info(referenceType, website, articleName, websiteName, publishTime,
-                                            acitationTime, author, workName, publicationPlace, press, publicationYear,
-                                            acitationWeb, referenceDescription, imageDescription, imageUrl, productId,
-                                            productType, ctrlId)
-        values (#{referenceType}, #{website}, #{articleName}, #{websiteName}, #{publishTimeStr}, #{acitationTimeStr},
-                #{author}, #{workName}, #{publicationPlace}, #{press}, #{publicationYearStr}, #{acitationWeb},
-                #{referenceDescription}, #{imageDescription}, #{imageUrl}, #{entryId}, #{entryType}, #{ctrlId})
+        insert into cm_baike_reference_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="referenceType != null and referenceType != ''">referenceType,</if>
+            <if test="website != null and website != ''">website,</if>
+            <if test="articleName != null and articleName != ''">articleName,</if>
+            <if test="websiteName != null and websiteName != ''">websiteName,</if>
+            <if test="publishTimeStr != null and publishTimeStr != ''">publishTime,</if>
+            <if test="acitationTimeStr != null and acitationTimeStr != ''">acitationTime,</if>
+            <if test="author != null and author != ''">author,</if>
+            <if test="workName != null and workName != ''">workName,</if>
+            <if test="publicationPlace != null and publicationPlace != ''">publicationPlace,</if>
+            <if test="press != null and press != ''">press,</if>
+            <if test="publicationYearStr != null and publicationYearStr != ''">publicationYear,</if>
+            <if test="acitationWeb != null and acitationWeb != ''">acitationWeb,</if>
+            <if test="referenceDescription != null and referenceDescription != ''">referenceDescription,</if>
+            <if test="imageDescription != null and imageDescription != ''">imageDescription,</if>
+            <if test="imageUrl != null and imageUrl != ''">imageUrl,</if>
+            <if test="entryId != null">productId,</if>
+            <if test="entryType != null and entryType != ''">productType,</if>
+            <if test="ctrlId != null and ctrlId != ''">ctrlId,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="referenceType != null and referenceType != ''">#{referenceType},</if>
+            <if test="website != null and website != ''">#{website},</if>
+            <if test="articleName != null and articleName != ''">#{articleName},</if>
+            <if test="websiteName != null and websiteName != ''">#{websiteName},</if>
+            <if test="publishTimeStr != null and publishTimeStr != ''">#{publishTimeStr},</if>
+            <if test="acitationTimeStr != null and acitationTimeStr != ''">#{acitationTimeStr},</if>
+            <if test="author != null and author != ''">#{author},</if>
+            <if test="workName != null and workName != ''">#{workName},</if>
+            <if test="publicationPlace != null and publicationPlace != ''">#{publicationPlace},</if>
+            <if test="press != null and press != ''">#{press},</if>
+            <if test="publicationYearStr != null and publicationYearStr != ''">#{publicationYearStr},</if>
+            <if test="acitationWeb != null and acitationWeb != ''">#{acitationWeb},</if>
+            <if test="referenceDescription != null and referenceDescription != ''">#{referenceDescription},</if>
+            <if test="imageDescription != null and imageDescription != ''">#{imageDescription},</if>
+            <if test="imageUrl != null and imageUrl != ''">#{imageUrl},</if>
+            <if test="entryId != null">#{entryId},</if>
+            <if test="entryType != null and entryType != ''">#{entryType},</if>
+            <if test="ctrlId != null and ctrlId != ''">#{ctrlId},</if>
+        </trim>
     </insert>
 
     <select id="getShopid" resultType="java.lang.Integer">