126 lines
6.0 KiB
XML
126 lines
6.0 KiB
XML
<?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.sgzb.base.mapper.MaHouseSetMapper">
|
|
|
|
<resultMap type="com.bonus.sgzb.base.domain.MaHouseSet" id="SysHouseSetResult">
|
|
<id property="houseId" column="house_id" />
|
|
<result property="typeId" column="type_id" />
|
|
<result property="maId" column="ma_id" />
|
|
<result property="num" column="num" />
|
|
<result property="status" column="status" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="companyId" column="company_id" />
|
|
<result property="shelfNum" column="shelf_num" />
|
|
</resultMap>
|
|
|
|
<sql id="selectHouseSetVo">
|
|
select house_id, type_id, ma_id, num, status, dept_id, del_flag, create_by, create_time, update_by,update_time,remark,company_id,shelf_num
|
|
from ma_house_set
|
|
</sql>
|
|
|
|
<select id="selectMaHouseSetByHouseId" parameterType="Long" resultMap="SysHouseSetResult">
|
|
<include refid="selectHouseSetVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="maHouseSetAdd" parameterType="com.bonus.sgzb.base.domain.MaHouseSet" >
|
|
insert into ma_house_set(
|
|
<if test="houseId != null and houseId != 0">house_id,</if>
|
|
<if test="typeId != null and typeId != ''">type_id,</if>
|
|
<if test="maId != null and maId != 0">ma_id,</if>
|
|
<if test="num != null and num != ''">num,</if>
|
|
<if test="status != null and status != 0">status,</if>
|
|
<if test="deptId != null and deptId != ''">dept_id,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="companyId != null and companyId != ''">company_id,</if>
|
|
<if test="shelfNum != null and shelfNum != ''">shelf_num,</if>
|
|
create_time
|
|
)values(
|
|
<if test="houseId != null and houseId != 0">#{houseId},</if>
|
|
<if test="typeId != null and typeId != ''">#{typeId},</if>
|
|
<if test="maId != null and maId != 0">#{maId},</if>
|
|
<if test="num != null and num != ''">#{num},</if>
|
|
<if test="status != null and status != 0">#{status},</if>
|
|
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
|
<if test="shelfNum != null and shelfNum != ''">#{shelfNum},</if>
|
|
sysdate()
|
|
)
|
|
</insert>
|
|
|
|
<update id="updateHouseSet">
|
|
update ma_house_info
|
|
<set>
|
|
<if test="houseId != null and houseId != ''">house_id = #{houseId},</if>
|
|
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
|
|
<if test="maId != null and maId != ''">ma_id = #{maId},</if>
|
|
<if test="num != null and num != ''">num = #{num},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
|
update_time = sysdate()
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteHouseSetById" parameterType="Long">
|
|
update ma_house_set set del_flag = '2' where id = #{id}
|
|
</delete>
|
|
|
|
|
|
|
|
<select id="getHouseSetList" resultType="com.bonus.sgzb.base.domain.MaHouseSet">
|
|
select mt.type_name specificationType, mt1.type_name machineTypeName, mt2.type_name itemType ,
|
|
mm.ma_code maCode, mhs.house_id, mhs.type_id, mhs.ma_id, mhs.num, mhs.status, mhs.dept_id, mhs.del_flag,
|
|
mhs.create_by, mhs.create_time, mhs.update_by,mhs.update_time,mhs.remark,mhs.company_id
|
|
from ma_machine mm
|
|
left join ma_type mt on mm.type_id = mt.type_id
|
|
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
|
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
|
left join ma_house_set mhs on mt.type_id = mhs.type_id
|
|
where mt.manage_type = '0' and mt.level = '4'
|
|
<if test="houseId != null and houseId != ''">
|
|
AND mhs.house_id = #{houseId}
|
|
</if>
|
|
<if test="typeId != null and typeId != ''">
|
|
AND mhs.type_id = #{typeId}
|
|
</if>
|
|
<if test="maId != null and maId != ''">
|
|
AND mhs.ma_id = #{maId}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
and mhs.status = #{status}
|
|
</if>
|
|
<if test="deptId != null and deptId != ''">
|
|
and mhs.dept_id = #{deptId}
|
|
</if>
|
|
<if test="delFlag != null and delFlag != ''">
|
|
and mhs.del_flag = #{delFlag}
|
|
</if>
|
|
<if test="companyId != null and companyId != ''">
|
|
and mhs.company_id = #{companyId}
|
|
</if>
|
|
</select>
|
|
|
|
|
|
|
|
</mapper> |