| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?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.LoveProjectDAO">
- <resultMap id="LoveProjectMap" type="com.jpsoft.employment.modules.base.entity.LoveProject">
- <id property="id" column="id_" />
- <result property="title" column="title_" />
- <result property="secondTitle" column="second_title" />
- <result property="content" column="content_" />
- <result property="image" column="image_" />
- <result property="contactPhone" column="contact_phone" />
- <result property="contacts" column="contacts_" />
- <result property="type" column="type_" />
- <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="delFlag" column="del_flag" />
- <result property="feedbackMethod" column="feedback_method" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.LoveProject">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_love_project
- (id_,title_,second_title,content_,image_,contact_phone,contacts_,type_,create_by,create_time,update_by,update_time,del_flag,feedback_method)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{title,jdbcType=VARCHAR}
- ,#{secondTitle,jdbcType=VARCHAR}
- ,#{content,jdbcType=VARCHAR}
- ,#{image,jdbcType=VARCHAR}
- ,#{contactPhone,jdbcType=VARCHAR}
- ,#{contacts,jdbcType=VARCHAR}
- ,#{type,jdbcType=VARCHAR}
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{feedbackMethod,jdbcType=VARCHAR}
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_love_project where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.LoveProject">
- update base_love_project
- <set>
- <if test="title!=null">
- title_=#{title,jdbcType=VARCHAR},
- </if>
- <if test="secondTitle!=null">
- second_title=#{secondTitle,jdbcType=VARCHAR},
- </if>
- <if test="content!=null">
- content_=#{content,jdbcType=VARCHAR},
- </if>
- <if test="image!=null">
- image_=#{image,jdbcType=VARCHAR},
- </if>
- <if test="contactPhone!=null">
- contact_phone=#{contactPhone,jdbcType=VARCHAR},
- </if>
- <if test="contacts!=null">
- contacts_=#{contacts,jdbcType=VARCHAR},
- </if>
- <if test="type!=null">
- type_=#{type,jdbcType=VARCHAR},
- </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="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="feedbackMethod!=null">
- feedback_method=#{feedbackMethod,jdbcType=VARCHAR},
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="LoveProjectMap">
- select * from base_love_project where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_love_project where id_=#{0}
- </select>
- <select id="countByType" parameterType="string" resultType="int">
- SELECT COUNT(*) FROM SELECT * FROM base_participate_project_info a
- LEFT JOIN base_love_project b ON a.love_project_id = b.id_
- WHERE a.del_flag = 0
- AND b.del_flag = 0
- AND a.status_ = 2
- <if test="type != null">
- AND b.type_ = #{type}
- </if>
- </select>
- <select id="list" resultMap="LoveProjectMap">
- select * from base_love_project
- </select>
- <select id="search" parameterType="hashmap" resultMap="LoveProjectMap">
- <![CDATA[
- select * from base_love_project
- ]]>
- <where>
- del_flag = 0
- <if test="searchParams.title != null">
- and title_ like #{searchParams.title}
- </if>
- <if test="searchParams.type != null">
- and type_ = #{searchParams.type}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- </mapper>
|