| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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.PublicReleaseDetailsMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicReleaseDetails">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="prid" jdbcType="INTEGER" property="prid" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="ufid" jdbcType="VARCHAR" property="ufid" />
- <result column="new_user" jdbcType="INTEGER" property="newUser" />
- <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
- </resultMap>
- <sql id="Base_Column_List">
- id, prid, `uid`, ufid, new_user, sign_sum
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from public_release_details
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from public_release_details
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDetails" useGeneratedKeys="true">
- insert into public_release_details (prid, `uid`, ufid,
- new_user, sign_sum)
- values (#{prid,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR},
- #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDetails" useGeneratedKeys="true">
- insert into public_release_details
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="prid != null">
- prid,
- </if>
- <if test="uid != null">
- `uid`,
- </if>
- <if test="ufid != null">
- ufid,
- </if>
- <if test="newUser != null">
- new_user,
- </if>
- <if test="signSum != null">
- sign_sum,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="prid != null">
- #{prid,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="ufid != null">
- #{ufid,jdbcType=VARCHAR},
- </if>
- <if test="newUser != null">
- #{newUser,jdbcType=INTEGER},
- </if>
- <if test="signSum != null">
- #{signSum,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseDetails">
- update public_release_details
- <set>
- <if test="prid != null">
- prid = #{prid,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- `uid` = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="ufid != null">
- ufid = #{ufid,jdbcType=VARCHAR},
- </if>
- <if test="newUser != null">
- new_user = #{newUser,jdbcType=INTEGER},
- </if>
- <if test="signSum != null">
- sign_sum = #{signSum,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicReleaseDetails">
- update public_release_details
- set prid = #{prid,jdbcType=INTEGER},
- `uid` = #{uid,jdbcType=VARCHAR},
- ufid = #{ufid,jdbcType=VARCHAR},
- new_user = #{newUser,jdbcType=INTEGER},
- sign_sum = #{signSum,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByPCid" resultType="com.goafanti.common.model.PublicReleaseDetails">
- select
- id,prid, `uid`, ufid, new_user newUser, sign_sum signSum
- from public_release_details
- where prid = #{id,jdbcType=INTEGER}
- </select>
- <insert id="insertBatch">
- insert into public_release_details (prid, `uid`, ufid,
- new_user, sign_sum)
- values
- <foreach collection="list" item="prd" separator=",">
- (#{prd.prid,jdbcType=INTEGER}, #{prd.uid,jdbcType=VARCHAR}, #{prd.ufid,jdbcType=VARCHAR},
- #{prd.newUser,jdbcType=INTEGER}, #{prd.signSum,jdbcType=INTEGER})
- </foreach>
- </insert>
- <select id="getNamesByPrid" resultType="java.lang.String">
- select GROUP_CONCAT(b.nickname)userNames
- from public_release_details a left join user b on a.uid =b.id
- where prid = #{id}
- group by prid
- </select>
- </mapper>
|