TransportationInfo.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.TransportationInfoDAO">
  6. <resultMap id="TransportationInfoMap" type="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="phone" column="phone_" />
  10. <result property="contact" column="contact_" />
  11. <result property="introduction" column="introduction_" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="customerId" column="customer_id" />
  18. </resultMap>
  19. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  20. <!--
  21. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  22. select sys_guid() from dual
  23. </selectKey>
  24. -->
  25. <![CDATA[
  26. insert into base_transportation_info
  27. (id_,name_,phone_,contact_,introduction_,create_time,update_time,create_by,update_by,del_flag,customer_id)
  28. values
  29. (
  30. #{id,jdbcType=VARCHAR}
  31. ,#{name,jdbcType=VARCHAR}
  32. ,#{phone,jdbcType=VARCHAR}
  33. ,#{contact,jdbcType=VARCHAR}
  34. ,#{introduction,jdbcType=VARCHAR}
  35. ,#{createTime,jdbcType= TIMESTAMP }
  36. ,#{updateTime,jdbcType= TIMESTAMP }
  37. ,#{createBy,jdbcType=VARCHAR}
  38. ,#{updateBy,jdbcType=VARCHAR}
  39. ,#{delFlag,jdbcType= NUMERIC }
  40. ,#{customerId,jdbcType=VARCHAR}
  41. )
  42. ]]>
  43. </insert>
  44. <delete id="delete" parameterType="string">
  45. delete from base_transportation_info where id_=#{id,jdbcType=VARCHAR}
  46. </delete>
  47. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  48. update base_transportation_info
  49. <set>
  50. <if test="name!=null">
  51. name_=#{name,jdbcType=VARCHAR},
  52. </if>
  53. <if test="phone!=null">
  54. phone_=#{phone,jdbcType=VARCHAR},
  55. </if>
  56. <if test="contact!=null">
  57. contact_=#{contact,jdbcType=VARCHAR},
  58. </if>
  59. <if test="introduction!=null">
  60. introduction_=#{introduction,jdbcType=VARCHAR},
  61. </if>
  62. <if test="createTime!=null">
  63. create_time=#{createTime,jdbcType= TIMESTAMP },
  64. </if>
  65. <if test="updateTime!=null">
  66. update_time=#{updateTime,jdbcType= TIMESTAMP },
  67. </if>
  68. <if test="createBy!=null">
  69. create_by=#{createBy,jdbcType=VARCHAR},
  70. </if>
  71. <if test="updateBy!=null">
  72. update_by=#{updateBy,jdbcType=VARCHAR},
  73. </if>
  74. <if test="delFlag!=null">
  75. del_flag=#{delFlag,jdbcType= NUMERIC },
  76. </if>
  77. <if test="customerId!=null">
  78. customer_id=#{customerId,jdbcType=VARCHAR},
  79. </if>
  80. </set>
  81. where id_=#{id}
  82. </update>
  83. <select id="get" parameterType="string" resultMap="TransportationInfoMap">
  84. select * from base_transportation_info where id_=#{0}
  85. </select>
  86. <select id="exist" parameterType="string" resultType="int">
  87. select count(*) from base_transportation_info where id_=#{0}
  88. </select>
  89. <select id="list" resultMap="TransportationInfoMap">
  90. select * from base_transportation_info
  91. </select>
  92. <select id="findByCustomerId" resultMap="TransportationInfoMap">
  93. select * from base_transportation_info where del_flag=false and customer_id=#{0}
  94. </select>
  95. <select id="search" parameterType="hashmap" resultMap="TransportationInfoMap">
  96. <![CDATA[
  97. select * from base_transportation_info
  98. ]]>
  99. <where>
  100. <if test="searchParams.id != null">
  101. and ID_ like #{searchParams.id}
  102. </if>
  103. </where>
  104. <foreach item="sort" collection="sortList" open="order by" separator=",">
  105. ${sort.name} ${sort.order}
  106. </foreach>
  107. </select>
  108. <select id="searchMobile" parameterType="hashmap" resultMap="TransportationInfoMap">
  109. <![CDATA[
  110. select * from base_transportation_info
  111. ]]>
  112. <where>
  113. <if test="searchParams.id != null">
  114. and ID_ like #{searchParams.id}
  115. </if>
  116. </where>
  117. <foreach item="sort" collection="sortList" open="order by" separator=",">
  118. ${sort.name} ${sort.order}
  119. </foreach>
  120. </select>
  121. </mapper>