139 lines
3.8 KiB
XML
139 lines
3.8 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||
|
|
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||
|
|
|
||
|
|
<mapper namespace="com.hx.slj.modules.phoneBox.dao.PhoneBoxDao">
|
||
|
|
<!-- parameterType:参数类型,填写实体类的完整名字 -->
|
||
|
|
<resultMap id="basePhoneBox" type="com.hx.slj.modules.phoneBox.entity.PhoneBox" >
|
||
|
|
<id column="ID" property="id"/>
|
||
|
|
<result column="name" property="name"/>
|
||
|
|
<result column="office_id" property="officeId"/>
|
||
|
|
<result column="linkman" property="linkman"/>
|
||
|
|
<result column="phone" property="phone"/>
|
||
|
|
<result column="status" property="status"/>
|
||
|
|
<result column="del_flag" property="delFlag"/>
|
||
|
|
<result column="create_by" property="createBy"/>
|
||
|
|
<result column="create_date" property="createDate"/>
|
||
|
|
<result column="update_by" property="updateBy"/>
|
||
|
|
<result column="update_date" property="updateDate"/>
|
||
|
|
<result column="remarks" property="remarks"/>
|
||
|
|
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<resultMap type="com.hx.slj.modules.phoneBox.entity.PhoneBox" id="joinOffice">
|
||
|
|
<id column="ID" property="id"/>
|
||
|
|
<result column="name" property="name"/>
|
||
|
|
<result column="office_id" property="officeId"/>
|
||
|
|
<result column="linkman" property="linkman"/>
|
||
|
|
<result column="phone" property="phone"/>
|
||
|
|
<result column="status" property="status"/>
|
||
|
|
<result column="del_flag" property="delFlag"/>
|
||
|
|
<result column="create_by" property="createBy"/>
|
||
|
|
<result column="create_date" property="createDate"/>
|
||
|
|
<result column="update_by" property="updateBy"/>
|
||
|
|
<result column="update_date" property="updateDate"/>
|
||
|
|
<result column="remarks" property="remarks"/>
|
||
|
|
<association property="office" javaType="com.hx.slj.modules.sys.entity.Office">
|
||
|
|
<id column="oId" property="id"/>
|
||
|
|
<result column="oName" property="name"/>
|
||
|
|
</association>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<select id="get" resultMap="basePhoneBox" parameterType="com.hx.slj.modules.phoneBox.entity.PhoneBox">
|
||
|
|
select * from phone_box where id = ${id} and del_flag = '0'
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="findList" resultMap="joinOffice" parameterType="com.hx.slj.modules.phoneBox.entity.PhoneBox">
|
||
|
|
select p.*,o.id as 'oId',o.name as 'oName' from phone_box p LEFT JOIN sys_office o on p.office_id = o.ID
|
||
|
|
<where>
|
||
|
|
<if test="id != null">
|
||
|
|
and p.id = #{id}
|
||
|
|
</if>
|
||
|
|
<if test="name != null">
|
||
|
|
and p.id = #{name}
|
||
|
|
</if>
|
||
|
|
<if test="officeId != null">
|
||
|
|
and p.office_id = #{officeId}
|
||
|
|
</if>
|
||
|
|
<if test="linkman != null">
|
||
|
|
and p.linkman = #{linkman} and
|
||
|
|
</if>
|
||
|
|
<if test="phone != null">
|
||
|
|
and p.phone = #{phone}
|
||
|
|
</if>
|
||
|
|
<if test="delFlag != null">
|
||
|
|
and p.del_flag = #{delFlag}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id="update" parameterType="com.hx.slj.modules.phoneBox.entity.PhoneBox">
|
||
|
|
update phone_box
|
||
|
|
<set>
|
||
|
|
<if test="name != null">
|
||
|
|
name = #{name},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="linkman != null">
|
||
|
|
linkman = #{linkman},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="phone != null">
|
||
|
|
phone = #{phone},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="status != null">
|
||
|
|
status = #{status},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="updateBy != null">
|
||
|
|
update_by = #{updateBy},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="updateDate != null">
|
||
|
|
update_date = #{updateDate},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="delFlag != null">
|
||
|
|
del_flag = #{delFlag},
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</set>
|
||
|
|
|
||
|
|
where id = ${id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="com.hx.slj.modules.phoneBox.entity.PhoneBox">
|
||
|
|
insert into phone_box (
|
||
|
|
id,
|
||
|
|
name,
|
||
|
|
office_id,
|
||
|
|
linkman,
|
||
|
|
phone,
|
||
|
|
status,
|
||
|
|
del_flag,
|
||
|
|
create_by,
|
||
|
|
create_date,
|
||
|
|
update_by,
|
||
|
|
update_date,
|
||
|
|
remarks
|
||
|
|
)
|
||
|
|
values(
|
||
|
|
#{id},
|
||
|
|
#{name},
|
||
|
|
#{officeId},
|
||
|
|
#{linkman},
|
||
|
|
#{phone},
|
||
|
|
#{status},
|
||
|
|
#{delFlag},
|
||
|
|
#{createBy},
|
||
|
|
#{createDate},
|
||
|
|
#{updateBy},
|
||
|
|
#{updateDate},
|
||
|
|
#{remarks}
|
||
|
|
)
|
||
|
|
|
||
|
|
</insert>
|
||
|
|
</mapper>
|