| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.employment.modules.base.dao.WishInfoUserRecordDAO">
- <resultMap id="WishInfoUserRecordMap" type="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
- <id property="id" column="id_" />
- <result property="regUserId" column="reg_user_id" />
- <result property="wishInfoId" column="wish_info_id" />
- <result property="studentAspirationsId" column="student_aspirations_id" />
- <result property="isSpot" column="is_spot" />
- <result property="status" column="status_" />
- <result property="num" column="num_" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="sender" column="sender_" />
- <result property="senderAddress" column="sender_address" />
- <result property="senderPhone" column="sender_phone" />
- <result property="recipients" column="recipients_" />
- <result property="recipientsAddress" column="recipients_address" />
- <result property="recipientsPhone" column="recipients_phone" />
- <result property="completionTime" column="completion_time" />
- <result property="deliveryTime" column="delivery_time" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_wish_info_user_record
- (id_,reg_user_id,wish_info_id,student_aspirations_id,is_spot,status_,num_,del_flag,create_by,create_time,update_by,update_time,sender_,sender_address,sender_phone,recipients_,recipients_address,recipients_phone,completion_time,delivery_time)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{regUserId,jdbcType=VARCHAR}
- ,#{wishInfoId,jdbcType=VARCHAR}
- ,#{studentAspirationsId,jdbcType=VARCHAR}
- ,#{isSpot,jdbcType= NUMERIC }
- ,#{status,jdbcType=VARCHAR}
- ,#{num,jdbcType=VARCHAR}
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{sender,jdbcType=VARCHAR}
- ,#{senderAddress,jdbcType=VARCHAR}
- ,#{senderPhone,jdbcType=VARCHAR}
- ,#{recipients,jdbcType=VARCHAR}
- ,#{recipientsAddress,jdbcType=VARCHAR}
- ,#{recipientsPhone,jdbcType=VARCHAR}
- ,#{completionTime,jdbcType= TIMESTAMP }
- ,#{deliveryTime,jdbcType= TIMESTAMP }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_wish_info_user_record where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
- update base_wish_info_user_record
- <set>
- <if test="regUserId!=null">
- reg_user_id=#{regUserId,jdbcType=VARCHAR},
- </if>
- <if test="wishInfoId!=null">
- wish_info_id=#{wishInfoId,jdbcType=VARCHAR},
- </if>
- <if test="studentAspirationsId!=null">
- student_aspirations_id=#{studentAspirationsId,jdbcType=VARCHAR},
- </if>
- <if test="isSpot!=null">
- is_spot=#{isSpot,jdbcType= NUMERIC },
- </if>
- <if test="status!=null">
- status_=#{status,jdbcType=VARCHAR},
- </if>
- <if test="num!=null">
- num_=#{num,jdbcType=VARCHAR},
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="sender!=null">
- sender_=#{sender,jdbcType=VARCHAR},
- </if>
- <if test="senderAddress!=null">
- sender_address=#{senderAddress,jdbcType=VARCHAR},
- </if>
- <if test="senderPhone!=null">
- sender_phone=#{senderPhone,jdbcType=VARCHAR},
- </if>
- <if test="recipients!=null">
- recipients_=#{recipients,jdbcType=VARCHAR},
- </if>
- <if test="recipientsAddress!=null">
- recipients_address=#{recipientsAddress,jdbcType=VARCHAR},
- </if>
- <if test="recipientsPhone!=null">
- recipients_phone=#{recipientsPhone,jdbcType=VARCHAR},
- </if>
- <if test="completionTime!=null">
- completion_time=#{completionTime,jdbcType= TIMESTAMP },
- </if>
- <if test="completionTime==null">
- completion_time = null,
- </if>
- <if test="deliveryTime!=null">
- delivery_time=#{deliveryTime,jdbcType= TIMESTAMP },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="WishInfoUserRecordMap">
- select * from base_wish_info_user_record where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_wish_info_user_record where id_=#{0}
- </select>
- <select id="getLastSerialNumber" parameterType="string" resultType="string">
- SELECT num_ FROM base_wish_info_user_record
- WHERE num_ LIKE #{0}
- ORDER BY num_ DESC
- LIMIT 1
- </select>
- <select id="countByWish" parameterType="string" resultType="int">
- SELECT COUNT(*) FROM base_wish_info_user_record
- WHERE del_flag = 0
- AND status_= 1
- AND wish_info_id = #{0}
- </select>
- <select id="countByWishAndStatus" parameterType="string" resultType="int">
- SELECT COUNT(*) FROM base_wish_info_user_record
- WHERE del_flag = 0
- AND status_= #{status}
- AND wish_info_id = #{wishInfoId}
- </select>
- <select id="countByUser" parameterType="string" resultType="int">
- SELECT COUNT(*) FROM base_wish_info_user_record
- WHERE del_flag = 0
- AND status_ = 1
- <if test="regUserId != null">
- AND reg_user_id = #{regUserId}
- </if>
- </select>
- <select id="list" resultMap="WishInfoUserRecordMap">
- select * from base_wish_info_user_record
- </select>
- <select id="search" parameterType="hashmap" resultMap="WishInfoUserRecordMap">
- <![CDATA[
- select a.* from base_wish_info_user_record a
- left join base_wish_info b on a.wish_info_id = b.id_
- left join base_reg_user c on a.reg_user_id = c.id_
- ]]>
- <where>
- a.del_flag = 0
- <if test="searchParams.wishInfoId != null">
- and a.wish_info_id = #{searchParams.wishInfoId}
- </if>
- <if test="searchParams.createBy != null">
- and a.create_by = #{searchParams.createBy}
- </if>
- <if test="searchParams.status != null">
- and a.status_ = #{searchParams.status}
- </if>
- <if test="searchParams.num != null">
- and a.num_ like #{searchParams.num}
- </if>
- <if test="searchParams.phone != null">
- and c.phone_ like #{searchParams.phone}
- </if>
- <if test="searchParams.category != null">
- and b.category_ = #{searchParams.category}
- </if>
- <if test="searchParams.wishInfoTitle != null">
- and b.title_ = #{searchParams.wishInfoTitle}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- </mapper>
|