42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
|
|
<?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" >
|
||
|
|
<mapper namespace="com.bonus.bm.dao.CompanyTypeDao" >
|
||
|
|
|
||
|
|
<delete id="delete" parameterType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
update bm_company_type set IS_ACTIVE = 0 where id=#{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="findByPage" resultType="com.bonus.bm.beans.CompanyTypeBean" parameterType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
select ID,`NAME` from bm_company_type where IS_ACTIVE = 1
|
||
|
|
<if test="param.keyWord !=null">
|
||
|
|
and `NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
insert into bm_company_type(name,is_active) values (#{name},1)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<select id="find" resultType="com.bonus.bm.beans.CompanyTypeBean" parameterType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
select ID,`NAME` from bm_company_type where IS_ACTIVE = 1
|
||
|
|
and ID=#{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getCompanyType" parameterType="com.bonus.bm.beans.CompanyTypeBean"
|
||
|
|
resultType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
select ID,`NAME`
|
||
|
|
from bm_company_type
|
||
|
|
where IS_ACTIVE = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="findByName" resultType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
select ID,`NAME`
|
||
|
|
from bm_company_type
|
||
|
|
where `NAME` = #{name} and IS_ACTIVE = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id="update" parameterType="com.bonus.bm.beans.CompanyTypeBean">
|
||
|
|
update bm_company_type set NAME =#{name} where id=#{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
</mapper>
|