|
|
@@ -5,13 +5,15 @@
|
|
|
<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="type" column="type" 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, type, content_type, content
|
|
|
+ id, prid, pid, pname, type, content_type, content
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -24,26 +26,28 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into public_assist_details(prid, type, content_type, content)
|
|
|
- values (#{prid}, #{type}, #{contentType}, #{content})
|
|
|
+ insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
+ values (#{prid}, #{pid}, #{pname}, #{type}, #{contentType}, #{content})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
- insert into public_assist_details(prid, type, content_type, content)
|
|
|
+ insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.prid}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
+ (#{entity.prid}, #{entity.pid}, #{entity.pname}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into public_assist_details(prid, type, content_type, content)
|
|
|
+ insert into public_assist_details(prid, pid, pname, type, content_type, content)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.prid}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
+ (#{entity.prid}, #{entity.pid}, #{entity.pname}, #{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)
|
|
|
@@ -56,7 +60,13 @@
|
|
|
<if test="prid != null">
|
|
|
prid = #{prid},
|
|
|
</if>
|
|
|
- <if test="type != null">
|
|
|
+ <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>
|
|
|
<if test="contentType != null">
|
|
|
@@ -82,7 +92,13 @@
|
|
|
<if test="prid != null">
|
|
|
and prid = #{prid}
|
|
|
</if>
|
|
|
- <if test="type != null">
|
|
|
+ <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>
|
|
|
<if test="contentType != null">
|
|
|
@@ -108,7 +124,13 @@
|
|
|
<if test="prid != null">
|
|
|
and prid = #{prid}
|
|
|
</if>
|
|
|
- <if test="type != null">
|
|
|
+ <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>
|
|
|
<if test="contentType != null">
|