|
|
@@ -0,0 +1,131 @@
|
|
|
+<?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.goafanti.common.dao.PublicAssistDetailsMapper">
|
|
|
+
|
|
|
+ <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="contentType" column="content_type" jdbcType="INTEGER"/>
|
|
|
+ <result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="PublicAssistDetailsAllSql">
|
|
|
+ id, prid, type, content_type, content
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="selectById" resultMap="PublicAssistDetailsMap">
|
|
|
+ select
|
|
|
+ <include refid="PublicAssistDetailsAllSql"/>
|
|
|
+ from public_assist_details
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ 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, type, content_type, content)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.prid}, #{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)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.prid}, #{entity.type}, #{entity.contentType}, #{entity.content})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ prid = values(prid),
|
|
|
+ type = values(type),
|
|
|
+ content_type = values(content_type),
|
|
|
+ content = values(content)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update public_assist_details
|
|
|
+ <set>
|
|
|
+ <if test="prid != null">
|
|
|
+ prid = #{prid},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
+ <if test="contentType != null">
|
|
|
+ content_type = #{contentType},
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ content = #{content},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findPublicAssistDetailsList" resultMap="PublicAssistDetailsMap">
|
|
|
+ select
|
|
|
+ <include refid="PublicAssistDetailsAllSql"/>
|
|
|
+
|
|
|
+ from public_assist_details
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="prid != null">
|
|
|
+ and prid = #{prid}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="contentType != null">
|
|
|
+ and content_type = #{contentType}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findPublicAssistDetailsCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from public_assist_details
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="prid != null">
|
|
|
+ and prid = #{prid}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="contentType != null">
|
|
|
+ and content_type = #{contentType}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from public_assist_details
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|