Ibatis sql语句

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<!-- ========================================================== -->
<!-- Configuration for ibatis sqlmap mapping. -->
<!-- ========================================================== -->

<!-- ============================================================================= -->
<!-- This file is generated by <tt>borncrm-dalgen</tt>, a DAL (Data Access Layer) -->
<!-- code generation utility specially developed for <tt>rent</tt> project. -->
<!-- -->
<!-- PLEASE DO NOT MODIFY THIS FILE MANUALLY, or else your modification may be -->
<!-- OVERWRITTEN by someone else. To modify the file, you should go to directory -->
<!-- <tt>(project-home)/biz/dal/src/conf/dalgen</tt>, and find the corresponding -->
<!-- configuration files. Modify those files according to your needs, then run -->
<!-- <tt>borncrm-dalgen</tt> to generate this file. -->
<!-- -->
<!-- @author peigen -->
<!-- ============================================================================= -->

<sqlMap namespace="borncrm">
<!-- ============================================= -->
<!-- RESULT MAPS -->
<!-- ============================================= -->

<!-- result maps for database table custom_sale_clew -->
<resultMap id="RM-CUSTOM-SALE-CLEW" class="com.yjf.borncrm.dal.dataobject.CustomSaleClewDO">

<result property="baseId" column="base_id" javaType="java.lang.String" jdbcType="VARCHAR" nullValue="0"/>
<result property="realName" column="real_name" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="gender" column="gender" javaType="int" jdbcType="INT" nullValue="0"/>
<result property="age" column="age" javaType="int" jdbcType="INT" nullValue="0"/>
<result property="referees" column="referees" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="mobile" column="mobile" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="mail" column="mail" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="certNo" column="cert_no" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="qq" column="qq" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="rawAddTime" column="raw_add_time" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
<result property="rawUpdateTime" column="raw_update_time" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
<result property="userId" column="user_id" javaType="java.lang.String" jdbcType="VARCHAR" nullValue="0"/>
<result property="platformId" column="platform_id" javaType="long" jdbcType="BIGINT" nullValue="0"/>

<result property="inputPerson" column="input_person" javaType="java.lang.String" jdbcType="VARCHAR" nullValue=""/>
<result property="inputPersonName" column="input_person_name" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="salePerson" column="sale_person" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="salePersonName" column="sale_person_name" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result property="clewType" column="clew_type" javaType="java.lang.String" jdbcType="VARCHAR"/>

<result property="status" column="status" javaType="java.lang.String" jdbcType="CHAR"/>
<result property="userName" column="user_name" javaType="java.lang.String" jdbcType="VARCHAR"/>
</resultMap>


<!-- ============================================= -->
<!-- mapped statements for IbatisCustomSaleClewDAO -->
<!-- ============================================= -->
<!-- mapped statement for IbatisCustomSaleClewDAO.insert -->
<insert id="MS-CUSTOM-SALE-CLEW-INSERT">
INSERT /*MS-BORNCRM-CUSTOM-SALE-CLEW-INSERT*/ INTO custom_sale_clew (base_id,real_name,gender,age,referees,mobile,mail,cert_no,qq,raw_add_time,user_id,platform_id,input_person,input_person_name,sale_person,sale_person_name,clew_type,status,user_name)
VALUES(#baseId#,#realName#,#gender#,#age#,#referees#,#mobile#,#mail#,#certNo#,#qq#,CURRENT_TIMESTAMP,#userId#,#platformId#,#inputPerson#,#inputPersonName#,#salePerson#,#salePersonName#,#clewType#,#status#,#userName#)
</insert>

<!-- mapped statement for IbatisCustomSaleClewDAO.update -->
<update id="MS-CUSTOM-SALE-CLEW-UPDATE">
UPDATE /*MS-BORNCRM-CUSTOM-SALE-CLEW-UPDATE*/ custom_sale_clew SET real_name=#realName#, gender=#gender#, age=#age#, referees=#referees#, mobile=#mobile#, mail=#mail#, cert_no=#certNo#, qq=#qq#, user_id=#userId#, platform_id=#platformId#,
input_person=#inputPerson#, input_person_name=#inputPersonName#, sale_person=#salePerson#, sale_person_name=#salePersonName#, clew_type=#clewType#, status=#status#, user_name=#userName# WHERE (base_id = #baseId#)
</update>

<update id="MS-CUSTOM-SALE-CLEW-UPDATE-SALE-PERSON">
UPDATE /*MS-CUSTOM-SALE-CLEW-UPDATE-SALE-PERSON*/ custom_sale_clew SET sale_person=#salePerson#, sale_person_name=#salePersonName# WHERE (base_id = #baseId#)
</update>

<!-- mapped statement for IbatisCustomSaleClewDAO.deleteBybaseId -->
<delete id="MS-CUSTOM-SALE-CLEW-DELETE-BYBASE-ID">
<![CDATA[
DELETE /*MS-BORNCRM-CUSTOM-SALE-CLEW-DELETE-BYBASE-ID*/ FROM custom_sale_clew WHERE (base_id = #value#)
]]>
</delete>

<!-- mapped statement for IbatisCustomSaleClewDAO.findByBaseId -->
<select id="MS-CUSTOM-SALE-CLEW-FIND-BY-BASE-ID" resultMap="RM-CUSTOM-SALE-CLEW">

SELECT /*MS-BORNCRM-CUSTOM-SALE-CLEW-FIND-BY-CONDITION*/ base_id ,real_name ,gender ,age ,referees ,mobile ,mail ,cert_no ,qq ,raw_add_time ,raw_update_time ,user_id ,platform_id ,input_person,input_person_name ,sale_person ,sale_person_name ,clew_type ,status ,user_name FROM custom_sale_clew WHERE status ='1' and (base_id = #baseId#)
</select>

<!-- mapped statement for IbatisCustomSaleClewDAO.SELECTCount -->
<select id="MS-CUSTOM-SALE-CLEW-SELECT-COUNT" resultClass="long">
<![CDATA[
SELECT /*MS-BORNCRM-CUSTOM-SALE-CLEW-SELECT-COUNT*/ COUNT(*) FROM custom_sale_clew where status='1'
]]>
</select>

<!-- mapped statement for IbatisCustomSaleClewDAO.findByCondition -->
<select id="MS-CUSTOM-SALE-CLEW-FIND-BY-CONDITION" resultMap="RM-CUSTOM-SALE-CLEW">
SELECT /*MS-BORNCRM-CUSTOM-SALE-CLEW-FIND-BY-CONDITION*/ base_id ,real_name ,gender ,age ,referees ,mobile ,mail ,cert_no ,qq ,raw_add_time ,raw_update_time ,user_id ,platform_id ,input_person,input_person_name ,sale_person ,sale_person_name ,clew_type ,status ,user_name FROM custom_sale_clew
where 1=1 and status='1'
<dynamic>
<isGreaterThan property="customSaleClew.baseId" compareValue="0" prepend=" and ">
base_id=#customSaleClew.baseId#
</isGreaterThan>
<isGreaterThan property="customSaleClew.platformId" compareValue="0" prepend=" and ">
platform_id=#customSaleClew.platformId#
</isGreaterThan>
<isGreaterThan property="customSaleClew.userId" compareValue="0" prepend=" and ">
user_id=#customSaleClew.userId#
</isGreaterThan>
<isNotEmpty property="customSaleClew.realName" prepend=" and ">
real_name=#customSaleClew.realName#
</isNotEmpty>
<isNotEmpty property="customSaleClew.mobile" prepend=" and ">
mobile=#customSaleClew.mobile#
</isNotEmpty>
<isNotEmpty property="customSaleClew.mail" prepend=" and ">
mail=#customSaleClew.mail#
</isNotEmpty>
<isNotEmpty property="customSaleClew.clewType" prepend=" and ">
clew_type=#customSaleClew.clewType#
</isNotEmpty>
<isNotEmpty property="customSaleClew.salePerson" prepend=" and ">
sale_person=#customSaleClew.salePerson#
</isNotEmpty>
</dynamic>
LIMIT #limitStart#,#pageSize#
</select>

<!-- mapped statement for IbatisCustomSaleClewDAO.findCountByCondition -->
<select id="MS-CUSTOM-SALE-CLEW-FIND-COUNT-BY-CONDITION" resultClass="long">
SELECT /*MS-BORNCRM-CUSTOM-SALE-CLEW-FIND-COUNT-BY-CONDITION*/ COUNT(*) FROM custom_sale_clew WHERE 1=1
<dynamic>
<isNotEmpty property="minAawAddTime" prepend=" and ">
to_days(raw_add_time) &gt;=to_days(#minAawAddTime#)
</isNotEmpty>
<isNotEmpty property="maxAawAddTime" prepend=" and ">
to_days(raw_add_time) &lt;= to_days(#maxAawAddTime#)
</isNotEmpty>
<isNotEmpty property="startLatelyInvestTime" prepend=" and ">
to_days(now())-to_days(raw_add_time) &lt;= #days#
</isNotEmpty>

<isGreaterThan property="customSaleClew.baseId" compareValue="0" prepend=" and ">
base_id=#customSaleClew.baseId#
</isGreaterThan>
<isGreaterThan property="customSaleClew.platformId" compareValue="0" prepend=" and ">
platform_id=#customSaleClew.platformId#
</isGreaterThan>
<isGreaterThan property="customSaleClew.userId" compareValue="0" prepend=" and ">
user_id=#customSaleClew.userId#
</isGreaterThan>
<isNotEmpty property="customSaleClew.realName" prepend=" and ">
real_name=#customSaleClew.realName#
</isNotEmpty>
<isNotEmpty property="customSaleClew.mobile" prepend=" and ">
mobile=#customSaleClew.mobile#
</isNotEmpty>
<isNotEmpty property="customSaleClew.mail" prepend=" and ">
mail=#customSaleClew.mail#
</isNotEmpty>
<isNotEmpty property="customSaleClew.clewType" prepend=" and ">
clew_type=#customSaleClew.clewType#
</isNotEmpty>
<isNotEmpty property="customSaleClew.salePerson" prepend=" and ">
sale_person=#customSaleClew.salePerson#
</isNotEmpty>
</dynamic>
</select>

</sqlMap>

posted @ 2015-03-26 09:13  萧雪痕  阅读(884)  评论(1编辑  收藏  举报