|
|
@@ -5,15 +5,13 @@
|
|
|
<resultMap type="com.goafanti.common.model.PublicAssistDetails" id="PublicAssistDetailsMap">
|
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
<result property="prid" column="prid" jdbcType="INTEGER"/>
|
|
|
- <result property="pid" column="pid" jdbcType="VARCHAR"/>
|
|
|
- <result property="pname" column="pname" jdbcType="VARCHAR"/>
|
|
|
<result property="type" column="type" jdbcType="VARCHAR"/>
|
|
|
<result property="contentType" column="content_type" jdbcType="INTEGER"/>
|
|
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="PublicAssistDetailsAllSql">
|
|
|
- id, prid, pid, pname, type, content_type, content
|
|
|
+ id, prid, type, content_type, content
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -26,28 +24,26 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
- values (#{prid}, #{pid}, #{pname}, #{type}, #{contentType}, #{content})
|
|
|
+ insert into public_assist_details(prid, type, content_type, content)
|
|
|
+ values (#{prid}, #{type}, #{contentType}, #{content})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
- insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
+ insert into public_assist_details(prid, type, content_type, content)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.prid}, #{entity.pid}, #{entity.pname}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
+ (#{entity.prid}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
+ insert into public_assist_details(prid, type, content_type, content)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.prid}, #{entity.pid}, #{entity.pname}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
+ (#{entity.prid}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
prid = values(prid),
|
|
|
- pid = values(pid),
|
|
|
- pname = values(pname),
|
|
|
type = values(type),
|
|
|
content_type = values(content_type),
|
|
|
content = values(content)
|
|
|
@@ -60,12 +56,6 @@
|
|
|
<if test="prid != null">
|
|
|
prid = #{prid},
|
|
|
</if>
|
|
|
- <if test="pid != null and pid != ''">
|
|
|
- pid = #{pid},
|
|
|
- </if>
|
|
|
- <if test="pname != null and pname != ''">
|
|
|
- pname = #{pname},
|
|
|
- </if>
|
|
|
<if test="type != null and type != ''">
|
|
|
type = #{type},
|
|
|
</if>
|
|
|
@@ -92,12 +82,6 @@
|
|
|
<if test="prid != null">
|
|
|
and prid = #{prid}
|
|
|
</if>
|
|
|
- <if test="pid != null and pid != ''">
|
|
|
- and pid = #{pid}
|
|
|
- </if>
|
|
|
- <if test="pname != null and pname != ''">
|
|
|
- and pname = #{pname}
|
|
|
- </if>
|
|
|
<if test="type != null and type != ''">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
|
@@ -124,12 +108,6 @@
|
|
|
<if test="prid != null">
|
|
|
and prid = #{prid}
|
|
|
</if>
|
|
|
- <if test="pid != null and pid != ''">
|
|
|
- and pid = #{pid}
|
|
|
- </if>
|
|
|
- <if test="pname != null and pname != ''">
|
|
|
- and pname = #{pname}
|
|
|
- </if>
|
|
|
<if test="type != null and type != ''">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
|
@@ -142,7 +120,6 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
<!--通过主键删除-->
|
|
|
<delete id="deleteById">
|
|
|
delete
|
|
|
@@ -151,10 +128,11 @@
|
|
|
</delete>
|
|
|
|
|
|
<select id="selectByPrid" resultMap="PublicAssistDetailsMap">
|
|
|
- select
|
|
|
- <include refid="PublicAssistDetailsAllSql"/>
|
|
|
- from public_assist_details
|
|
|
- where prid = #{id}
|
|
|
+ select
|
|
|
+ <include refid="PublicAssistDetailsAllSql"/>
|
|
|
+ from public_assist_details
|
|
|
+ where prid = #{id}
|
|
|
</select>
|
|
|
+
|
|
|
</mapper>
|
|
|
|