yangys
6 天以前 7551b1ae51da67627f7ed03276707127dfc9cdc6
blade-service/blade-mdm/src/main/java/org/springblade/mdm/machineback/mapper/MachineBackFileMapper.xml
@@ -5,28 +5,48 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.mdm.machineback.entity.MachineBackFile">
        <id column="id" property="id"/>
        <result column="filename" property="filename"/>
        <result column="name" property="name"/>
        <result column="status" property="status"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="pageQuery" resultType="org.springblade.mdm.machineback.vo.MachineBackFileVO">
        select f.id,f.filename,f.create_time,m.code machineCode,m.name machineName
        from mdm_machine_back_file f join mdm_machine m on f.machine_code=m.code
        select f.id,p.name name,p.is_cured,f.create_time,m.code machine_code, m.name machine_name,f.create_time arrived_time
        from mdm_machine_back_file f
             left join mdm_nc_program p on f.nc_program_id=p.id
             left join mdm_machine m on p.machine_code=m.code
       <where>
           f.status=1 and f.is_deleted=0
        <if test="query.machineSpec!=null and query.machineSpec!=''">
            and m.machine_spec=#{query.machineSpec,jdbcType=VARCHAR}
        </if>
        <if test="query.keyword!=null and query.keyword!=''">
            and (m.code like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') or m.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
            or f.filename like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
            or p.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
                )
        </if>
      </where>
    </select>
    <!--机床回传程序处理分页-->
    <select id="handlePageQuery" resultType="org.springblade.mdm.machineback.vo.MachineBackFileVO">
        select f.id,p.name name,p.code,p.is_cured,f.create_time,m.code machine_code, m.name machine_name,f.create_time arrived_time
        from mdm_machine_back_file f
        left join mdm_nc_program p on f.nc_program_id=p.id
        left join mdm_machine m on p.machine_code=m.code
        <where>
        f.status=2 and f.is_deleted=0
    <!--    <select id="parentTree" resultMap="treeNodeResultMap">-->
<!--        select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0-->
<!--    </select>-->
        <if test="query.confirmTimeBegin!=null">
            and m.confirm_time$gt;=#{query.confirmTimeBegin}
        </if>
        <if test="query.confirmTimeEnd!=null">
            and m.confirm_time$lt;#{query.confirmTimeEnd}
        </if>
        </where>
    </select>
</mapper>