mybatis crud
//使名空间地址即为CustomerMapper类路径;
id,name,creDate
select replace(uuid(),'-','') from dual insert into tbl_customer () values
(#{id},#{name},#{creDate})
<delete id="deleteCustomerById" parameterType="String" >
delete from tbl_customer where id=#{id}
</delete>
<delete id="batchDeleteCustomerById" >
delete from tbl_customer where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateCustomerById" parameterType="Customer">
update tbl_customer set
name=#{name},creDate=#{creDate}
where id=#{id}
</update>
<select id="findAll" resultType="Customer" resultMap="customerResultMap">
select *
from tbl_customer
</select>
<select id="selectByName" parameterType="String" resultMap="customerResultMap">
select<include refid="customer_column" />
from tbl_customer
where name=#{name}
</select>
<select id="selectById" parameterType="String" resultMap="customerResultMap">
select<include refid="customer_column" />
from tbl_customer
where id=#{id}
</select>
<select id="selectByIds" resultMap="customerResultMap">
select * from tbl_customer where id in
<foreach collection="array" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
<resultMap type="Customer" id="customerResultMap">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="creDate" column="creDate"/>
</resultMap>